Skip to content
Data displayGenerated from the public API

FacetFilter

Multi-select filtering derived from the data, with counts that reflect the other facets.

@luc/ui/data-table

Examples

Default

Shown inside a real table, which is the only context the component renders in.

Six prepared research runs with performance and metadata columns.
Equity
BTC-USDVolatility carryPausedRange2.0041.7%-29.1%34156.7%Sep 13
AAPLCross-sectional momentumLiveStress1.73-3.8%-32.4%39440.2%Aug 24
NDXVolatility carryLiveStress1.5523.0%-26.0%42345.5%Sep 9
NVDAMean reversionPausedStress1.32-2.0%-15.0%53293.3%Aug 19
NDXMean reversionFailedTrend0.4825.4%-13.7%29759.9%Sep 9
MSFTTrend breakoutFailedRange0.339.4%-26.8%22323.3%Sep 21

Usage

import { FacetFilter } from "@luc/ui/data-table";
<DataTable
  columns={columns}
  data={runs}
  ariaLabel="Research runs"
  enableFiltering
  toolbar={
    <DataTableToolbar>
      <FacetFilter columnId="status" label="Status" searchable />
    </DataTableToolbar>
  }
/>

Package setup — peer requirements, the stylesheet and the provider — is on installation.

API

Read from the published TypeScript API, so a prop that is not listed here does not exist and a default that is listed is the one the compiler sees.

Exported symbols
ExportKindSignature
FacetFilter6 documented props({ columnId, label, formatValue, hideEmpty, searchable, className, }: FacetFilterProps) => import("@types/react").JSX.Element | null

FacetFilter props

Type: FacetFilterProps

Values the compiler reads from the declaration.

FacetFilter props
PropTypeDefaultNotes
className?string | undefined—
columnIdstring—Column id to filter.
formatValue?((value: string) => string) | undefined—Render a raw facet value. Defaults to the value itself.
hideEmpty?boolean | undefined—Hide options that would return zero rows. Default `true`.
labelstring—Button label, e.g. "Status".
searchable?boolean | undefined—Show the option search field. Default `true` from 8 options upward.

Guidelines

Do

  • Name the column it filters through `columnId`, and give the facet the column's own label.
  • Turn on `searchable` for a facet with more than a dozen values, and `hideEmpty` where a value that matches nothing is noise.

Don't

  • Keep a facet for a column no other control can sort or read; the filter stays and the reader cannot tell what changed.

Accessibility

The facet is a menu of options bound to the table's column filter; the table's own header and row count report the result, so the filter does not need to announce a second copy of it.

Family

Data display

Dense, sortable, scannable: the surfaces a real product reads numbers from.

17 documented entries in this family. Open the family index

Luc UI v1.0FacetFilterdark theme