Skip to content
ProLifetime access for $199, paid once, every future release included
Truffle UI

Faceted Filter

ProNew

A filter for one field with fixed values: counts beside each value, a search for long lists and the selection shown on the button.

Installation

pnpm dlx shadcn@latest add @viewport/faceted-filter

First time? Add the @viewport registry to components.json. Setup takes one minute.

Usage

The code behind the preview above comes with Truffle Pro.

Props

PropTypeDefault
title*string

The field being filtered, e.g. "Status".

—
options*FacetOption[]—
value*string[]

The selected values.

—
onValueChange*(value: string[]) => void—
searchableboolean

Show a search field above the options. Defaults to on for more than seven options.

—
classNamestring—

Accessibility

  • Options are checkboxes in a named group.
  • The button states the field and what is selected.
  • The panel returns focus to the button when it closes.