Fandry UI
Overlays & Data

Table

A data table with sorting, pagination, selection, and filtering — wraps @tanstack/table-core.

fandry-table

Example

Link to section Example

Custom colors and parts

Link to section Custom colors and parts

The same component with a few --fd-* tokens set around it and its parts restyled. The code is under Parts below.

Props

Link to section Props
PropTypeDefaultDescription
columnsColumnDef[][]Column definitions.
dataRowData[][]Row data.
enable-paginationbooleanfalseTurns on page-size-driven pagination.
enable-row-selectionbooleanfalseTurns on checkbox row selection.
enable-global-filterbooleanfalseTurns on a search box that filters all columns.
messages{ selectionStatus, selectRow, selectAll, pageStatus, paginationLabel, previousPage, nextPage }{}Replaces the table's own text ("2 of 5 selected", checkbox names, the pagination's name, Previous/Next and "Page 1 of 3"), e.g. to translate it. Any key left out keeps its English default.

Parts

Link to section Parts

Style the elements inside the component from your own CSS with ::part(). Every fandry component renders in native shadow DOM, so parts work on LWR and Salesforce alike. For colors, spacing, radius and type across many components, set the --fd-* tokens instead. The code for the "Custom colors and parts" example above:

PartDescription
toolbarThe bar above the table that holds the search box, or the viewer's bar above the picture.
containerThe scrolling box around the table.
tableThe native <table>.
captionThe <caption>, or a picture's caption.
header-rowThe header row.
header-cellA header cell.
selection-cellThe checkbox cell of a row or of the header (also a cell or header-cell).
sort-buttonThe button in a sortable header cell.
header-labelA header's text.
sort-indicatorThe sort arrow.
rowA body row.
loading-rowA placeholder row while loading (also a row).
cellA body cell.
empty-rowThe row shown when there are no rows (also a row).
emptyWhat shows when there is nothing to list.
footerThe bar under the table.
selection-statusThe "n of m selected" text.
paginationThe wrapper of the pagination slot.

States are extra names on a part while the state is on. Name both to style one state, e.g.fandry-checkbox::part(control checked).

StateDescription
selectedThe chosen option, a selected table row, or the selected tab.
sortedA header cell whose column is sorted (also ascending or descending).
ascendingA header cell sorted low to high.
descendingA header cell sorted high to low.
<!-- template -->
<div class="brand">
  <fandry-table columns={columns} data={data} caption="Recent orders"></fandry-table>
</div>

/* css */
/* Scoped to this demo. Set the same --fd-* tokens on :root to theme
   every fandry-* component on the site. */
.brand {
  --fd-primary: 160 84% 26%;
  --fd-bg-muted: 160 40% 96%;
  --fd-border: 160 30% 88%;
}

fandry-table::part(container) {
  border: 1px solid hsl(160 30% 88%);
  border-radius: 1rem;
}

fandry-table::part(caption) {
  padding: 0.75rem 1rem 0;
}

fandry-table::part(header-cell) {
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: hsl(160 84% 22%);
}

fandry-table::part(row):hover {
  background: hsl(160 40% 97%);
}
​

Code

Link to section Code
<fandry-table
  columns={columns}
  data={data}
  caption="Team members"
  enable-pagination
></fandry-table>
​