PtahUi.Components.Card (PtahUI v0.1.0)

Copy Markdown View Source

Card and Badge components for presenting data and status.

Summary

Functions

Renders a badge / pill label.

Renders a content card with optional header and footer.

Functions

badge(assigns)

Renders a badge / pill label.

Examples

<.badge>Novo</.badge>
<.badge variant="green" dot>Ativo</.badge>
<.badge variant="red" size="lg">Erro</.badge>

Attributes

  • variant (:string) - Defaults to "gray".
  • size (:string) - Defaults to "md".
  • dot (:boolean) - Defaults to false.
  • class (:string) - Defaults to nil.
  • Global attributes are accepted.

Slots

  • inner_block (required)

card(assigns)

Renders a content card with optional header and footer.

Examples

<.card>
  Simple card content.
</.card>

<.card>
  <:header>
    <h2 class="font-semibold text-gray-900">Título</h2>
  </:header>
  Body content.
  <:footer>
    <.button size="sm">Guardar</.button>
  </:footer>
</.card>

Attributes

  • padding (:string) - Defaults to "md".
  • class (:string) - Defaults to nil.
  • Global attributes are accepted.

Slots

  • header
  • inner_block (required)
  • footer