LedgerUI.Components.DescriptionList (LedgerUI v0.2.0)

Copy Markdown View Source

Label and value pairs in a grid, as the canvas lu-dl2: the label small and faint, the value in the ink colour. For the short data of a detail (an order, a client).

<.description_list cols={2}>
  <:item label="Razão social">Mercadinho Bom Preço Ltda</:item>
  <:item label="CNPJ" mono>12.345.678/0001-90</:item>
</.description_list>

cols is 1 to 4. layout="inline" puts the label at the left and the value at the right. An item with no content shows empty ("—"). An item takes id, class and style for its <dd>, and wrapper_id, wrapper_class and wrapper_style for the <div> around the pair.

Summary

Functions

description_list(assigns)

Attributes

  • cols (:integer) - Defaults to 2. Must be one of 1, 2, 3, or 4.
  • layout (:string) - Defaults to "stacked". Must be one of "stacked", or "inline".
  • variant (:string) - The same as layout; it wins when given. Defaults to nil. Must be one of nil, "stacked", or "inline".
  • empty (:string) - Defaults to "—".
  • class (:any) - Defaults to nil.
  • style (:string) - Defaults to nil.
  • Global attributes are accepted.

Slots

  • item (required) - A pair: label, and the value as content. Accepts attributes:
    • label (:string)
    • title (:string) - The same as label (the name Phoenix's generated list gives it).
    • mono (:boolean)
    • id (:string)
    • class (:any)
    • style (:string)
    • wrapper_id (:string)
    • wrapper_class (:any)
    • wrapper_style (:string)