Table — Playground

px
Ava ChenEngineerActive
Liam OseiDesignerInvited
Noor MalikProduct ManagerActive
Priya RaoSupportSuspended
size
State
html.html
<table kuiTable [data]="rows" #table="kuiTable">
  <thead>
    <tr kuiThGroup>
      <th kuiTh sortKey="name">Name</th>
      <th kuiTh sortKey="role">Role</th>
      <th kuiTh sortKey="status">Status</th>
    </tr>
  </thead>
  <tbody>
    @for (row of table.sortedData(); track row.id) {
      <tr kuiRow [value]="row">
        <td kuiCell>{{ row.name }}</td>
        <td kuiCell>{{ row.role }}</td>
        <td kuiCell>{{ row.status }}</td>
      </tr>
    }
  </tbody>
</table>
NameTypeDefaultDescription
dataT[][]Source rows for sorting and selection. Selector: table[kuiTable].
size'xs' | 'sm' | 'md' | 'lg''md'Table density and typography scale. Selector: table[kuiTable].
selectionChangeoutput<T[]>Emits current selection whenever it changes. Observing this output is what makes the selection column appear. Selector: table[kuiTable].
sortChangeoutput<KuiActiveSortState | null>Emits the active sort key/direction, or null when sort is cleared. When observed, kuiTable hands row ordering to the parent instead of sorting locally. Selector: table[kuiTable].
sortStateSignal<KuiSortState>Current sort state (null when no column is sorted). Selector: table[kuiTable].
sortedDataSignal<T[]>Rows in current sort order. Use this in the template instead of data when sort is uncontrolled. Selector: table[kuiTable].
isSelected(item)(item: T) => booleanReturns whether a given row value is currently selected. Selector: table[kuiTable].
#table="kuiTable"exportAsTemplate reference for reading sortedData(), sortState(), and selection state.
sortKeystring | undefined-Enables sort for this header cell; usually matches a row property name. Selector: th[kuiTh].
comparator(a: T, b: T) => number-Custom sort function for the column, used instead of default comparison. Selector: th[kuiTh].
stickybooleanfalsePins this header cell horizontally with position: sticky. Selector: th[kuiTh]. Also available on tr[kuiThGroup] to pin the whole header row vertically.
valueTThe data object represented by this row. Selector: tr[kuiRow], required.
ariaLabelstring'Select all rows'Accessible label for the select-all checkbox. Selector: th[kuiSelectTh].
ariaLabelstring-Accessible label for a row selection checkbox, e.g. "Select " + row.name. Selector: td[kuiSelectCell].
td[kuiCell]marker directiveApplies Kikita table cell styling to a native td. No inputs in the installed version.
--kui-table-font-sizeCSS custom propertyBase font size for table text.
--kui-table-th-pyCSS custom propertyVertical padding for header cells.
--kui-table-cell-pxCSS custom propertyHorizontal padding for cells.
--kui-table-row-pyCSS custom propertyVertical padding for body row cells.
--kui-table-th-fgCSS custom propertyHeader cell text color.
--kui-table-th-bgCSS custom propertyHeader cell background color.
--kui-table-borderCSS custom propertyOuter table border color.
--kui-table-row-borderCSS custom propertyRow divider border color.
--kui-table-row-hover-bgCSS custom propertyRow background on hover.
--kui-table-row-selected-bgCSS custom propertyRow background when selected.
--kui-table-row-selected-accentCSS custom propertyAccent color for selected rows.
--kui-table-sort-active-colorCSS custom propertyColor used for the active sort indicator.
--kui-table-bgCSS custom propertyTable background color.

Inputs and outputs verified against @kikita-labs/ui v1.6.1 public typings.