nb-stepper
This is a stepper component for Vue.js 3+. It supports horizontal and vertical layouts, click/keyboard navigation, and status events (start, in progress, end, finished).
Loading component...
Installation
Yarn
yarn add @vlalg-nimbus/nb-navigation
Usage
Vue 3
import { createApp } from 'vue'
import App from './App.vue'
import NbNavigationComponents from '@vlalg-nimbus/nb-navigation'
import "@vlalg-nimbus/nb-navigation/dist/style.css";
const app = createApp(App)
app.use(NbNavigationComponents)
app.mount('#app')
To use, simply call the component, in this case it will be NbStepper or nb-stepper.
Horizontal
<template>
<NbStepper
nb-id="stepper-1"
:step="2"
:steps="4"
orientation="horizontal"
/>
</template>
Preview & Playground
Select the component you want to edit/test
Loading Sandbox...
Props
Items with an (*) mean they are required
| name | Value type | Default | Description |
|---|---|---|---|
| nbId (*) | String | Sets the id attribute to differentiate from other components | |
| step | Number | 0 | Current step. Supports values from 0 to steps + 1 |
| steps | Number | 2 | Total steps (minimum 2) |
| orientation | String | 'horizontal' | Stepper direction. Accepts horizontal and vertical |
| blockClick | Boolean | true | Blocks click interaction on circles when true |
| tabIndex | Number | 0 | Keyboard tab index for the component |
| hasTabIndexEnter | Boolean | true | Enables step change with Enter key |
| hasTabIndexSpace | Boolean | true | Enables step change with Space key |
| disabled | Boolean | false | Disables the component |
| theme | String | 'light' | Defines theme. Accepts light and dark |
| ariaLabel | String | 'Input Base' | aria-label value for accessibility |
| ariaAttrs | Object | {} | Additional aria attributes (auto-prefixed with aria-) |
| transition | String | '0.3s' | Transition duration. Accepts 0.3s, 0.5s, 1s |
| circleSize | Number | 0.8 | Circle size in rem |
| circleBorderSize | Number | 0.13 | Circle border width in rem |
| lineSize | Number | 0.1 | Line thickness in rem |
Theme Colors (Light)
Neutral gray ramp on a light surface (connector → pending circle → active ring → done/focus → finished).
| name | Value type | Default | Description |
|---|---|---|---|
| lightLineColor | String | #cccccc | Connector line color (border + background) |
| lightCircleColor | String | #cccccc | Pending step circle border color |
| lightActiveColor | String | #9e9e9e | Current step circle border color |
| lightDoneColor | String | #9e9e9e | Done step line + circle fill (background) |
| lightFinishedColor | String | #ebebeb | Finished state circle fill (step > steps) |
| lightFocusColor | String | #9e9e9e | :focus-visible circle fill (defaults match done) |
Theme Colors (Dark)
Same ramp roles as light (connector → pending → active → done/focus → finished). Defaults assume a dark surrounding surface; darkFinishedColor is #000000 for a strong final-state mark (adjust per product skin).
| name | Value type | Default | Description |
|---|---|---|---|
| darkLineColor | String | #939090 | Connector line color (border + background) |
| darkCircleColor | String | #939090 | Pending step circle border color |
| darkActiveColor | String | #646464 | Current step circle border color |
| darkDoneColor | String | #525151 | Done step line + circle fill (background) |
| darkFinishedColor | String | #000000 | Finished state circle fill (step > steps) |
| darkFocusColor | String | #525151 | :focus-visible circle fill (defaults match done) |
Events
| name | Return type | Description |
|---|---|---|
| changed | Number | Fired when step changes by click or watcher update |
| status | String | Fired with current status: start, in progress, end, finished |
Notes
- In vertical mode, define a height on the parent container to let the stepper fill available space.
- Status behavior:
start: first stepin progress: between first and lastend: at last stepfinished: after last step (step > steps)
