Skip to content

SusTable

SusTable

Lightweight header + scrollable rows + pagination footer — same SusTableController as DataTable, without toolbar / typed-cell chrome.

Package

SusKit · Data (commercial)

Open in Playground

SusKit · Data

Props

NameTypeDefault
ControllerProp<SusTableController>new()v-model

Slots

No slots.

Events

No public events.

Style hooks

USS class contract — override appearance without touching C#. States toggle via these classes:

  • sus-button
  • sus-table
  • sus-table__action-btn
  • sus-table__body
  • sus-table__cell
  • sus-table__cell--actions
  • sus-table__cell--align-center
  • sus-table__cell--align-end
  • sus-table__cell--description
  • sus-table__cell--ellipsis
  • sus-table__cell--number
  • sus-table__cell--progress
  • sus-table__footer
  • sus-table__footer-actions
  • sus-table__footer-btn
  • sus-table__footer-info
  • sus-table__header
  • sus-table__header-cell
  • sus-table__header-row
  • sus-table__header-title
  • sus-table__header-title--align-center
  • sus-table__header-title--align-end
  • sus-table__header-title--sortable
  • sus-table__media--clip
  • sus-table__media--rounded
  • sus-table__row
  • sus-table__row--hoverable
  • sus-table__row--selected
  • sus-table__row--striped
  • sus-table__rows
  • sus-table__sort-btn
  • sus-table__sort-btn--active

Usage

Wire columns and items on the controller, then assign it to the view.

csharp
var ctrl = new SusTableController();
ctrl.SetColumns(new List<ColumnDef>
{
    new() { Key = "name", Title = "Name", Sortable = true },
    new() { Key = "role", Title = "Role", Sortable = true },
    new() { Key = "lvl", Title = "Lvl", Sortable = true },
});
ctrl.SetItems(new List<object>
{
    new Dictionary<string, object> { ["name"] = "Aria", ["role"] = "Tank", ["lvl"] = 12 },
    new Dictionary<string, object> { ["name"] = "Borin", ["role"] = "DPS", ["lvl"] = 9 },
    new Dictionary<string, object> { ["name"] = "Cira", ["role"] = "Heal", ["lvl"] = 14 },
});
ctrl.SetItemsPerPage(5);

var table = new SusTable();
table.Controller.Value = ctrl;
xml
<template>
  <sus:SusTable :Controller="TableCtrl.Value" />
</template>

<script>
public Prop<SusTableController> TableCtrl = new(new());
// Populate TableCtrl columns/items in code (see above).
</script>
PropRole
ControllerSusTableController — columns, items, sort, page

Notes

  • Simpler than SusDataTable: no toolbar slot, no kind-preset chrome, cells render as text.
  • Pagination footer appears when TotalPages > 1.
  • For typed cells / global search / select column — use SusDataTable.