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
NPM
npm install @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')
Nuxt 3
import NbNavigationComponents from '@vlalg-nimbus/nb-navigation'
import "@vlalg-nimbus/nb-navigation/dist/style.css";

export default defineNuxtPlugin(context => {
  context.vueApp.use(NbNavigationComponents)
})

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>
Vertical
<template>
  <div style="height: 300px;">
    <NbStepper
      nb-id="stepper-2"
      :step="2"
      :steps="4"
      orientation="vertical"
    />
  </div>
</template>

Preview & Playground

Select the component you want to edit/test

Loading Sandbox...

Props

Items with an (*) mean they are required

nameValue typeDefaultDescription
nbId (*)StringSets the id attribute to differentiate from other components
stepNumber0Current step. Supports values from 0 to steps + 1
stepsNumber2Total steps (minimum 2)
orientationString'horizontal'Stepper direction. Accepts horizontal and vertical
blockClickBooleantrueBlocks click interaction on circles when true
tabIndexNumber0Keyboard tab index for the component
hasTabIndexEnterBooleantrueEnables step change with Enter key
hasTabIndexSpaceBooleantrueEnables step change with Space key
disabledBooleanfalseDisables the component
themeString'light'Defines theme. Accepts light and dark
ariaLabelString'Input Base'aria-label value for accessibility
ariaAttrsObject{}Additional aria attributes (auto-prefixed with aria-)
transitionString'0.3s'Transition duration. Accepts 0.3s, 0.5s, 1s
circleSizeNumber0.8Circle size in rem
circleBorderSizeNumber0.13Circle border width in rem
lineSizeNumber0.1Line thickness in rem

Theme Colors (Light)

Neutral gray ramp on a light surface (connector → pending circle → active ring → done/focus → finished).

nameValue typeDefaultDescription
lightLineColorString#ccccccConnector line color (border + background)
lightCircleColorString#ccccccPending step circle border color
lightActiveColorString#9e9e9eCurrent step circle border color
lightDoneColorString#9e9e9eDone step line + circle fill (background)
lightFinishedColorString#ebebebFinished state circle fill (step > steps)
lightFocusColorString#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).

nameValue typeDefaultDescription
darkLineColorString#939090Connector line color (border + background)
darkCircleColorString#939090Pending step circle border color
darkActiveColorString#646464Current step circle border color
darkDoneColorString#525151Done step line + circle fill (background)
darkFinishedColorString#000000Finished state circle fill (step > steps)
darkFocusColorString#525151:focus-visible circle fill (defaults match done)

Events

nameReturn typeDescription
changedNumberFired when step changes by click or watcher update
statusStringFired 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 step
    • in progress: between first and last
    • end: at last step
    • finished: after last step (step > steps)