# black-cockpit/yew-datatable architecture

> Architecture diagram of the GitHub repository black-cockpit/yew-datatable, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-20). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/black-cockpit/yew-datatable
- Repository: https://github.com/black-cockpit/yew-datatable

## Overview

yew-datatable is a headless Rust table engine with a Yew integration layer. The main workflow is application data and column definitions into the table hook, through row processing, and into rendered table and pagination components. The graph preserves the documented filter/sort/group/expand/paginate stages and other feature families. Some links are based on the README or SOURCE INDEX references; unsampled implementation details are not inferred.

Main entry points: [`yew-datatable/src/hooks/use_table.rs`](https://github.com/black-cockpit/yew-datatable/blob/master/yew-datatable/src/hooks/use_table.rs) (use_table hook), [`yew-datatable/src/components/data_table.rs`](https://github.com/black-cockpit/yew-datatable/blob/master/yew-datatable/src/components/data_table.rs) (DataTable component), [`yew-datatable-core/src/table/data_table.rs`](https://github.com/black-cockpit/yew-datatable/blob/master/yew-datatable-core/src/table/data_table.rs) (DataTable engine), [`yew-datatable-core/src/row/data_table_row_model.rs`](https://github.com/black-cockpit/yew-datatable/blob/master/yew-datatable-core/src/row/data_table_row_model.rs) (Row model)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_integration["Yew integration"]
  node_hook["use_table hook<br/>[use_table.rs]"]
  node_table_component["DataTable component<br/>[data_table.rs]"]
  node_header["Table header<br/>[table_header.rs]"]
  node_body["Table body<br/>[table_body.rs]"]
  node_cell_context["Cell render context"]
  node_pagination_ui["Pagination component<br/>[pagination.rs]"]
end

subgraph group_engine["Core engine"]
  node_core_table["DataTable engine<br/>[data_table.rs]"]
  node_columns["Column definitions<br/>[column_def.rs]"]
  node_table_state["Table state"]
end

subgraph group_pipeline["Row pipeline"]
  node_row_model["Row model"]
  node_filtering["Filtering<br/>[filter_state.rs]"]
  node_sorting["Sorting<br/>[sorting_state.rs]"]
  node_grouping["Grouping<br/>[grouping_state.rs]"]
  node_expansion["Row expansion<br/>[expanding_state.rs]"]
end

subgraph group_features["Table features"]
  node_pagination["Pagination state"]
  node_selection["Row selection"]
  node_column_controls["Column controls"]
  node_aggregation["Aggregation"]
end

node_app(("Yew application"))

node_app -->|"provides data"| node_hook
node_app -->|"defines columns"| node_columns
node_hook -->|"manages"| node_core_table
node_core_table -->|"uses definitions"| node_columns
node_core_table -->|"uses state"| node_table_state
node_core_table -->|"processes rows"| node_row_model
node_row_model -->|"filters"| node_filtering
node_filtering -->|"then sorts"| node_sorting
node_sorting -->|"then groups"| node_grouping
node_grouping -->|"then expands"| node_expansion
node_expansion -->|"then paginates"| node_pagination
node_hook -->|"supplies table"| node_table_component
node_table_component -->|"renders"| node_header
node_table_component -->|"renders"| node_body
node_body -->|"creates context"| node_cell_context
node_table_component -->|"renders"| node_pagination_ui
node_pagination_ui -->|"navigates pages"| node_hook
node_hook -.->|"updates page state"| node_pagination
node_hook -.->|"updates selection"| node_selection
node_hook -.->|"updates columns"| node_column_controls
node_row_model -->|"supports grouped values"| node_aggregation

click node_hook "https://github.com/black-cockpit/yew-datatable/blob/master/yew-datatable/src/hooks/use_table.rs"
click node_table_component "https://github.com/black-cockpit/yew-datatable/blob/master/yew-datatable/src/components/data_table.rs"
click node_header "https://github.com/black-cockpit/yew-datatable/blob/master/yew-datatable/src/components/table_header.rs"
click node_body "https://github.com/black-cockpit/yew-datatable/blob/master/yew-datatable/src/components/table_body.rs"
click node_cell_context "https://github.com/black-cockpit/yew-datatable/blob/master/yew-datatable/src/components/cell_render_context.rs"
click node_pagination_ui "https://github.com/black-cockpit/yew-datatable/blob/master/yew-datatable/src/components/pagination.rs"
click node_core_table "https://github.com/black-cockpit/yew-datatable/blob/master/yew-datatable-core/src/table/data_table.rs"
click node_columns "https://github.com/black-cockpit/yew-datatable/blob/master/yew-datatable-core/src/column/column_def.rs"
click node_table_state "https://github.com/black-cockpit/yew-datatable/blob/master/yew-datatable-core/src/state/data_table_state.rs"
click node_row_model "https://github.com/black-cockpit/yew-datatable/blob/master/yew-datatable-core/src/row/data_table_row_model.rs"
click node_filtering "https://github.com/black-cockpit/yew-datatable/blob/master/yew-datatable-core/src/features/filtering/filter_state.rs"
click node_sorting "https://github.com/black-cockpit/yew-datatable/blob/master/yew-datatable-core/src/features/sorting/sorting_state.rs"
click node_grouping "https://github.com/black-cockpit/yew-datatable/blob/master/yew-datatable-core/src/features/grouping/grouping_state.rs"
click node_expansion "https://github.com/black-cockpit/yew-datatable/blob/master/yew-datatable-core/src/features/expanding/expanding_state.rs"
click node_pagination "https://github.com/black-cockpit/yew-datatable/blob/master/yew-datatable-core/src/features/pagination/pagination_state.rs"
click node_selection "https://github.com/black-cockpit/yew-datatable/blob/master/yew-datatable-core/src/features/row_selection/row_selection_state.rs"
click node_column_controls "https://github.com/black-cockpit/yew-datatable/tree/master/yew-datatable-core/src/features"
click node_aggregation "https://github.com/black-cockpit/yew-datatable/tree/master/yew-datatable-core/src/features/aggregation"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_hook,node_table_component,node_header,node_body,node_cell_context,node_pagination_ui toneBlue
class node_core_table,node_columns,node_table_state toneAmber
class node_row_model,node_filtering,node_sorting,node_grouping,node_expansion toneMint
class node_pagination,node_selection,node_column_controls,node_aggregation toneRose
class node_app toneIndigo
```

## Components

### Yew integration

- [use_table hook](https://github.com/black-cockpit/yew-datatable/blob/master/yew-datatable/src/hooks/use_table.rs): `yew-datatable/src/hooks/use_table.rs`
- [DataTable component](https://github.com/black-cockpit/yew-datatable/blob/master/yew-datatable/src/components/data_table.rs): `yew-datatable/src/components/data_table.rs`
- [Table header](https://github.com/black-cockpit/yew-datatable/blob/master/yew-datatable/src/components/table_header.rs): `yew-datatable/src/components/table_header.rs`
- [Table body](https://github.com/black-cockpit/yew-datatable/blob/master/yew-datatable/src/components/table_body.rs): `yew-datatable/src/components/table_body.rs`
- [Cell render context](https://github.com/black-cockpit/yew-datatable/blob/master/yew-datatable/src/components/cell_render_context.rs): `yew-datatable/src/components/cell_render_context.rs`
- [Pagination component](https://github.com/black-cockpit/yew-datatable/blob/master/yew-datatable/src/components/pagination.rs): `yew-datatable/src/components/pagination.rs`

### Core engine

- [DataTable engine](https://github.com/black-cockpit/yew-datatable/blob/master/yew-datatable-core/src/table/data_table.rs): `yew-datatable-core/src/table/data_table.rs`
- [Column definitions](https://github.com/black-cockpit/yew-datatable/blob/master/yew-datatable-core/src/column/column_def.rs): `yew-datatable-core/src/column/column_def.rs`
- [Table state](https://github.com/black-cockpit/yew-datatable/blob/master/yew-datatable-core/src/state/data_table_state.rs): `yew-datatable-core/src/state/data_table_state.rs`

### Row pipeline

- [Row model](https://github.com/black-cockpit/yew-datatable/blob/master/yew-datatable-core/src/row/data_table_row_model.rs): `yew-datatable-core/src/row/data_table_row_model.rs`
- [Filtering](https://github.com/black-cockpit/yew-datatable/blob/master/yew-datatable-core/src/features/filtering/filter_state.rs): `yew-datatable-core/src/features/filtering/filter_state.rs`
- [Sorting](https://github.com/black-cockpit/yew-datatable/blob/master/yew-datatable-core/src/features/sorting/sorting_state.rs): `yew-datatable-core/src/features/sorting/sorting_state.rs`
- [Grouping](https://github.com/black-cockpit/yew-datatable/blob/master/yew-datatable-core/src/features/grouping/grouping_state.rs): `yew-datatable-core/src/features/grouping/grouping_state.rs`
- [Row expansion](https://github.com/black-cockpit/yew-datatable/blob/master/yew-datatable-core/src/features/expanding/expanding_state.rs): `yew-datatable-core/src/features/expanding/expanding_state.rs`

### Table features

- [Pagination state](https://github.com/black-cockpit/yew-datatable/blob/master/yew-datatable-core/src/features/pagination/pagination_state.rs): `yew-datatable-core/src/features/pagination/pagination_state.rs`
- [Row selection](https://github.com/black-cockpit/yew-datatable/blob/master/yew-datatable-core/src/features/row_selection/row_selection_state.rs): `yew-datatable-core/src/features/row_selection/row_selection_state.rs`
- [Column controls](https://github.com/black-cockpit/yew-datatable/tree/master/yew-datatable-core/src/features): `yew-datatable-core/src/features`
- [Aggregation](https://github.com/black-cockpit/yew-datatable/tree/master/yew-datatable-core/src/features/aggregation): `yew-datatable-core/src/features/aggregation`

### Other components

- **Yew application**

## Connections

- Yew application → use_table hook: provides data
- Yew application → Column definitions: defines columns
- use_table hook → DataTable engine: manages
- DataTable engine → Column definitions: uses definitions (evidence: `yew-datatable-core/src/table/data_table.rs`)
- DataTable engine → Table state: uses state (evidence: `yew-datatable-core/src/table/data_table.rs`)
- DataTable engine → Row model: processes rows (evidence: `yew-datatable-core/src/table/data_table.rs`)
- Row model → Filtering: filters (evidence: `yew-datatable-core/src/row/data_table_row_model.rs`)
- Filtering → Sorting: then sorts
- Sorting → Grouping: then groups
- Grouping → Row expansion: then expands
- Row expansion → Pagination state: then paginates
- use_table hook → DataTable component: supplies table (evidence: `yew-datatable/src/components/data_table.rs`)
- DataTable component → Table header: renders (evidence: `yew-datatable/src/components/data_table.rs`)
- DataTable component → Table body: renders (evidence: `yew-datatable/src/components/data_table.rs`)
- Table body → Cell render context: creates context (evidence: `yew-datatable/src/components/table_body.rs`)
- DataTable component → Pagination component: renders (evidence: `yew-datatable/src/components/data_table.rs`)
- Pagination component → use_table hook: navigates pages (evidence: `yew-datatable/src/components/pagination.rs`)
- use_table hook → Pagination state: updates page state
- use_table hook → Row selection: updates selection
- use_table hook → Column controls: updates columns
- Row model → Aggregation: supports grouped values
