nb-stepper-line
This is a line stepper component for Vue.js 3+.
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 as NbStepperLine or nb-stepper-line.
Numeric Steps
<template>
<NbStepperLine
nb-id="stepper-line-1"
:step="1"
:steps="4"
/>
</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 index |
| steps | Number | Array | 2 | Total steps (Number) or items list (Array) |
| stepsDisabled | Array | [] | Disabled step indexes |
| disabled | Boolean | false | Disables the component |
| blockClick | Boolean | true | Blocks click interaction when true |
| tabIndex | Number | 0 | Keyboard tab index |
| hasTabIndexEnter | Boolean | true | Enables step change with Enter key |
| hasTabIndexSpace | Boolean | true | Enables step change with Space key |
| 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-) |
Layout / Visibility
| name | Value type | Default | Description |
|---|---|---|---|
| gap | Number | 1 | Gap between items (em) |
| minWidth | Number | 20 | Min width of non-selected item (px) |
| maxWidth | Number | 50 | Max width of non-selected item (px) |
| minWidthSelected | Number | 6 | Min width of selected item (em) |
| ellipsisText | Boolean | true | Enables text ellipsis for number/label |
| showTab | Boolean | true | Shows tab number |
| showLabel | Boolean | true | Shows label |
| opacityDisabled | Number | 0.4 | Disabled state opacity |
| scrollClass | String | '' | Extra CSS class on the horizontal scroll container (.nb-stepper-line__nav), e.g. scrollbar styling |
Number (counter)
| name | Value type | Default | Description |
|---|---|---|---|
| tabTextAlign | String | 'right' | Number text alignment (left, center, right) |
| tabOpacity | Number | 0.2 | Number opacity for non-selected item |
| tabSelectedOpacity | Number | 1 | Number opacity for selected item |
| tabFontFamily | String | 'Lato', sans-serif | Number font family |
| tabFontSize | String | '1.6em' | Number font size |
| tabFontSizeActive | String | '1.2em' | Number font size for selected item |
| tabFontWeight | Number | 400 | Number font weight |
| tabFontWeightActive | Number | 400 | Number font weight for selected item |
Line
| name | Value type | Default | Description |
|---|---|---|---|
| lineHeight | Number | 2 | Line height in px |
| lineOpacity | Number | 0.3 | Line opacity for non-selected item |
| lineSelectedOpacity | Number | 1 | Line opacity for selected item |
| lineMarginTop | Number | 0.1 | Line top margin (em) |
| lineMarginBottom | Number | 0.1 | Line bottom margin (em) |
| lineMarginTopActive | Number | 0.15 | Line top margin for selected item (em) |
| lineMarginBottomActive | Number | 0.15 | Line 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).
| name | Value type | Default | Description |
|---|---|---|---|
| lightTabColor | String | #000000 | Number color (non-selected segment) |
| lightTabColorSelected | String | #000000 | Number color (selected segment) |
| lightLineBackground | String | #bdbdbd | Line segment color (non-selected) |
| lightLineBackgroundSelected | String | #bdbdbd | Line segment color (selected) |
Theme colors (theme="dark")
These props apply when theme is dark.
| name | Value type | Default | Description |
|---|---|---|---|
| darkTabColor | String | #000000 | Number color (non-selected segment) |
| darkTabColorSelected | String | #000000 | Number color (selected segment) |
| darkLineBackground | String | #353734 | Line segment color (non-selected) |
| darkLineBackgroundSelected | String | #353734 | Line segment color (selected) |
Label
| name | Value type | Default | Description |
|---|---|---|---|
| labelTextAlign | String | 'left' | Label alignment (left, center, right) |
| labelSelectedOpacity | Number | 1 | Label opacity for selected item |
| labelFontFamily | String | 'Lato', sans-serif | Label font family |
| labelFontSize | String | '1.6em' | Label font size |
| labelFontSizeActive | String | '1.2em' | Label font size for selected item |
| labelFontWeight | Number | 400 | Label font weight |
| labelFontWeightActive | Number | 400 | Label font weight for selected item |
Slots
Per-step slots use the step index (0-based), same pattern as NbSegmentedButton (option-{index}).
| name | Scope | Description |
|---|---|---|
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
| name | Return type | Description |
|---|---|---|
| changed | Number | Emitted 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 (
stepsas Array), each item can be a string or object. - For object items,
idandtitleare used when available. - Disabled steps (
stepsDisabled) are not clickable and are skipped by change handlers. - The step list scrolls horizontally when it overflows (
overflow-xon the inner nav); usescrollClassif you need custom scrollbar or overflow styling. - Colors for numbers and line segments are controlled separately for light and dark via the
light*anddark*props above (no singletabColor/lineBackgroundanymore).
