LedgerUI.Components.Card (LedgerUI v0.2.0)

Copy Markdown View Source

The panel: surfaces (variant), colour (color, gradient), optional :title and composable parts (header, body, footer).

<.card>
  <:title>Simple Card</:title>
  <span>Lorem ipsum dolor sit amet.</span>
</.card>
<.card variant="solid" color="primary"><:title>Primary Card</:title>...</.card>
<.card variant="gradient" gradient="purple-indigo">...</.card>

<.card canvas>
  <.card_header>
    <.card_heading level={3}>Profile</.card_heading>
    <.card_actions>...</.card_actions>
  </.card_header>
  <.card_body>...</.card_body>
  <.card_footer>All changes saved</.card_footer>
</.card>

By default the card is a lu-cv surface (title in a <b>, content as given). With canvas it is the canvas lu-card tray, made for card_header/1, card_body/1 and card_footer/1. navigate, patch or href make the whole card a link, a row that ends in an arrow.

size xs/sm/lg and shape="xl" set the padding/corners inline; md/rounded are the defaults. The part elements (card_body, ...) render an empty style unless style={false}.

Summary

Functions

card(assigns)

Attributes

  • variant (:string) - Defaults to "default". Must be one of "default", "flat", "bordered", "outline", "muted", "soft", "filled", "solid", "glow", "gradient", or "gradient_outline".
  • size (:string) - Defaults to "md". Must be one of "xs", "sm", "md", or "lg".
  • body (:string) - Defaults to "seamless". Must be one of "seamless", "divided", "separated", "inset", or "flush".
  • divider (:string) - Defaults to "full". Must be one of "full", or "inset".
  • highlight (:boolean) - Defaults to true.
  • color (:string) - Defaults to "primary". Must be one of nil, "primary", "secondary", "info", "success", "warning", or "error".
  • gradient (:string) - Defaults to "purple-indigo". Must be one of nil, "purple-indigo", "fuchsia-pink", "amber-orange", "sky-blue", or "green-fuchsia".
  • shape (:string) - Defaults to "rounded". Must be one of "rounded", or "xl".
  • padded (:boolean) - Defaults to true.
  • canvas (:boolean) - The canvas lu-card tray for the parts. Defaults to false.
  • navigate (:string) - Defaults to nil.
  • patch (:string) - Defaults to nil.
  • href (:string) - Defaults to nil.
  • arrow (:boolean) - Defaults to true.
  • style (:string) - Defaults to nil.
  • class (:any) - Defaults to nil.
  • Global attributes are accepted. Supports all globals plus: ["target", "rel", "download", "replace", "method"].

Slots

  • inner_block
  • title - The card's heading, followed by the content. Accepts attributes:
    • class (:any)

card_actions(assigns)

Attributes

  • class (:any) - Defaults to nil.
  • Global attributes are accepted.

Slots

  • inner_block (required)

card_bleed(assigns)

Attributes

  • class (:any) - Defaults to nil.
  • Global attributes are accepted.

Slots

  • inner_block (required)

card_body(assigns)

Attributes

  • style (:any) - Inline style (false omits the attribute). Defaults to nil.
  • class (:any) - Defaults to nil.
  • Global attributes are accepted.

Slots

  • inner_block (required)

card_footer(assigns)

Attributes

  • align (:string) - Defaults to nil.Must be one of nil, "start", "center", "end", or "between".
  • size (:string) - Defaults to nil.Must be one of nil, "xs", "sm", "md", or "lg".
  • class (:any) - Defaults to nil.
  • Global attributes are accepted.

Slots

  • inner_block (required)

card_header(assigns)

Attributes

  • size (:string) - Defaults to nil.Must be one of nil, "xs", "sm", "md", or "lg".
  • class (:any) - Defaults to nil.
  • Global attributes are accepted.

Slots

  • inner_block (required)

card_heading(assigns)

Attributes

  • size (:string) - Defaults to "base". Must be one of "base", "lg", or "xl".
  • level (:integer) - Defaults to 2. Must be one of 1, 2, 3, 4, 5, or 6.
  • class (:any) - Defaults to nil.
  • Global attributes are accepted.

Slots

  • inner_block (required)

card_subheading(assigns)

Attributes

  • class (:any) - Defaults to nil.
  • Global attributes are accepted.

Slots

  • inner_block (required)