Esc
Documentation
On this page

Props

PropTypeDefaultDescription
sourceDataSourceNoneResource binding that supplies the rows
datareadonly Record<string, unknown>[]NoneInline rows (alternative to source)
item requiredListItemNoneRow fields that fill the title, description, badge, meta, icon, and status
rowLinkTableRowLinkNoneLink each row to a route
rowActionsreadonly TableRowAction[]NoneActions with variant: "primary" and an icon appear as row buttons. The rest open from the overflow menu.
searchablebooleanNoneAdd a search box that matches the title, description, badge, and meta
nounstringNoneSingular noun for the count and the search placeholder, such as "job"
filtersreadonly ListFilter[]NoneFilter dropdowns, each bound to a row field
pageSizenumberNoneRows shown before a "Show more" button. All rows when omitted.
emptyMessagestringNoneText shown when there are no rows

Example

ts
List({
  source: jobs(),
  item: {
    title: "name",
    description: "schedule",
    badge: "type",
    status: { label: "state", detail: "lastRun" },
  },
  searchable: true,
  noun: "job",
})

Supporting types

ListItem
export interface ListItem {
  /** Main line, shown in bold. */
  title: string;
  /** Second line under the title. */
  description?: string;
  /** Short tag beside the title, such as a type or category. */
  badge?: string;
  /** Muted details joined after the description, such as an owner. */
  meta?: readonly string[];
  /** Icon shown before the item; an SDK icon name such as `"grid"`. */
  icon?: string;
  /** Status shown at the trailing edge, above an optional detail. */
  status?: {
    label: string;
    /**
     * Field holding a tone: healthy, warning, unavailable, info, or muted.
     * When omitted or empty, common status words in the label pick the
     * tone, so "success" is healthy and "failed" is unavailable.
     */
    tone?: string;
    /** Secondary line under the status, such as a timestamp. */
    detail?: string;
  };
}
ListFilter
export interface ListFilter {
  field: string;
  label: string;
  /** Choices to offer; each distinct value of the field when omitted. */
  options?: readonly { label: string; value: string }[];
}

View the source on GitHub