nb-stepper-line

This is a line stepper component for Vue.js 3+.

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 as NbStepperLine or nb-stepper-line.

Numeric Steps
<template>
  <NbStepperLine
    nb-id="stepper-line-1"
    :step="1"
    :steps="4"
  />
</template>
Array Steps
<template>
  <NbStepperLine
    nb-id="stepper-line-2"
    :step="1"
    :steps="[
      { id: 1, title: 'Step One' },
      { id: 2, title: 'Step Two' },
      { id: 3, title: 'Step Three' }
    ]"
    :steps-disabled="[2]"
    :block-click="false"
    :has-tab-index-enter="true"
    :has-tab-index-space="true"
  />
</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 index
stepsNumber | Array2Total steps (Number) or items list (Array)
stepsDisabledArray[]Disabled step indexes
disabledBooleanfalseDisables the component
blockClickBooleantrueBlocks click interaction when true
tabIndexNumber0Keyboard tab index
hasTabIndexEnterBooleantrueEnables step change with Enter key
hasTabIndexSpaceBooleantrueEnables step change with Space key
themeString'light'Defines theme. Accepts light and dark
ariaLabelString'Input Base'aria-label value for accessibility
ariaAttrsObject{}Additional aria attributes (auto-prefixed with aria-)

Layout / Visibility

nameValue typeDefaultDescription
gapNumber1Gap between items (em)
minWidthNumber20Min width of non-selected item (px)
maxWidthNumber50Max width of non-selected item (px)
minWidthSelectedNumber6Min width of selected item (em)
ellipsisTextBooleantrueEnables text ellipsis for number/label
showTabBooleantrueShows tab number
showLabelBooleantrueShows label
opacityDisabledNumber0.4Disabled state opacity
scrollClassString''Extra CSS class on the horizontal scroll container (.nb-stepper-line__nav), e.g. scrollbar styling

Number (counter)

nameValue typeDefaultDescription
tabTextAlignString'right'Number text alignment (left, center, right)
tabOpacityNumber0.2Number opacity for non-selected item
tabSelectedOpacityNumber1Number opacity for selected item
tabFontFamilyString'Lato', sans-serifNumber font family
tabFontSizeString'1.6em'Number font size
tabFontSizeActiveString'1.2em'Number font size for selected item
tabFontWeightNumber400Number font weight
tabFontWeightActiveNumber400Number font weight for selected item

Line

nameValue typeDefaultDescription
lineHeightNumber2Line height in px
lineOpacityNumber0.3Line opacity for non-selected item
lineSelectedOpacityNumber1Line opacity for selected item
lineMarginTopNumber0.1Line top margin (em)
lineMarginBottomNumber0.1Line bottom margin (em)
lineMarginTopActiveNumber0.15Line top margin for selected item (em)
lineMarginBottomActiveNumber0.15Line bottom margin for selected item (em)

Theme colors (theme="light")

These props apply when theme is light. They replace the old single tabColor / lineBackground props (colors are no longer shared across themes).

nameValue typeDefaultDescription
lightTabColorString#000000Number color (non-selected segment)
lightTabColorSelectedString#000000Number color (selected segment)
lightLineBackgroundString#bdbdbdLine segment color (non-selected)
lightLineBackgroundSelectedString#bdbdbdLine segment color (selected)

Theme colors (theme="dark")

These props apply when theme is dark.

nameValue typeDefaultDescription
darkTabColorString#000000Number color (non-selected segment)
darkTabColorSelectedString#000000Number color (selected segment)
darkLineBackgroundString#353734Line segment color (non-selected)
darkLineBackgroundSelectedString#353734Line segment color (selected)

Label

nameValue typeDefaultDescription
labelTextAlignString'left'Label alignment (left, center, right)
labelSelectedOpacityNumber1Label opacity for selected item
labelFontFamilyString'Lato', sans-serifLabel font family
labelFontSizeString'1.6em'Label font size
labelFontSizeActiveString'1.2em'Label font size for selected item
labelFontWeightNumber400Label font weight
labelFontWeightActiveNumber400Label font weight for selected item

Slots

Per-step slots use the step index (0-based), same pattern as NbSegmentedButton (option-{index}).

nameScopeDescription
tab-number-{index}{ option, index, options }Custom content for the step number area (option is the normalized step object with id and title)
label-{index}{ option, index, options }Custom label instead of the default <strong>{{ item.title }}</strong>

Events

nameReturn typeDescription
changedNumberEmitted with the active step index (0-based) whenever the step updates: controlled step prop or user action (click / Enter / Space when interaction is allowed)

Notes

  • In array mode (steps as Array), each item can be a string or object.
  • For object items, id and title are used when available.
  • Disabled steps (stepsDisabled) are not clickable and are skipped by change handlers.
  • The step list scrolls horizontally when it overflows (overflow-x on the inner nav); use scrollClass if you need custom scrollbar or overflow styling.
  • Colors for numbers and line segments are controlled separately for light and dark via the light* and dark* props above (no single tabColor / lineBackground anymore).