Skip to content

Stepper

KStepper - An ordered Stepper component

  1. Completed
  2. Active
  3. Default
html
<KStepper :steps="steps" />

Props

steps

An array of step objects. Each step object should have a required label property, and an optional state property.

  1. Completed
  2. Completed
  3. Pending
  4. Default
html
<KStepper :steps="[
    { label: 'Step  a long long long long time ago', state: 'completed' },
    { label: 'in a galaxy far far away', state: 'completed' },
    { label: 'Kongponents were battling in space and', state: 'pending' },
    { label: 'fighting robots and space monsters with lots of explosions' }
  ]"
/>

Properties

  • label (required) - the text displayed beneath the step
  • state - the state of the step controls the icon, we support: completed, pending, and error. If a state property is not provided, it will show the default grey icon.

States

A step with a state of completed results in a filled-in divider.

  1. Completed
  2. Default
js
[
  { label: 'A completed step', state: 'completed' },
  { label: 'End' }
]

active, pending, and error states will bold the label, because these 3 states indicate the "current" step. completed indicates past steps, while default indicates future steps.

  1. Active
  2. Default
js
[
  { label: 'An active step', state: 'active' },
  { label: 'End' }
]
  1. Pending
  2. Default
js
[
  { label: 'A pending step', state: 'pending' },
  { label: 'End' }
]
  1. Error
  2. Default
js
[
  { label: 'An erroneous step', state: 'error' },
  { label: 'End' }
]

The last step will never have a following divider.

  1. Default
js
[{ label: 'A default step' }]

maxLabelWidth

The width of step labels (default is 170px). We support numbers (will be converted to px), auto, and percentages (e.g. 25%) for values.

  1. Completed
  2. Completed
  3. Pending
  4. Default
html
<KStepper :steps="steps" max-label-width="100" />

Theming

VariablePurpose
KStepIconSizeHeight and width of step state icon
KStepBackgroundColorBackground color of the step state icon
KStepDividerColorCompletedColor of divider for completed steps
KStepDividerColorDefaultColor of divider for non-completed steps
KStepActiveColorPrimary color of active state icon
KStepCompletedColorPrimary color of completed state icon
KStepCompletedSecondaryColorSecondary color of completed state icon
KStepDefaultColorPrimary color of default state icon
KStepErrorColorPrimary color of error state icon
KStepErrorSecondaryColorSecondary color of error state icon
KStepPendingColorPrimary color for pending state icon

An example of theming the stepper:

Note: We are scoping the overrides to a wrapper in this example

  1. Completed
  2. Active
  3. Pending
  4. Error
  5. Default
html
<template>
  <div class="k-stepper-wrapper">
    <KStepper :steps="steps" />
  </div>
</template>

<style lang="scss">
.k-stepper-wrapper {
  --KStepIconSize: 40px;
  --KStepDividerColorCompleted: green;
  --KStepDividerColorDefault: lightgrey;
  --KStepActiveColor: slateblue;
  --KStepCompletedColor: green;
  --KStepDefaultColor: lightgrey;
  --KStepErrorColor: red;
  --KStepPendingColor: sandybrown;
}
</style>

Released under the Apache-2.0 License.