Skip to Content
Liquid Glass UI
Blocks

Filter Panel

Collapsible Liquid Glass filter area for list pages — a search field plus rows of single / multiple choice chips, kept as a draft until Search and reset in one tap.

FilterPanel is a block (registry:block) for the top of a list page. It is business-agnostic: parse your URL query into values, and write what onApply hands back to the URL.

  • Draft first: tapping chips or typing only edits a draft. Search (or Enter in the search field) applies it; Reset clears and applies at once. When values change elsewhere (back / forward), the draft restarts from them.
  • Collapsible: alwaysVisible rows stay on screen; the rest fold away under More filters, which shows a count of active hidden filters.
  • Apple 27 chips: options are ToggleGroupItem variant="outline" capsules — the Bordered fill, and the solid accent fill once chosen. A single-choice row clears when the chosen chip is tapped again.
  • Liquid Glass: the panel is a glass Card (its search field and chips switch to Over-Glass); glass={false} renders it 100% opaque.
  • Responsive: desktop aligns every row in a two-column grid (the label column takes the longest label); phones stack each label above its chips with 34pt touch targets.
apple-liquid-ui/preview/filter-panel-demo
MacBook · 16:10

Installation (Shadcn Registry)

npx shadcn@latest add @apple-liquid/filter-panel

Installs into components/blocks/filter-panel/ together with card, input-group, toggle-group, badge and skeleton.

Usage

'use client';

import { FilterPanel, type FilterPanelValues } from '@/components/blocks/filter-panel';

export function OrdersFilters({
  values,
  onApply,
}: {
  values: FilterPanelValues;
  onApply: (values: FilterPanelValues) => void;
}) {
  return (
    <FilterPanel
      values={values}
      onApply={onApply}
      searchKey="q"
      searchPlaceholder="Order number or customer"
      alwaysVisible={1}
      rows={[
        {
          key: 'status',
          label: 'Status',
          options: [
            { value: 'paid', label: 'Paid' },
            { value: 'shipped', label: 'Shipped' },
          ],
        },
        {
          key: 'region',
          label: 'Region',
          multiple: true,
          options: [
            { value: 'east', label: 'East' },
            { value: 'west', label: 'West' },
          ],
        },
      ]}
    />
  );
}

Pairs naturally with the Data Table block: both keep their state in the URL.

Props API

PropTypeDefaultDescription
valuesRecord<string, string | string[] | undefined>—Applied filters (usually from the URL)
onApply(values) => void—Receives the cleaned filter set on Search, Enter or Reset
rowsFilterPanelRow[]—{ key, label, options, multiple?, emptyText?, loading? }
searchKey / searchPlaceholderstring—Key of the search field; omit to hide it
alwaysVisiblenumber0Rows that stay visible while collapsed
defaultExpandedbooleanfalseStart expanded
glassbooleantrueGlass panel / SDF edge refraction; glass={false} is 100% opaque
localeLiquidGlassLocaleInputGlobal localeUI language of this instance; overrides <LiquidGlassProvider locale>
messagesPartial<FilterPanelMessages>Built-in textText overrides, deep-merged over the built-in text and the global messages.filterPanel

On this page