DevactionUI.EmptyState (devaction_ui v0.1.0)

Copy Markdown View Source

What a list or a screen shows when there is nothing in it yet. Every empty one says what the area is, why it is empty and the one next step.

:dashed (the default) is the card with a dashed border; :page is the whole-area one, with the squared grid behind its icon, a kicker, a title, a text and a main action with an optional second one; :inline is the small row inside a table, a list or a search with no result (and, with an action, the failure with "Try again").

Summary

Functions

empty_state(assigns)

Attributes

  • title (:string) (required)
  • text (:string) - Defaults to nil.
  • variant (:atom) - Defaults to :dashed. Must be one of :dashed, :page, or :inline.
  • kicker (:string) - a small mono line over the title (:page). Defaults to nil.
  • class (:any) - Defaults to nil.
  • Global attributes are accepted.

Slots

  • icon - the icon, drawn by the caller.
  • action - the button or link that fixes the emptiness.
  • secondary - a second, quieter way out (:page).