LedgerUI.Components.Skeleton (LedgerUI v0.2.0)

Copy Markdown View Source

Loading placeholder that mirrors the final layout. The size comes from class.

<.skeleton class="h-3 w-40" animation="wave" />
<.skeleton shape="circle" style="width:40px;height:40px" />

<.skeleton_group label="Loading orders">
  <.skeleton style="width:60%" />
</.skeleton_group>

animation={nil} emits no animation class ("none" emits a-none); tag="span" draws a span (inside a flex column). shape emits no class by default (the base block already has the small radius); an explicit "rounded" adds sh-rounded. The wave and the pulse stop for prefers-reduced-motion.

Summary

Functions

skeleton(assigns)

Attributes

  • animation (:string) - Defaults to "wave". Must be one of nil, "wave", "pulse", or "none".
  • variant (:string) - Defaults to "canvas". Must be one of "canvas", or "lineone".
  • shape (:string) - Defaults to nil.Must be one of nil, "rounded", "pill", "circle", "square", or "lg".
  • tag (:string) - The element drawn. Defaults to "div". Must be one of "div", or "span".
  • class (:any) - Defaults to nil.
  • Global attributes are accepted.

skeleton_group(assigns)

Attributes

  • label (:string) - Read by screen readers; not drawn. Defaults to "Loading…".
  • class (:any) - Defaults to nil.
  • Global attributes are accepted.

Slots

  • inner_block (required)