Steps
Steps show a sequence of steps and current progress. Supports colors, icons, and vertical layout.
Basic Example
Interactive checkout steps
const { default: Steps } = await import('/components/navigation/steps.js');
const { default: Button } = await import('/components/actions/button.js');
const { signal, tags, $ } = Lightview;
const { div } = tags;
const currentStep = signal(1);
const stepNames = ['Cart', 'Shipping', 'Payment', 'Confirm'];
const demo = div({ class: 'flex flex-col gap-4' },
Steps({},
...stepNames.map((name, i) =>
Steps.Step({
color: () => i < currentStep.value ? 'primary' : undefined
}, name)
)
),
div({ class: 'flex gap-2 justify-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')
)
);
$('#demo').insert(demo);
Props
| Prop | Type | Default | Description |
|---|---|---|---|
vertical |
boolean | false | Vertical layout |
Steps.Step 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
For more examples, see the
DaisyUI Steps documentation.