LedgerUI.Components.Illustration (LedgerUI v0.2.0)

Copy Markdown View Source

Light illustrations for empty states and result screens, drawn with the theme tokens (or inline SVG), so the package needs no static images.

<.illustration name="empty" />
<.illustration name="success" />
<.empty_box class="h-28" />
<.summit class="h-48 w-full" />
<.scene name="voyage" />
  • illustration/1: a small card sketch with a round icon badge (lu-ill), in five states: empty, success, error, search and offline. empty-inbox is accepted for empty. tone and icon override the preset.
  • empty_box/1: a girl with a box, for an empty area.
  • summit/1: the landscape of hero_card and auth_art (svg.lu-summit), cropped to fill its box.
  • scene/1: portrait scenes (voyage, lighthouse, balloons, aurora) for the picture half of auth_split.

An illustration always comes with a title and a sentence; never alone.

Summary

Functions

The summit landscape of the design (svg.lu-summit): sky, sun, stars, three ridges and a dotted trail, painted with the --hero-* tokens (light and dark). It fills its box, cropping the sides. Decorative: aria-hidden. This is the only drawing of it: hero_summit/1 and auth_art/1 render it.

Functions

empty_box(assigns)

Attributes

  • class (:any) - Sets the size; the width follows the height. Defaults to "h-36".
  • Global attributes are accepted.

illustration(assigns)

Attributes

  • name (:string) - Defaults to "empty". Must be one of "empty", "empty-inbox", "error", "offline", "search", or "success".
  • tone (:string) - Overrides the preset's colour. Defaults to nil. Must be one of nil, "primary", "neutral", "success", "error", "info", or "warning".
  • color (:string) - The same as tone; tone wins when both are given. Defaults to nil. Must be one of nil, "primary", "neutral", "success", "error", "info", or "warning".
  • icon (:string) - Overrides the preset's icon. Defaults to nil.
  • class (:any) - Defaults to nil.
  • Global attributes are accepted.

scene(assigns)

Attributes

  • name (:string) (required) - Must be one of "voyage", "lighthouse", "balloons", or "aurora".
  • position (:string) - Where the crop holds (preserveAspectRatio): xMidYMax keeps the bottom, xMinYMid the left. Defaults to "xMidYMid".
  • label (:string) - Read by screen readers; leave empty for decoration. Defaults to "".
  • class (:any) - Defaults to "h-full w-full".
  • Global attributes are accepted.

summit(assigns)

The summit landscape of the design (svg.lu-summit): sky, sun, stars, three ridges and a dotted trail, painted with the --hero-* tokens (light and dark). It fills its box, cropping the sides. Decorative: aria-hidden. This is the only drawing of it: hero_summit/1 and auth_art/1 render it.

Attributes

  • id (:string) - Prefix of the SVG's gradient ids (hs-sky...); give each summit on a page its own. Defaults to "hs".
  • tone (:string) - Modifier of lu-summit (the palette). Defaults to "teal".
  • class (:any) - Defaults to nil.
  • Global attributes are accepted.