Filter Panel
Beta2.3.0The filter panel renders a set of filter controls and tracks the user's selections. You use that selection to filter your data.
import {FilterPanel} from "@qualcomm-ui/react/filter-panel"Defining Filters
Filters are declared up front with defineFilters. Each key becomes the filter's id. Each value is a filter definition.
import {defineFilters, listFilter} from "@qualcomm-ui/core/filters"
import {ListCollection} from "@qualcomm-ui/utils/collection"
export const filters = defineFilters({
architecture: listFilter({
collection: new ListCollection({items: ["arm64", "x86-64"]}),
label: "Architecture",
}),
platform: listFilter({
collection: new ListCollection({items: ["Linux", "macOS", "Windows"]}),
label: "Platform",
}),
status: listFilter({
collection: new ListCollection({items: ["Failed", "Passed", "Queued"]}),
label: "Status",
}),
})The utility sets the filter's label, collection, and value type. The control renders it inside FilterPanel.Filter. The controls are documented on the Filter Controls page.
<FilterPanel.Root className="w-72" filters={filters}>
<FilterPanel.Filter filter={filters.status}>
<CheckboxGroupFilter />
</FilterPanel.Filter>
<FilterPanel.Filter filter={filters.architecture}>
<RadioGroupFilter />
</FilterPanel.Filter>
<FilterPanel.Filter filter={filters.platform}>
<CheckboxGroupFilter />
</FilterPanel.Filter>
</FilterPanel.Root>
Examples
Automatic Updates
By default, every change is committed as it happens and calls onValueChange.
{}<FilterPanel.Root
className="w-72"
filters={filters}
onValueChange={setValue}
>
<FilterPanel.Header>
<FilterPanel.Heading>
Filters <FilterPanel.Count />
</FilterPanel.Heading>
<FilterPanel.ClearButton />
</FilterPanel.Header>
<FilterPanel.Filter filter={filters.status}>
<CheckboxGroupFilter />
</FilterPanel.Filter>
<FilterPanel.Filter filter={filters.architecture}>
<RadioGroupFilter />
</FilterPanel.Filter>
<FilterPanel.Filter filter={filters.platform}>
<CheckboxTreeFilter defaultExpandedValue={["desktop"]} />
</FilterPanel.Filter>
</FilterPanel.Root>
Manual Apply
Set applyMode to manual to stage changes in a draft. FilterPanel.ApplyButton commits the draft and calls onValueChange.
{}<FilterPanel.Root
applyMode="manual"
className="w-72"
filters={filters}
onValueChange={setValue}
>
<FilterPanel.Header>
<FilterPanel.Heading>
Filters <FilterPanel.Count />
</FilterPanel.Heading>
<FilterPanel.ClearButton />
</FilterPanel.Header>
<FilterPanel.Filter filter={filters.status}>
<CheckboxGroupFilter />
</FilterPanel.Filter>
<FilterPanel.Filter filter={filters.architecture}>
<RadioGroupFilter />
</FilterPanel.Filter>
<FilterPanel.Filter filter={filters.platform}>
<CheckboxTreeFilter defaultExpandedValue={["desktop"]} />
</FilterPanel.Filter>
<FilterPanel.Footer>
<FilterPanel.ApplyButton />
</FilterPanel.Footer>
</FilterPanel.Root>
Controlled State
Set the initial selection using the defaultValue prop, or use value and onValueChange to control it manually. These props follow our controlled state pattern.
{
"status": [
"Failed"
]
}
<FilterPanel.Root
className="w-72"
filters={filters}
onValueChange={setValue}
value={value}
>
<FilterPanel.Filter filter={filters.status}>
<CheckboxGroupFilter />
</FilterPanel.Filter>
<FilterPanel.Filter filter={filters.owner}>
<ComboboxFilter />
</FilterPanel.Filter>
</FilterPanel.Root>
Manual & Controlled State
In manual mode, value is the applied (saved) selection and draftValue refers to the panel's staged changes. They only differ in manual mode, until the draft is applied.
Setting value from outside the panel replaces the draft, including any unapplied changes.
{
"status": [
"Failed"
]
}
<FilterPanel.Root
applyMode="manual"
className="w-72"
filters={filters}
onValueChange={setValue}
value={value}
>
<FilterPanel.Filter filter={filters.status}>
<CheckboxGroupFilter />
</FilterPanel.Filter>
<FilterPanel.Filter filter={filters.architecture}>
<RadioGroupFilter />
</FilterPanel.Filter>
<FilterPanel.Footer>
<FilterPanel.ApplyButton />
</FilterPanel.Footer>
</FilterPanel.Root>
Labels
The definition's label is the filter's name everywhere: the section heading, the control's accessible name, and getFilterLabel.
To change how a single section heading renders, pass label to FilterPanel.Filter. It accepts a ReactNode, or a function that receives the definition's label. The rendered heading also names the control, but summaries keep the definition's label.
<FilterPanel.Root className="w-72" filters={filters}>
<FilterPanel.Filter
filter={filters.status}
label={(label) => (
<>
{label}{" "}
<span className="font-body-xs text-neutral-secondary">
(last run)
</span>
</>
)}
>
<CheckboxGroupFilter />
</FilterPanel.Filter>
</FilterPanel.Root>
Loading Options
To load a filter's options from an API, leave collection off its definition. Use the getFilterCollection callback to provide the collection. Load the data elsewhere, like with a query library, and return undefined until it arrives. A filter without a collection shows no options.
The panel doesn't show loading or error states. Render them yourself. This example shows a progress ring next to the filter label, through the label prop, while the request is pending. If the request fails, an error message with a Retry button replaces the control.
<FilterPanel.Root
className="w-72"
filters={filters}
getFilterCollection={(id) => (id === "owner" ? owners.data : undefined)}
>
<FilterPanel.Filter
filter={filters.owner}
label={(label) => (
<span className="inline-flex items-center gap-2">
{label}
{owners.isPending ? (
<ProgressRing aria-label="Loading owners" size="xs" />
) : null}
</span>
)}
>
{owners.isError ? (
<div className="flex items-center gap-2">
<span className="font-body-xs text-neutral-secondary">
Could not load owners
</span>
<Button
onClick={() => void owners.refetch()}
size="sm"
variant="ghost"
>
Retry
</Button>
</div>
) : (
<CheckboxGroupFilter />
)}
</FilterPanel.Filter>
</FilterPanel.Root>
Restoring a Selection
A selection restored from a URL like /builds?owner=u2 may only contain value ids. Anything that shows the selection outside the panel, like these chips, should wait for the collection data before calling getValueItems.
<FilterPanel.RootProvider className="w-72" value={filterSet}>
<FilterPanel.Filter
filter={filters.owner}
label={(label) => (
<span className="inline-flex items-center gap-2">
{label}
{owners.isPending ? (
<ProgressRing aria-label="Loading owners" size="xs" />
) : null}
</span>
)}
>
<CheckboxGroupFilter />
</FilterPanel.Filter>
</FilterPanel.RootProvider>
<div className="flex min-w-60 flex-1 flex-wrap gap-2">
{owners.isPending ? (
<ProgressRing aria-label="Loading selected owners" size="xs" />
) : (
filterSet.getValueItems("owner").map((item) => (
<Tag
key={item.value}
onDismiss={() =>
filterSet.removeFilterValue("owner", item.value)
}
variant="dismissable"
>
{item.label}
</Tag>
))
)}
</div>
Filter Counts
To show the number of results next to each filter option, provide the counts with the getFilterOptionCounts callback. Unselected checkbox and radio options with a count of 0 are disabled.
<FilterPanel.Root
filters={filters}
getFilterOptionCounts={(id) => response.facets[id]}
>When you have access to the entire dataset up front, you can use our FacetIndex utility to compute option counts that adjust based on filter selection.
- android-arm64
- android-x86
- ios-simulator
- linux-gcc
- linux-clang
- windows-msvc
- windows-arm64
- macos-arm64
<FilterPanel.Root
className="w-72"
filters={filters}
onValueChange={setValue}
value={value}
{...facetProps}
>
<FilterPanel.Filter filter={filters.name}>
<TextInputFilter />
</FilterPanel.Filter>
<FilterPanel.Filter filter={filters.status}>
<CheckboxGroupFilter />
</FilterPanel.Filter>
<FilterPanel.Filter filter={filters.architecture}>
<RadioGroupFilter />
</FilterPanel.Filter>
</FilterPanel.Root>
<ul className="text-neutral-primary font-body-md min-w-60 flex-1">
{builds
.filter((build) => ids.includes(build.id))
.map((build) => (
<li key={build.id}>{build.name}</li>
))}
</ul>
In manual mode, counts follow the draft, so they update before the user applies.
Dynamic Filter Counts
A FacetIndex can only count the items you give it. When working with an external data source, we recommend sending a separate unfiltered request once at the start of your search experience. This approach requires the unfiltered query to return every available option. Every option then stays in its list, even as the filters narrow the results.
When the full dataset is too large to fetch, compute only the counts on the server and send those instead. If you're using a proper search index like Open/Elastic Search, this is typically accomplished with Term Aggregations.
This example uses TanStack Query, with a mock endpoint in place of a search API.
<FilterPanel.Root
className="w-72"
filters={filters}
getFilterCollection={(id) => facets.data?.getFilterCollection(id)}
getFilterOptionCounts={(id, values) =>
facets.data?.getFilterOptionCounts(id, values)
}
onValueChange={setValue}
value={value}
>
<FilterPanel.Filter
filter={filters.status}
label={(label) => (
<span className="inline-flex items-center gap-2">
{label}
{facets.isPending ? (
<ProgressRing aria-label="Loading statuses" size="xs" />
) : null}
</span>
)}
>
<CheckboxGroupFilter />
</FilterPanel.Filter>
<FilterPanel.Filter
filter={filters.platform}
label={(label) => (
<span className="inline-flex items-center gap-2">
{label}
{facets.isPending ? (
<ProgressRing aria-label="Loading platforms" size="xs" />
) : null}
</span>
)}
>
<CheckboxGroupFilter />
</FilterPanel.Filter>
</FilterPanel.Root>
Neither filter has a collection, so each lists the values of its field from the index. Until the index loads, the filters have no options, so each shows a progress ring next to its label.
Hoisted State
FilterPanel.Root handles the filter set state internally. Use useFilterSet with FilterPanel.RootProvider to own that state in your component, where code outside the panel can read and change it.
const filterSet = useFilterSet({filters})
return (
<div className="flex w-full max-w-3xl flex-wrap items-start gap-6">
<FilterPanel.RootProvider className="w-72" value={filterSet}>
<FilterPanel.Filter filter={filters.status}>
<CheckboxGroupFilter />
</FilterPanel.Filter>
<FilterPanel.Filter filter={filters.owner}>
<ComboboxFilter />
</FilterPanel.Filter>
</FilterPanel.RootProvider>
<div className="flex min-w-60 flex-1 flex-wrap gap-2">
{filterSet.getValueItems().map((item) => (
<Tag
key={`${item.filterId}:${item.value}`}
onDismiss={() =>
filterSet.removeFilterValue(item.filterId, item.value)
}
variant="dismissable"
>
{item.label}
</Tag>
))}
</div>
</div>
)
The state lives in the component that calls useFilterSet. This way, the panel can unmount without losing the selection, like in a drawer:
<Drawer.Root
onOpenChange={(open) => {
if (!open) {
// apply draft values when the drawer closes
filterSet.apply()
}
}}
unmountOnExit
>
<Drawer.Trigger>
<Button variant="outline">Filters ({filterSet.valueCount})</Button>
</Drawer.Trigger>
<Drawer.FloatingPortal>
<Drawer.Body>
<Drawer.Heading>Filters</Drawer.Heading>
<Drawer.CloseButton />
<FilterPanel.RootProvider value={filterSet}>
<FilterPanel.Filter filter={filterSet.filters.status}>
<CheckboxGroupFilter />
</FilterPanel.Filter>
<FilterPanel.Filter filter={filterSet.filters.owner}>
<ComboboxFilter />
</FilterPanel.Filter>
</FilterPanel.RootProvider>
</Drawer.Body>
</Drawer.FloatingPortal>
</Drawer.Root>
{filterSet.getValueItems().map((item) => (
<Tag
key={`${item.filterId}:${item.value}`}
onDismiss={() =>
filterSet.removeFilterValue(item.filterId, item.value)
}
variant="dismissable"
>
{item.label}
</Tag>
))}
Filters in Child Components
In a nested component, use useFilterSetContext to access the closest provider's filter state. For type safety, pass the type of your definitions:
// build-filters.ts
export const filters = defineFilters({...})
export type BuildFilters = typeof filters
// status-filter.tsx
import type {BuildFilters} from "./build-filters"
export function StatusFilter() {
const {filters} = useFilterSetContext<BuildFilters>()
return (
<FilterPanel.Filter filter={filters.status}>
<CheckboxGroupFilter />
</FilterPanel.Filter>
)
}The type isn't checked against the panel's definitions. In development, a filter warns when its definition is missing from the panel's filters.
Custom Filters
Declare a filter with your own value type using customFilter. isEmptyValue tells the panel when to drop the filter from the value, and getValueItems describes the value in active filter tags.
const filters = defineFilters({
attachments: customFilter<boolean>({
getValueItems: () => [{label: "Has attachments", value: "true"}],
isEmptyValue: (value) => !value,
label: "Attachments",
}),
})Render your custom control inside FilterPanel.Filter. FilterPanel.Filter wraps its child elements with a context provider. Use the useFilter hook to access this context.
{}<FilterPanel.Root
className="w-72"
filters={filters}
onValueChange={setValue}
>
<FilterPanel.Filter filter={filters.attachments}>
<AttachmentsControl />
</FilterPanel.Filter>
</FilterPanel.Root>
URL Search Params
This example serializes the committed selection to URL search params when the user applies the filter selection.
/builds?
import {type ReactElement, useState} from "react"
import {
defineFilters,
type FilterValues,
listFilter,
treeFilter,
} from "@qualcomm-ui/core/filters"
import {createTreeCollection} from "@qualcomm-ui/core/tree"
import {CodeHighlight} from "@qualcomm-ui/react-mdx/code-highlight"
import {FilterPanel} from "@qualcomm-ui/react/filter-panel"
import {
CheckboxGroupFilter,
CheckboxTreeFilter,
RadioGroupFilter,
} from "@qualcomm-ui/react/filters"
import {ListCollection} from "@qualcomm-ui/utils/collection"
interface PlatformNode {
id: string
nodes?: PlatformNode[]
text: string
}
const platforms = createTreeCollection<PlatformNode>({
nodeText: "text",
nodeValue: "id",
rootNode: {
id: "ROOT",
nodes: [
{
id: "desktop",
nodes: [
{id: "linux", text: "Linux"},
{id: "macos", text: "macOS"},
{id: "windows", text: "Windows"},
],
text: "Desktop",
},
{
id: "mobile",
nodes: [
{id: "android", text: "Android"},
{id: "ios", text: "iOS"},
],
text: "Mobile",
},
],
text: "",
},
})
const filters = defineFilters({
architecture: listFilter({
collection: new ListCollection({items: ["arm64", "x86-64"]}),
label: "Architecture",
}),
platform: treeFilter({collection: platforms, label: "Platform"}),
status: listFilter({
collection: new ListCollection({items: ["Failed", "Passed", "Queued"]}),
label: "Status",
}),
})
type BuildFilters = FilterValues<typeof filters>
function toSearchParams(value: BuildFilters): URLSearchParams {
const params = new URLSearchParams()
for (const status of value.status ?? []) {
params.append("status", status)
}
const [architecture] = value.architecture ?? []
if (architecture) {
params.set("architecture", architecture)
}
for (const platform of value.platform ?? []) {
params.append("platform", platform)
}
return params
}
export function FilterPanelUsingValueDemo(): ReactElement {
const [params, setParams] = useState(new URLSearchParams())
return (
<div className="flex w-full max-w-3xl flex-wrap items-start gap-6">
<FilterPanel.Root
applyMode="manual"
className="w-72"
filters={filters}
onValueChange={(value) => setParams(toSearchParams(value))}
>
<FilterPanel.Filter filter={filters.status}>
<CheckboxGroupFilter />
</FilterPanel.Filter>
<FilterPanel.Filter filter={filters.architecture}>
<RadioGroupFilter />
</FilterPanel.Filter>
<FilterPanel.Filter filter={filters.platform}>
<CheckboxTreeFilter defaultExpandedValue={["desktop"]} />
</FilterPanel.Filter>
<FilterPanel.Footer>
<FilterPanel.ApplyButton />
</FilterPanel.Footer>
</FilterPanel.Root>
<CodeHighlight
className="min-w-60 flex-1"
code={`/builds?${params.toString().replaceAll("&", "\n &")}`}
language="text"
/>
</div>
)
}API
<FilterPanel.Root>
FilterPanelRootProps<
TDefs extends FilterDefinitions = FilterDefinitions,
>
TDefsdefineFilters. Every filter rendered
in the filter set must use a definition from this object.| 'auto'
| 'manual'
FilterValues<TDefs>
FilterSetCollectionResolver<TDefs>
undefined for
filters this resolver doesn't handle, or while the data loads. A filter
without a collection shows no options.(
id: FilterId<TDefs>,
) => string | undefined
undefined
to fall back to the filter id.(
id: FilterId<TDefs>,
values: FilterValues<TDefs>,
) =>
| Record<string, number>
| undefined
manual mode. Options missing from the counts count 0.
Checkbox and radio filters show the counts and disable unselected options
with a count of 0. Checkbox tree filters show the counts of their leaves.
Return undefined to show no counts for the filter. Not called for range,
date, and text filters.(
id: {
[K in FilterId<TDefs>]: [
Extract<
TDefs[K],
{
readonly kind: 'range'
}
>,
] extends [never]
? never
: K
}[FilterId<TDefs>],
) =>
| {max: number; min: number}
| undefined
(
id: FilterId<TDefs>,
value: unknown,
) => boolean
undefined, null, "", [], and unbounded ranges. Empty values
remove the filter.(
value: FilterValues<TDefs>,
) => void
manual mode,
this is every change to the draft, including reset and a new value
replacing the draft. Use it to fetch option counts for the draft. In
auto mode, it is called with every committed change, after
onValueChange.(
value: FilterValues<TDefs>,
) => void
manual mode, on
every change in auto mode.| ReactElement
| ((
props: object,
) => ReactElement)
| 'sm'
| 'md'
| 'lg'
FilterValues<TDefs>
className'qui-filter-panel__root'data-apply-mode| 'auto'
| 'manual'
data-dirtybooleandata-filter-panel-part'root'data-size| 'sm'
| 'md'
| 'lg'
useFilterSet
Accepts the same state props as FilterPanel.Root and returns the filter set API.
FilterSetApi<
TDefs extends FilterDefinitions = FilterDefinitions,
>
() => void
auto mode.| 'auto'
| 'manual'
() => void
value and discards the draft.() => void
draftValue. In manual mode, the change is
committed by apply.(
id: FilterId<TDefs>,
) => void
value. Follows the same rules as
setFilterValue.FilterValues<TDefs>
manual mode, this is the draft,
which apply commits to value. In auto mode, it is always equal to
value.numberdraftValue. Each array item
counts once. Ranges, dates, and text count 1.TDefsfilters prop. In a nested component,
pass their type to useFilterSetContext to read a typed definition, such
as useFilterSetContext<typeof filters>().filters.status.(
id: K,
) => FilterValues<TDefs>[K]
draftValue, or undefined when it is not
set.(
id: FilterId<TDefs>,
) => number
draftValue. Each array item
counts once. Ranges, dates, and text count 1.(
id: K,
) =>
| FilterCollection<
TDefs[K & keyof TDefs]
>
| undefined
getFilterCollection. Returns
undefined when the filter has neither, or when getFilterCollection
returns the wrong kind of collection for the filter.(
id: FilterId<TDefs>,
) => string
getFilterLabel, then the id.(
id: FilterId<TDefs>,
) =>
| Record<string, number>
| undefined
getFilterOptionCounts, for the selection in draftValue. Returns
undefined when the filter has no counts.(
id: {
[K in FilterId<TDefs>]: [
Extract<
TDefs[K],
{
readonly kind: 'range'
}
>,
] extends [never]
? never
: K
}[FilterId<TDefs>],
) => Partial<FilterSetRange>
getFilterRange.(
id: FilterId<TDefs>,
) => number
value. Each array item counts
once. Ranges, dates, and text count 1.(
id?: FilterId<TDefs>,
) => Array<{
filterId: FilterId<TDefs>
label: string
value: string
}>
value, for active filter chips.
Pass an id to return the items of one filter. Without an id, returns the
items of every filter. List and tree filters return one item per option,
labeled by the filter's collection, or by the value itself when the
collection doesn't contain it. Range, date, and text filters return one
item for the whole value.(
id: FilterId<TDefs>,
) => boolean
draftValue.booleandraftValue differs from value. Always false in auto mode.(
id: FilterId<TDefs>,
value: string,
) => void
value, given the value of an
item from getValueItems. Range, date, and text filters are cleared.
Follows the same rules as setFilterValue.() => void
auto
mode.(
id: K,
value:
| FilterValues<TDefs>[K]
| ((
prev: FilterValues<TDefs>[K],
) => FilterValues<TDefs>[K]),
) => void
draftValue. Empty values remove the filter. In
manual mode, the change is committed by apply.(
id: K,
value:
| FilterValues<TDefs>[K]
| ((
prev: FilterValues<TDefs>[K],
) => FilterValues<TDefs>[K]),
) => void
value. Empty values remove the filter. In
manual mode, the same change is made to the draft, which keeps its
other changes.FilterValues<TDefs>
numbervalue. Each array item counts
once; ranges, dates, and text count 1. Equal to draftValueCount in
auto mode.useFilter
Returns the state of the enclosing FilterPanel.Filter or FilterProvider.
FilterContextValue<
TDef extends FilterDefinition = FilterDefinition,
>
() => void
manual mode, the change is committed by
the filter set's apply.| FilterCollection<TDef>
| undefined
undefined for other filter
kinds, and for collection filters with no collection.numberdraftValueCount.IdentifiedFilterDefinition<TDef>
TDef extends {
readonly id: infer TId extends
string
}
? TId
: string
booleanstring| string
| undefined
aria-labelledby. When unset,
controls use label as their aria-label.| Record<string, number>
| undefined
getFilterOptionCounts. Options missing from the counts count 0.
undefined when the filter has no counts.(
value:
| FilterDefinitionValue<TDef>
| ((
prev:
| FilterDefinitionValue<TDef>
| undefined,
) =>
| FilterDefinitionValue<TDef>
| undefined)
| undefined,
) => void
manual mode, the change is committed by the
filter set's apply.| FilterDefinitionValue<TDef>
| undefined
manual mode, this is the draft value.Definitions
FilterDefinition
| CustomFilterDefinition<any>
| DateFilterDefinition
| ListFilterDefinition
| RangeFilterDefinition
| TextFilterDefinition
| TreeFilterDefinition
ListFilterConfig
ListFilterConfig<T = any>
ListCollection<T>
getFilterCollection, for
data that loads asynchronously or depends on other state.stringTreeFilterConfig
TreeFilterConfig<T = any>
TreeCollection<T>
getFilterCollection.stringRangeFilterConfig
(
value: number,
) => string
stringnumbernumberDateFilterConfig
(
value: string,
) => string
stringArray<
| BuiltInDateFilterPreset
| {
label: string
range: () => [
string | Date | null,
string | Date | null,
]
value: string
}
>
"last7Days", needs no range. The
selection stores the preset's value. Resolve it to dates with
resolveDateFilterPreset.CustomFilterConfig
CustomFilterConfig<TValue>
(
value: TValue,
) => number
Defaults to 1 for any non-empty value, or the array length for arrays.
(
value: TValue,
) => Array<{
label: string
value: string
}>
value so
removeFilterValue can remove it.Defaults to one item per array element, otherwise one item for the value.
(
value: TValue,
) => boolean
true when the value should be treated as empty and removed.
Applied after the built-in check for undefined, null, "", and [].stringElement API
<FilterPanel.RootProvider>
useFilterSet. Renders a <div> element by default.FilterSetApi<any>
useFilterSet.| ReactElement
| ((
props: object,
) => ReactElement)
| 'sm'
| 'md'
| 'lg'
<FilterPanel.Header>
<div> element by default.| ReactElement
| ((
props: object,
) => ReactElement)
className'qui-filter-panel__header'<FilterPanel.Heading>
| LucideIcon
| ReactNode
null to hide it.| ReactElement
| ((
props: object,
) => ReactElement)
className'qui-filter-panel__heading'<FilterPanel.Count>
<span> element by default.boolean| 'neutral'
| 'neutral-outline'
| 'brand'
| 'brand-outline'
| 'info'
| 'success'
| 'warning'
| 'danger'
| 'persistent-black'
| 'persistent-white'
number| ReactElement
| ((
props: object,
) => ReactElement)
| 'xs'
| 'sm'
| 'md'
| 'lg'
numberclassName'qui-filter-panel__count'<FilterPanel.Section>
<div> element by default.| ReactElement
| ((
props: object,
) => ReactElement)
className'qui-filter-panel__section'<FilterPanel.Footer>
<div> element by default.| ReactElement
| ((
props: object,
) => ReactElement)
className'qui-filter-panel__footer'<FilterPanel.ApplyButton>
auto apply mode. Renders a
<button> element by default.NumberBadge or StatusBadge, positioned after the text content. Its
emphasis, size, and disabled state default to values that match the button.
Props set on the badge take precedence.| 'default'
| 'compact'
booleantrue, pointer/focus
events are blocked, and the component is visually dimmed.| 'neutral'
| 'primary'
| 'danger'
| 'persistent-white'
| 'persistent-black'
| 'inverse'
| 'white-persistent'
| 'black-persistent'
| LucideIcon
| ReactElement
| null
LucideIcon, the size will automatically match the size prop.
Supply as a ReactElement for additional customization.| ReactElement
| ((
props: object,
) => ReactElement)
| 'sm'
| 'md'
| 'lg'
| LucideIcon
| ReactElement
| null
LucideIcon,
the size will automatically match the size prop. Supply as a
ReactElement for additional customization.| 'fill'
| 'ghost'
| 'outline'
className'qui-filter-panel__apply-button'data-disabledbooleandata-filter-panel-part'apply-trigger'<FilterPanel.ClearButton>
manual apply mode, the cleared
filters must still be applied. Disabled when no filters are set. Renders a
<button> element by default.NumberBadge or StatusBadge, positioned after the text content. Its
emphasis, size, and disabled state default to values that match the button.
Props set on the badge take precedence.| 'default'
| 'compact'
booleantrue, pointer/focus
events are blocked, and the component is visually dimmed.| 'neutral'
| 'primary'
| 'danger'
| 'persistent-white'
| 'persistent-black'
| 'inverse'
| 'white-persistent'
| 'black-persistent'
| LucideIcon
| ReactElement
| null
LucideIcon, the size will automatically match the size prop.
Supply as a ReactElement for additional customization.| ReactElement
| ((
props: object,
) => ReactElement)
| 'sm'
| 'md'
| 'lg'
| LucideIcon
| ReactElement
| null
LucideIcon,
the size will automatically match the size prop. Supply as a
ReactElement for additional customization.| 'fill'
| 'ghost'
| 'outline'
className'qui-filter-panel__clear-button'data-disabledbooleandata-filter-panel-part'clear-trigger'<FilterPanel.CloseButton>
onClick or render this inside a container that provides closing
behavior, such as a drawer. Renders a <button> element by default.| 'default'
| 'compact'
booleantrue, pointer/focus
events are blocked, and the component is visually dimmed.| 'neutral'
| 'primary'
| 'danger'
| 'persistent-white'
| 'persistent-black'
| 'inverse'
| 'white-persistent'
| 'black-persistent'
| LucideIcon
| ReactElement
ReactElement for additional customization.| ReactElement
| ((
props: object,
) => ReactElement)
| 'square'
| 'rounded'
| 'sm'
| 'md'
| 'lg'
| 'fill'
| 'ghost'
| 'outline'
className'qui-filter-panel__close-button'<FilterPanel.Filter>
<div> element by default.FilterPanelFilterProps<
TDef extends FilterDefinition = FilterDefinition,
>
IdentifiedFilterDefinition<TDef>
filters.| FilterPanelFilterContentProps
| undefined
| FilterPanelFilterCountProps
| undefined
boolean'ltr' | 'rtl'
boolean() =>
| ShadowRoot
| Document
| Node
| FilterPanelFilterIndicatorProps
| undefined
| string
| number
| bigint
| ReactElement
| Iterable<ReactNode>
| ReactPortal
| Promise<AwaitedReactNode>
| ((
label: string,
) => ReactNode)
| boolean
| null
| undefined
ReactNode, or a function
that receives the resolved string label. The rendered label also names the
filter's control. getFilterLabel and value summaries keep the resolved
string.| FilterPanelFilterLabelProps
| undefined
boolean() => void
(
open: boolean,
) => void
boolean| ReactElement
| ((
props: object,
) => ReactElement)
| FilterPanelFilterTriggerProps
| undefined
booleanclassName'qui-filter-panel__filter'data-activebooleandata-filter-idstringdata-filter-panel-part'filter'<FilterPanel.FilterTrigger>
<button>
element by default.string| ReactElement
| ((
props: object,
) => ReactElement)
className'qui-filter-panel__filter-trigger'<FilterPanel.FilterLabel>
ReactNode, or a function that receives the resolved string, to customize
it. Renders a <span> element by default.| ReactNode
| ((
label: string,
) => ReactNode)
ReactNode, or a function
that receives the resolved string label. The rendered label also names the
filter's control. getFilterLabel and value summaries keep the resolved
string.| ReactElement
| ((
props: object,
) => ReactElement)
className'qui-filter-panel__filter-label'data-activebooleandata-filter-panel-part'filter-label'<FilterPanel.FilterCount>
<span> element by default.boolean| 'neutral'
| 'neutral-outline'
| 'brand'
| 'brand-outline'
| 'info'
| 'success'
| 'warning'
| 'danger'
| 'persistent-black'
| 'persistent-white'
number| ReactElement
| ((
props: object,
) => ReactElement)
| 'xs'
| 'sm'
| 'md'
| 'lg'
numberclassName'qui-filter-panel__filter-count'data-filter-panel-part'filter-count'hiddenboolean<FilterPanel.FilterIndicator>
<span> element by
default.| LucideIcon
| ReactNode
| ReactElement
| ((
props: object,
) => ReactElement)
className'qui-filter-panel__filter-indicator'<FilterPanel.FilterContent>
<div> element by default.string| ReactElement
| ((
props: object,
) => ReactElement)
className'qui-filter-panel__filter-content'
useFilterSetand renderFilterPanel.RootProviderinstead. Renders a<div>element by default.