Stepper
color (8) · size xs–lg · horizontal/vertical · states done/current/error/todo · variant canvas
A step indicator for a flow (wizard).
Advancing a step
<.stepper color="primary" loop><:step label="Pedido" style="--dl:0.0s" /><:step label="Separação" style="--dl:1.4s" /><:step label="Nota fiscal" style="--dl:2.8s" /><:step label="Entrega" style="--dl:4.2s" /></.stepper>
color
<div class="flex flex-col gap-[10px]"><div class="flex flex-wrap items-center gap-2.5"><span class="text-xs text-muted font-mono w-[80px]">neutral</span><.stepper current={2} color="neutral" class="flex-1"><:step label="Conta" style="--dl:0.0s" /><:step label="Plano" style="--dl:1.4s" /><:step label="Pagamento" style="--dl:2.8s" /><:step label="Revisão" style="--dl:4.2s" /></.stepper></div><div class="flex flex-wrap items-center gap-2.5"><span class="text-xs text-muted font-mono w-[80px]">primary</span><.stepper current={2} color="primary" class="flex-1"><:step label="Conta" style="--dl:0.0s" /><:step label="Plano" style="--dl:1.4s" /><:step label="Pagamento" style="--dl:2.8s" /><:step label="Revisão" style="--dl:4.2s" /></.stepper></div><div class="flex flex-wrap items-center gap-2.5"><span class="text-xs text-muted font-mono w-[80px]">secondary</span><.stepper current={2} color="secondary" class="flex-1"><:step label="Conta" style="--dl:0.0s" /><:step label="Plano" style="--dl:1.4s" /><:step label="Pagamento" style="--dl:2.8s" /><:step label="Revisão" style="--dl:4.2s" /></.stepper></div><div class="flex flex-wrap items-center gap-2.5"><span class="text-xs text-muted font-mono w-[80px]">info</span><.stepper current={2} color="info" class="flex-1"><:step label="Conta" style="--dl:0.0s" /><:step label="Plano" style="--dl:1.4s" /><:step label="Pagamento" style="--dl:2.8s" /><:step label="Revisão" style="--dl:4.2s" /></.stepper></div><div class="flex flex-wrap items-center gap-2.5"><span class="text-xs text-muted font-mono w-[80px]">success</span><.stepper current={2} color="success" class="flex-1"><:step label="Conta" style="--dl:0.0s" /><:step label="Plano" style="--dl:1.4s" /><:step label="Pagamento" style="--dl:2.8s" /><:step label="Revisão" style="--dl:4.2s" /></.stepper></div><div class="flex flex-wrap items-center gap-2.5"><span class="text-xs text-muted font-mono w-[80px]">warning</span><.stepper current={2} color="warning" class="flex-1"><:step label="Conta" style="--dl:0.0s" /><:step label="Plano" style="--dl:1.4s" /><:step label="Pagamento" style="--dl:2.8s" /><:step label="Revisão" style="--dl:4.2s" /></.stepper></div><div class="flex flex-wrap items-center gap-2.5"><span class="text-xs text-muted font-mono w-[80px]">error</span><.stepper current={2} color="error" class="flex-1"><:step label="Conta" style="--dl:0.0s" /><:step label="Plano" style="--dl:1.4s" /><:step label="Pagamento" style="--dl:2.8s" /><:step label="Revisão" style="--dl:4.2s" /></.stepper></div></div>
size · states (done, current, error, todo)
<div class="flex flex-col gap-[14px]"><.stepper current={2} color="primary" size="xs"><:step label="Conta" style="--dl:0.0s" /><:step label="Plano" style="--dl:1.4s" /><:step label="Pagamento" style="--dl:2.8s" /><:step label="Revisão" style="--dl:4.2s" /></.stepper><.stepper current={2} color="primary" size="sm"><:step label="Conta" style="--dl:0.0s" /><:step label="Plano" style="--dl:1.4s" /><:step label="Pagamento" style="--dl:2.8s" /><:step label="Revisão" style="--dl:4.2s" /></.stepper><.stepper current={2} color="primary"><:step label="Conta" style="--dl:0.0s" /><:step label="Plano" style="--dl:1.4s" /><:step label="Pagamento" style="--dl:2.8s" /><:step label="Revisão" style="--dl:4.2s" /></.stepper><.stepper current={2} color="primary" size="lg"><:step label="Conta" style="--dl:0.0s" /><:step label="Plano" style="--dl:1.4s" /><:step label="Pagamento" style="--dl:2.8s" /><:step label="Revisão" style="--dl:4.2s" /></.stepper><.stepper current={2} error color="primary"><:step label="Conta" style="--dl:0.0s" /><:step label="Plano" style="--dl:1.4s" /><:step label="Pagamento" style="--dl:2.8s" /><:step label="Revisão" style="--dl:4.2s" /></.stepper></div>
orientation="vertical"
<div class="grid grid-cols-2 gap-[16px]"><.stepper orientation="vertical" current={2} color="primary"><:step label="Conta" sub="Dados do CNPJ" style="--dl:0.0s" /><:step label="Plano" sub="Profissional" style="--dl:1.4s" /><:step label="Pagamento" sub="Cartão final 4417" style="--dl:2.8s" /><:step label="Revisão" sub="Confirme e ative" style="--dl:4.2s" /></.stepper><.stepper orientation="vertical" current={2} color="success"><:step label="Pedido recebido" sub="14:02" style="--dl:0.0s" /><:step label="Separado" sub="14:40" style="--dl:1.4s" /><:step label="NF-e emitida" sub="agora" style="--dl:2.8s" /><:step label="Saiu para entrega" sub="—" style="--dl:4.2s" /></.stepper></div>
API values that complete the parity
<div class="grid grid-cols-3 gap-[14px]"><div class="flex flex-col items-start gap-1.5"><.badge color="primary" variant="solid">accent</.badge><span class="font-mono text-[11px] text-muted">color=accent</span></div><div class="flex flex-col items-start gap-1.5"><.chip label="md" /><span class="font-mono text-[11px] text-muted">size=md</span></div><div class="flex flex-col items-start gap-1.5"><.stepper color="primary" class="w-[260px]" current={1}><:step label="Conta" marker="1" state="done" /><:step label="Plano" marker="2" /><:step label="Fim" marker="3" /></.stepper><span class="font-mono text-[11px] text-muted">variant=classic</span></div></div>
Usage
<.stepper steps={~w(Conta Plano Pagamento Revisão)} current={2} />
Rules
- Done: teal with a check; current:
inkborder with a halo; future: neutral.
API reference
Todos os function components, atributos, valores e slots que este componente cobre.
Steps: numbered or plain points joined by a line (steps/1) and the progress stepper of a
wizard (stepper/1). Both draw the canvas steps; stepper variant="classic" is the old bar of
numbered squares. Styled only with Tailwind utilities; the colour enters as --c, --c-on and
--c-ink (see LedgerUI.Color; accent is primary) and every part carries data-part
(steps, step, step-marker, step-label, step-sub, step-line).
<.stepper current={2}>
<:step label="Account" sub="Tax id and address" />
<:step label="Plan" />
<:step label="Payment" />
</.stepper>
<.steps color="primary" size="sm">
<:step label="Cart" state="done">1</:step>
<:step label="Shipping" state="current">2</:step>
</.steps>
current is the 0-based index of the step being worked on: the ones before are done, the
ones after todo; with error the current one is flagged. A step's own state wins. The
marker of a step is, in order: its marker text, its icon, a check when done (numbers for
the xs/sm dots), ! when error, else its number.
Notes:
colorandsizeonstepper/1are additions to the README (the canvas previews vary them).- Accessibility is rendered server-side: the root is
role="list", each steprole="listitem"; the current (or flagged) one hasaria-current="step"and, onstepper/1, every step has anaria-labelwith its label and its state name (state_names, e.g. "Company, Completed"). A:steptakesstyle(animation delays) and any other attribute. - The kit CSS classes the README mentions (
steps,step-primary) are replaced by utilities.
<.steps>
| Attr | Type | Default | Values / notes |
|---|---|---|---|
color |
:string |
"neutral" |
neutral, primary, secondary, accent, info, success, warning, error |
orientation |
:string |
"horizontal" |
horizontal, vertical |
size |
:string |
"md" |
xs, sm, md, lg |
line_space |
:boolean |
false |
|
class |
:any |
nil |
Any other HTML/phx attribute goes to the root element.
Slots:
<:step>(required) - attrs:label,color,ping,current,state,class,style
<.stepper>
| Attr | Type | Default | Values / notes |
|---|---|---|---|
orientation |
:string |
"horizontal" |
horizontal, vertical |
current |
:integer |
nil |
|
error |
:boolean |
false |
|
variant |
:string |
"canvas" |
canvas, classic |
state_names |
:map |
%{"current" => "Current", "done" => "Completed", "error" => "Needs attention", "todo" => "Upcoming"} |
|
color |
:string |
nil |
nil, neutral, primary, secondary, accent, info, success, warning, error |
size |
:string |
nil |
nil, xs, sm, md, lg |
loop |
:boolean |
false |
The animated mock: the steps fill in turn (stagger them with style="--dl:1.4s"); the states are not drawn. |
class |
:any |
nil |
Any other HTML/phx attribute goes to the root element.
Slots:
<:step>(required) - attrs:label,sub,state,marker,icon,class,style