LedgerUI.Components.Progress (LedgerUI v0.2.0)

Copy Markdown View Source

Progress bar (progress/1) and the stacked bar of parts of a total (progress_stack/1).

<.progress value={64} color="primary" />
<.progress value={92} size="xl" label="92%" />
<.progress indeterminate color="info" />
<.progress_stack label="Sales by channel">
  <:segment value={46} label="Counter" />
  <:segment value={33} label="Online" />
</.progress_stack>

variant and size default to the solid, medium bar without emitting a class (nil), so only an explicit value adds v-*/s-*. label is the accessible name (role="progressbar", with aria-valuenow); with size="xl" it is drawn inside the bar instead.

Summary

Functions

Same as progress/1 (same attributes and slots), under the name the design vitrine uses.

Functions

progress(assigns)

Attributes

  • value (:any) - A number between 0 and max. Defaults to 0.
  • max (:any) - Defaults to 100.
  • color (:string) - Defaults to "neutral". Must be one of "neutral", "primary", "secondary", "info", "success", "warning", "error", or "white".
  • variant (:string) - Defaults to nil.Must be one of nil, "solid", "soft", or "gradient".
  • size (:string) - Defaults to nil.Must be one of nil, "sm", "md", "lg", or "xl".
  • height (:string) - Defaults to nil.Must be one of nil, "", "1", "1.5", "2", "3", or "4".
  • active (:boolean) - Defaults to false.
  • indeterminate (:boolean) - Defaults to false.
  • shine (:boolean) - Defaults to false.
  • label (:string) - Defaults to nil.
  • class (:any) - Defaults to nil.
  • bar_class (:any) - Defaults to nil.
  • Global attributes are accepted.

progress_bar(assigns)

Same as progress/1 (same attributes and slots), under the name the design vitrine uses.

Attributes

  • value (:any) - A number between 0 and max. Defaults to 0.
  • max (:any) - Defaults to 100.
  • color (:string) - Defaults to "neutral". Must be one of "neutral", "primary", "secondary", "info", "success", "warning", "error", or "white".
  • variant (:string) - Defaults to nil.Must be one of nil, "solid", "soft", or "gradient".
  • size (:string) - Defaults to nil.Must be one of nil, "sm", "md", "lg", or "xl".
  • height (:string) - Defaults to nil.Must be one of nil, "", "1", "1.5", "2", "3", or "4".
  • active (:boolean) - Defaults to false.
  • indeterminate (:boolean) - Defaults to false.
  • shine (:boolean) - Defaults to false.
  • label (:string) - Defaults to nil.
  • class (:any) - Defaults to nil.
  • bar_class (:any) - Defaults to nil.
  • Global attributes are accepted.

progress_stack(assigns)

Attributes

  • max (:any) - Defaults to 100.
  • label (:string) - Defaults to nil.
  • class (:any) - Defaults to nil.
  • Global attributes are accepted.

Slots

  • segment (required) - Accepts attributes:
    • value (:any)
    • color (:string)
    • label (:string)