DevactionUI.Steps (devaction_ui v0.2.3)

Copy Markdown View Source

A row of steps with connectors: done (ink, with a check), the current one (amber ring) and those still to come (a thin outline). current counts from 1; the labels are the caller's text.

A current below 1 leaves every step to come and one past the last leaves every step done. The step named by error is drawn with a red ring and keeps its number (or the error_icon), whatever its place relative to current; give an error_label so assistive technology reads that it failed. A wizard that needs help lines and a vertical layout uses DevactionUI.Stepper. The connectors have a minimum width of 24px so a long row wraps its labels instead of squeezing them.

Summary

Functions

The row of steps.

Functions

steps(assigns)

@spec steps(map()) :: Phoenix.LiveView.Rendered.t()

The row of steps.

Attributes

  • labels (:list) (required) - the text of each step, in order.
  • current (:integer) (required) - the step the person is on, counting from 1.
  • error (:integer) - the step that failed, counting from 1; it wins over current. Defaults to nil.
  • error_label (:string) - read out after the label of the failed step, such as Failed. Defaults to nil.
  • class (:any) - Defaults to nil.
  • Global attributes are accepted.

Slots

  • done_icon - replaces the typographic ✓ of a finished step.
  • error_icon - replaces the number in the dot of the failed step.