StepWizard
Stepper header with the current step marked. You own the step bodies.
- Install
- Theme
- Ship
Install
One package, plus the stylesheet. Nothing to configure yet.
- Install
- Theme
- Ship
Install
One package, plus the stylesheet. Nothing to configure yet.
- Install
- Theme
- Ship
Install
One package, plus the stylesheet. Nothing to configure yet.
- Install
- Theme
- Ship
Install
One package, plus the stylesheet. Nothing to configure yet.
Code
import { useState } from 'react';
import { Button, Card, Group, Stack, Typography } from '@ilomee/aura-react';
import { StepWizard, type WizardStep } from '@ilomee/aura-react';
const STEPS: (WizardStep & { body: string })[] = [
{ id: 'install', label: 'Install', body: 'One package, plus the stylesheet. Nothing to configure yet.' },
{ id: 'theme', label: 'Theme', body: 'Theme, accent, corners and density are four attributes on the root.' },
{ id: 'ship', label: 'Ship', body: 'Nothing else to set up — the classes are the API from here.' },
];
// The wizard is the header: a marker per step and which one you are on. What each step *is* —
// the panel below — belongs to the caller, which is why the recipe does not take it.
export default function Demo() {
const [active, setActive] = useState(0);
const step = STEPS[active]!;
return (
<Stack gap={4} style={{ width: '100%' }}>
<StepWizard steps={STEPS} active={active} />
<Card>
<Stack gap={1}>
<Typography variant="h3">{step.label}</Typography>
<Typography variant="body" tone="muted">
{step.body}
</Typography>
</Stack>
</Card>
<Group>
<Button onClick={() => setActive((s) => Math.max(0, s - 1))} disabled={active === 0}>
Back
</Button>
<Button
variant="primary"
onClick={() => setActive((s) => Math.min(STEPS.length - 1, s + 1))}
disabled={active === STEPS.length - 1}
>
Next
</Button>
</Group>
</Stack>
);
}<StepWizard :steps="steps" :active="active">
<p>Step body</p>
</StepWizard>Content props take a string. For markup, use the slot of the same name.
<StepWizard {steps} {active}>
<p>Step body</p>
</StepWizard>Content props take a string or a snippet.
Used as aura-step-wizard.
<aura-step-wizard [steps]="steps" [active]="active">
<p>Step body</p>
</aura-step-wizard>Content inputs take a string or a TemplateRef.
Props
| Name | Type | Default | Notes |
|---|---|---|---|
| renderStep | (step, state, index) => ReactNode | — | Render a step’s insides — an icon instead of a number, a duration under the label. The <li> stays ours: it carries data-state and aria-current="step". |
| steps* | WizardStep[] | — | { id, label }. |
| active | number | 0 | |
| childrenslot | ReactNode | — |
| Name | Type | Default | Notes |
|---|---|---|---|
| stepslot | { step: WizardStep; state: StepState; index: number } | — | |
| steps* | WizardStep[] | — | |
| active | number | 0 | |
| defaultslot | Slot | — |
| Name | Type | Default | Notes |
|---|---|---|---|
| stepslot | Snippet<[WizardStep, StepState, number]> | — | |
| steps* | WizardStep[] | — | |
| active | number | 0 | |
| childrenslot | Snippet | — |
| Name | Type | Default | Notes |
|---|---|---|---|
| stepTemplate | TemplateRef<{ $implicit: WizardStep; state: StepState; index: number }> | — | |
| steps* | WizardStep[] | — | |
| active | number | 0 | |
| ng-contentslot | content | — |
Emitted classes
Every framework emits the same classes — that is what makes the four libraries look identical. You can use them directly, without any component library.
| Class | Role | Notes |
|---|---|---|
| .aura-wizard | base | Required. A modifier does nothing without it. |
| .aura-wizard__steps | element | |
| .aura-wizard__step[data-state] | element | |
| .aura-wizard__marker | element | |
| .aura-wizard__label | element | |
| .aura-wizard__body | element |