Steps show a sequence of steps and current progress. Supports colors, icons, and vertical layout.
Basic Example
Interactive checkout steps
await import('/components/navigation/steps.js');
await import('/components/actions/button.js');
const { signal, tags, $ } = Lightview;
const { div, Steps, Button } = tags;
const currentStep = signal(1);
const stepNames = ['Cart', 'Shipping', 'Payment', 'Confirm'];
const demo = div({ style: 'display: flex; flex-direction: column; gap: 1rem;' },
Steps({},
...stepNames.map((name, i) =>
Steps.Item({
color: () => i < currentStep.value ? 'primary' : undefined
}, name)
)
),
div({ style: 'display: flex; gap: 0.5rem; justify-content: center;' },
Button({
size: 'sm',
disabled: () => currentStep.value <= 1,
onclick: () => { currentStep.value--; }
}, 'Back'),
Button({
size: 'sm',
color: 'primary',
disabled: () => currentStep.value >= stepNames.length,
onclick: () => { currentStep.value++; }
}, 'Next')
)
);
$('#example').content(demo);
Props
| Prop | Type | Default | Description |
|---|---|---|---|
vertical |
boolean | false | Vertical layout |
Steps.Item Props
| Prop | Type | Default | Description |
|---|---|---|---|
color |
string | - | 'primary' | 'secondary' | 'accent' | 'info' | 'success' | 'warning' | 'error' |
content |
string | - | Custom icon/content for step circle |
Colors
- Primary
- Secondary
- Accent
- Info
- Success
- Warning
- Error
With Icons
- Step 1
- Step 2
- Step 3
- Step 4
- Step 5
Vertical
- Register
- Choose plan
- Purchase
- Receive Product