SusDataTable

Data grid with toolbar, typed cells, sort / search / pagination — driven by SusTableController.
Package
SusKit · Data (commercial)
Props
| Name | Type | Default | |
|---|---|---|---|
Controller | Prop<SusTableController> | new() | v-model |
ShowToolbar | Prop<bool> | true | v-model |
Density | Prop<string> | "default" | v-model |
Variant | Prop<string> | "elevated" | v-model |
Hover | Prop<bool> | true | v-model |
Slots
| Name |
|---|
toolbar |
Events
No public events.
Style hooks
USS class contract — override appearance without touching C#. States toggle via these classes:
sus-data-table__action-btnsus-data-table__cellsus-data-table__cell--actionssus-data-table__cell--align-centersus-data-table__cell--align-endsus-data-table__cell--descriptionsus-data-table__cell--numbersus-data-table__cell--selectsus-data-table__cell--togglesus-data-table__cell-wrapsus-data-table__emptysus-data-table__empty-textsus-data-table__footersus-data-table__footer-btnsus-data-table__footer-infosus-data-table__footer-leftsus-data-table__footer-rightsus-data-table__footer-selectsus-data-table__header-cellsus-data-table__header-cell--sort-wiredsus-data-table__header-cell--sortablesus-data-table__header-titlesus-data-table__header-title--align-centersus-data-table__header-title--align-endsus-data-table__header-title--sortablesus-data-table__hostsus-data-table__loading-barsus-data-table__loading-overlaysus-data-table__searchsus-data-table__sort-btnsus-data-table__sort-btn--activesus-data-table__toolbarsus-data-table__toolbar-actionssus-data-table__viewsus-data-table--density-comfortablesus-data-table--density-compactsus-data-table--hoversus-data-table--variant-flatsus-data-table--variant-outlinedsus-selectsus-select__detailssus-select__fieldsus-select__valuesus-slotsus-table__action-btnsus-table__cell--toggleunity-collection-view__itemunity-collection-view__item--selectedunity-list-view__itemunity-list-view__item--alternatedunity-list-view__item--selectedunity-multi-column-headerunity-multi-column-header__columnunity-multi-column-header__column__sort-indicatorunity-multi-column-header__column-sortingunity-multi-column-header__column-sorting-indicator
Usage
Columns and rows live on the controller (SetColumns / SetItems). Optional ApplyKindDefaults applies a SusTableKind preset.
csharp
var ctrl = new SusTableController();
ctrl.ApplyKindDefaults(SusTableKind.MainList);
ctrl.SetColumns(new List<ColumnDef>
{
new() { Key = "Name", Title = "Name", MinWidth = 140f, Sortable = true, Searchable = true },
new() { Key = "Role", Title = "Role", Width = 100f, Sortable = true },
new() { Key = "Level", Title = "Lvl", Width = 72f, Align = "end",
CellType = SusCellType.Number, Sortable = true },
});
ctrl.SetItems(new List<object>
{
new Dictionary<string, object> { ["Name"] = "Aria", ["Role"] = "Tank", ["Level"] = 12 },
new Dictionary<string, object> { ["Name"] = "Borin", ["Role"] = "DPS", ["Level"] = 9 },
});
ctrl.SetItemsPerPage(5);
var table = new SusDataTable();
table.Controller.Value = ctrl;
table.ShowToolbar.Value = true;
table.Density.Value = "default";
table.Variant.Value = "elevated";
table.Hover.Value = true;xml
<template>
<sus:SusDataTable :Controller="TableCtrl.Value"
:ShowToolbar="ShowToolbar.Value"
:Density="Density.Value"
:Variant="Variant.Value"
:Hover="Hover.Value">
<template #toolbar>
<!-- Optional actions next to global search -->
</template>
</sus:SusDataTable>
</template>
<script>
public Prop<SusTableController> TableCtrl = new(new());
public Prop<bool> ShowToolbar = new(true);
public Prop<string> Density = new("default");
public Prop<string> Variant = new("elevated");
public Prop<bool> Hover = new(true);
// Populate TableCtrl columns/items in code (see above).
</script>| Prop | Role |
|---|---|
Controller | SusTableController — columns, items, sort, search, page |
ShowToolbar | Global search + toolbar slot |
Density | default · compact · comfortable |
Variant | elevated · flat · outlined |
Hover | Row hover highlight |
Notes
- Prefer
SusDataTableoverSusTablewhen you need toolbar, kind presets, or typed cells (SusCellType: text · number · icon · image · toggle · badge · progress · description · actions). SusTableKind:MainList·Picker·ActionList·ReadOnly·Dev— viaApplyKindDefaults.- Row actions / selection / loading live on the controller (
Options,RowActionRequested,Loading, …). - Empty
Itemsshows the built-in empty state; setLoadingfor the overlay bar.