Steps: numbered or plain points joined by a line (steps/1) and the progress stepper of a
wizard (stepper/1). Both draw the canvas lu-st2; stepper variant="classic" is the old
lu-steps bar.
<.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 bylu-st2.
Summary
Functions
Attributes
orientation(:string) - Defaults to"horizontal". Must be one of"horizontal", or"vertical".current(:integer) - Defaults tonil.error(:boolean) - Defaults tofalse.variant(:string) - Defaults to"canvas". Must be one of"canvas", or"classic".state_names(:map) - Defaults to%{"current" => "Current", "done" => "Completed", "error" => "Needs attention", "todo" => "Upcoming"}.color(:string) - Defaults tonil.Must be one ofnil,"neutral","primary","secondary","accent","info","success","warning", or"error".size(:string) - Defaults tonil.Must be one ofnil,"lg","md","sm", or"xs".class(:any) - Defaults tonil.- Global attributes are accepted.
Slots
step(required) - Accepts attributes:label(:string)sub(:string)state(:string)marker(:string)icon(:string)class(:any)style(:string)
Attributes
color(:string) - Defaults to"neutral". Must be one of"neutral","primary","secondary","accent","info","success","warning", or"error".orientation(:string) - Defaults to"horizontal". Must be one of"horizontal", or"vertical".size(:string) - Defaults to"md". Must be one of"xs","sm","md", or"lg".line_space(:boolean) - Defaults tofalse.class(:any) - Defaults tonil.- Global attributes are accepted.
Slots
step(required) - Accepts attributes:label(:string)color(:string)ping(:boolean)current(:boolean)state(:string)class(:any)style(:string)