glaze/oat/table

Oat documentation: https://oat.ink/components/table/

Table helpers for data grids and record lists.

Anatomy

Wrap tables with container for Oat table styling, then build rows and cells with regular table primitives.

Recipe

import glaze/oat/table
import lustre/element/html

table.container([], [
  table.table([], [
    table.thead([], [
      table.tr([], [
        table.th([], [html.text("Name")]),
        table.th([], [html.text("Role")]),
      ]),
    ]),
    table.tbody([], [
      table.tr([], [
        table.td([], [html.text("Casey")]),
        table.td([], [html.text("Admin")]),
      ]),
    ]),
  ]),
])

Values

pub fn container(
  attrs: List(attribute.Attribute(msg)),
  children: List(element.Element(msg)),
) -> element.Element(msg)

Render the table wrapper used by Oat styling.

pub fn table(
  attrs: List(attribute.Attribute(msg)),
  children: List(element.Element(msg)),
) -> element.Element(msg)
pub fn tbody(
  attrs: List(attribute.Attribute(msg)),
  children: List(element.Element(msg)),
) -> element.Element(msg)
pub fn td(
  attrs: List(attribute.Attribute(msg)),
  children: List(element.Element(msg)),
) -> element.Element(msg)
pub fn th(
  attrs: List(attribute.Attribute(msg)),
  children: List(element.Element(msg)),
) -> element.Element(msg)
pub fn thead(
  attrs: List(attribute.Attribute(msg)),
  children: List(element.Element(msg)),
) -> element.Element(msg)
pub fn tr(
  attrs: List(attribute.Attribute(msg)),
  children: List(element.Element(msg)),
) -> element.Element(msg)
Search Document