Skip to main content

Crate yew_datatable

Crate yew_datatable 

Source
Expand description

§yew-datatable

A data table component library for Yew applications. Built on top of yew-datatable-core, providing idiomatic Yew components and hooks.

§Features

  • Fully-featured data table with sorting, filtering, pagination
  • Type-safe column definitions
  • Headless design with customizable rendering
  • Yew hooks for state management

§Example

use yew::prelude::*;
use yew_datatable::prelude::*;

#[function_component(MyTable)]
fn my_table() -> Html {
    let columns = vec![
        ColumnDefBuilder::new("name", "Name")
            .accessor(|row: &Person| row.name.clone())
            .build(),
        ColumnDefBuilder::new("age", "Age")
            .accessor(|row: &Person| row.age as i32)
            .build(),
    ];

    let data = vec![
        Person { name: "Alice".into(), age: 30 },
        Person { name: "Bob".into(), age: 25 },
    ];

    html! {
        <DataTable<Person> {columns} {data} />
    }
}

Re-exports§

pub use yew_datatable_core as core;

Modules§

components
Yew components for rendering data tables.
hooks
Yew hooks for table state management.
prelude
Re-exports for convenient access to all public types.