Table

Data Display

A structured data table with headers and rows, built from Iced primitives.

Preview

Invoice
Status
Amount
INV-001
Paid
$250.00
INV-002
Pending
$150.00
INV-003
Overdue
$350.00

Usage

table.rs
use floe_ui::components::table;
use iced::widget::row;

let tbl = table::table(
    "text-zinc-500">// Headers
    [
        table::header_cell("Invoice", &tokens),
        table::header_cell("Status", &tokens),
        table::header_cell("Amount", &tokens),
    ],
    "text-zinc-500">// Rows
    [
        row![
            table::cell("INV-001", &tokens),
            table::cell("Paid", &tokens),
            table::cell("$250.00", &tokens),
        ],
        row![
            table::cell("INV-002", &tokens),
            table::cell("Pending", &tokens),
            table::cell("$150.00", &tokens),
        ],
    ],
    &tokens,
);

API Reference

Props / Parameters

NameTypeDescription
headersimpl IntoIterator<Item = Element>Header cell elements
rowsimpl IntoIterator<Item = Row>Data rows
tokens&DesignTokensDesign tokens for theming

Style Functions

table_container_style(tokens)
header_style(tokens)
row_style(tokens)

Style functions return closures compatible with Iced's .style() method.

Builder Functions

table(headers, rows, tokens)
cell(content, tokens)
header_cell(content, tokens)

Builder functions return pre-configured Iced widgets ready for use.

Source: floe-ui/src/components/table.rs