PhoenixKitWeb.Components.Core.TableDefault (phoenix_kit v1.5.2)

View Source

A basic table component with daisyUI styling.

Examples

<.table_default>
  <.table_default_header>
    <.table_default_row>
      <.table_default_header_cell>Name</.table_default_header_cell>
      <.table_default_header_cell>Email</.table_default_header_cell>
      <.table_default_header_cell>Role</.table_default_header_cell>
      <.table_default_header_cell>Actions</.table_default_header_cell>
    </.table_default_row>
  </.table_default_header>
  <.table_default_body>
    <.table_default_row>
      <.table_default_cell>John Doe</.table_default_cell>
      <.table_default_cell>john@example.com</.table_default_cell>
      <.table_default_cell><.badge>Admin</.badge></.table_default_cell>
      <.table_default_cell>
        <.button>Edit</.button>
      </.table_default_cell>
    </.table_default_row>
    <.table_default_row>
      <.table_default_cell>Jane Smith</.table_default_cell>
      <.table_default_cell>jane@example.com</.table_default_cell>
      <.table_default_cell>
        <.badge color="ghost">User</.badge>
      </.table_default_cell>
      <.table_default_cell>
        <.button>Edit</.button>
      </.table_default_cell>
    </.table_default_row>
  </.table_default_body>
</.table_default>

<.table_default variant="zebra">
  <!-- Table content with striped rows -->
</.table_default>

<.table_default size="sm" class="table-compact">
  <!-- Compact small table -->
</.table_default>

Summary

Functions

Renders a table with daisyUI styling.

Renders a table body section.

Renders a table data cell.

Renders a table footer section.

Renders a table header section.

Renders a table header cell.

Renders a table row.

Functions

table_default(assigns)

Renders a table with daisyUI styling.

Attributes

  • class - Additional CSS classes (optional)
  • variant - Table variant: "default", "zebra", "pin-rows", "pin-cols" (optional, default: "default")
  • size - Table size: "xs", "sm", "md", "lg" (optional, default: "md")
  • rest - Additional HTML attributes (optional)

Attributes

  • class (:string) - Defaults to "".
  • variant (:string) - Defaults to "default". Must be one of "default", "zebra", "pin-rows", or "pin-cols".
  • size (:string) - Defaults to "md". Must be one of "xs", "sm", "md", or "lg".
  • Global attributes are accepted.

Slots

  • inner_block (required)

table_default_body(assigns)

Renders a table body section.

Slots

  • inner_block (required)

table_default_cell(assigns)

Renders a table data cell.

Attributes

  • class - Additional CSS classes (optional)
  • colspan - Number of columns to span (optional)
  • rowspan - Number of rows to span (optional)
  • rest - Additional HTML attributes (optional)

Attributes

  • class (:string) - Defaults to "".
  • colspan (:integer) - Defaults to nil.
  • rowspan (:integer) - Defaults to nil.
  • Global attributes are accepted.

Slots

  • inner_block (required)

table_default_footer(assigns)

Renders a table footer section.

Slots

  • inner_block (required)

table_default_header(assigns)

Renders a table header section.

Slots

  • inner_block (required)

table_default_header_cell(assigns)

Renders a table header cell.

Attributes

  • class - Additional CSS classes (optional)
  • rest - Additional HTML attributes (optional)

Attributes

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

Slots

  • inner_block (required)

table_default_row(assigns)

Renders a table row.

Attributes

  • class - Additional CSS classes (optional)
  • hover - Enable hover effect: true/false (optional, default: true)
  • rest - Additional HTML attributes (optional)

Attributes

  • class (:string) - Defaults to "".
  • hover (:boolean) - Defaults to true.
  • Global attributes are accepted.

Slots

  • inner_block (required)