Table Filters

import {
  TableColumnFilterAction,
  TableFilterBar,
} from "@qualcomm-ui/react/table-filters"

Both components read the filter set from a surrounding FilterSetProvider or filter panel. See Column Header Filters for an example.

API

TableColumnFilterAction

An action button for opening a column filter menu or interface, such as a Popover trigger in a column header. Shows a filled icon while the column is filtered. Renders nothing when the column can't be filtered. Otherwise renders a <button> element by default.
PropTypeDefault
boolean
The column header associated with the filter.
Header<any>
Lucide icon to display inside the button.
| LucideIcon
| ReactElement
Funnel
boolean
Allows you to replace the component's HTML element with a different tag or component. Learn more
| ReactElement
| ((
props: object,
) => ReactElement)
Type
boolean
Type
Header<any>
Description
The column header associated with the filter.
Type
| LucideIcon
| ReactElement
Description
Lucide icon to display inside the button.
Type
boolean
Type
| ReactElement
| ((
props: object,
) => ReactElement)
Description
Allows you to replace the component's HTML element with a different tag or component. Learn more

TableFilterBar

The simple TableFilterBar renders the root, filter list, expand trigger, and clear trigger. It accepts the root's props and these props for its parts.

PropType
Props applied to the clear trigger component.
TableFilterBarClearTriggerProps
Props applied to the expand trigger component.
TableFilterBarExpandTriggerProps
Props applied to the filter list component.
Omit<
TableFilterBarFilterListProps,
'children'
>
Type
TableFilterBarClearTriggerProps
Description
Props applied to the clear trigger component.
Type
TableFilterBarExpandTriggerProps
Description
Props applied to the expand trigger component.
Type
Omit<
TableFilterBarFilterListProps,
'children'
>
Description
Props applied to the filter list component.

TableFilterBar.Root

The root element of the filter bar. Must be rendered within a Table.Root and a filter set, such as a FilterSetProvider. Renders nothing while no filters are applied. Otherwise renders a <div> element by default.
PropTypeDefault
React children prop.
The initial expanded state. Use when you don't need to control the expanded state.
boolean
false
The controlled expanded state. When false, the applied filters are clamped to a single row.
boolean
Called when the expanded state changes.
(
expanded: boolean,
) => void
Allows you to replace the component's HTML element with a different tag or component. Learn more
| ReactElement
| ((
props: object,
) => ReactElement)
Description
React children prop.
Type
boolean
Description
The initial expanded state. Use when you don't need to control the expanded state.
Type
boolean
Description
The controlled expanded state. When false, the applied filters are clamped to a single row.
Type
(
expanded: boolean,
) => void
Description
Called when the expanded state changes.
Type
| ReactElement
| ((
props: object,
) => ReactElement)
Description
Allows you to replace the component's HTML element with a different tag or component. Learn more

TableFilterBar.FilterList

Lists the applied filters as dismissable tags, followed by its children. Clamped to a single row unless the filter bar is expanded. Renders a <div> element by default.
PropType
React children prop. Rendered after the applied filters' tags. Render the TableFilterBar.ExpandTrigger here so that it follows the last visible tag.
Allows you to replace the component's HTML element with a different tag or component. Learn more
| ReactElement
| ((
props: object,
) => ReactElement)
Description
React children prop. Rendered after the applied filters' tags. Render the TableFilterBar.ExpandTrigger here so that it follows the last visible tag.
Type
| ReactElement
| ((
props: object,
) => ReactElement)
Description
Allows you to replace the component's HTML element with a different tag or component. Learn more

TableFilterBar.ExpandTrigger

Shows or hides the applied filters that don't fit on one row. Render it within the TableFilterBar.FilterList so that it follows the last visible filter. Hidden while every applied filter fits. Renders a <button> element by default.
PropTypeDefault
v1.32.0
A 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.
The trigger's content. Pass a function to render different content for each state. hiddenCount is the number of applied filters hidden while collapsed.
| string
| number
| bigint
| ReactElement
| Iterable<ReactNode>
| ReactPortal
| Promise<AwaitedReactNode>
| ((props: {
expanded: boolean
hiddenCount: number
}) => ReactNode)
| boolean
| null
| undefined
({expanded, hiddenCount}) => (expanded ? "Show less" : `+${hiddenCount} more`)
The density of the button. Governs padding and height.
| 'default'
| 'compact'
'default'
Controls whether the component is interactive. When true, pointer/focus events are blocked, and the component is visually dimmed.
boolean
false
The style variant of the button. Governs colors.
| 'neutral'
| 'primary'
| 'danger'
| 'persistent-white'
| 'persistent-black'
| 'inverse'
| 'white-persistent'
| 'black-persistent'
'neutral'
Icon positioned after the text content. If supplied as a LucideIcon, the size will automatically match the size prop. Supply as a ReactElement for additional customization.
| LucideIcon
| ReactElement
| null
Allows you to replace the component's HTML element with a different tag or component. Learn more
| ReactElement
| ((
props: object,
) => ReactElement)
The size of the component and its icons.
| 'sm'
| 'md'
| 'lg'
'md'
Icon positioned before the text content. If supplied as a LucideIcon, the size will automatically match the size prop. Supply as a ReactElement for additional customization.
| LucideIcon
| ReactElement
| null
The style variant of the button. Governs colors.
| 'fill'
| 'ghost'
| 'outline'
'fill'
v1.32.0
Description
A 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.
Type
| string
| number
| bigint
| ReactElement
| Iterable<ReactNode>
| ReactPortal
| Promise<AwaitedReactNode>
| ((props: {
expanded: boolean
hiddenCount: number
}) => ReactNode)
| boolean
| null
| undefined
Description
The trigger's content. Pass a function to render different content for each state. hiddenCount is the number of applied filters hidden while collapsed.
Type
| 'default'
| 'compact'
Description
The density of the button. Governs padding and height.
Type
boolean
Description
Controls whether the component is interactive. When true, pointer/focus events are blocked, and the component is visually dimmed.
Type
| 'neutral'
| 'primary'
| 'danger'
| 'persistent-white'
| 'persistent-black'
| 'inverse'
| 'white-persistent'
| 'black-persistent'
Description
The style variant of the button. Governs colors.
Type
| LucideIcon
| ReactElement
| null
Description
Icon positioned after the text content. If supplied as a LucideIcon, the size will automatically match the size prop. Supply as a ReactElement for additional customization.
Type
| ReactElement
| ((
props: object,
) => ReactElement)
Description
Allows you to replace the component's HTML element with a different tag or component. Learn more
Type
| 'sm'
| 'md'
| 'lg'
Description
The size of the component and its icons.
Type
| LucideIcon
| ReactElement
| null
Description
Icon positioned before the text content. If supplied as a LucideIcon, the size will automatically match the size prop. Supply as a ReactElement for additional customization.
Type
| 'fill'
| 'ghost'
| 'outline'
Description
The style variant of the button. Governs colors.

TableFilterBar.ClearTrigger

Removes every applied filter when clicked. Renders a <button> element by default.
PropTypeDefault
v1.32.0
A 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.
The density of the button. Governs padding and height.
| 'default'
| 'compact'
'default'
Controls whether the component is interactive. When true, pointer/focus events are blocked, and the component is visually dimmed.
boolean
false
The style variant of the button. Governs colors.
| 'neutral'
| 'primary'
| 'danger'
| 'persistent-white'
| 'persistent-black'
| 'inverse'
| 'white-persistent'
| 'black-persistent'
'neutral'
Icon positioned after the text content. If supplied as a LucideIcon, the size will automatically match the size prop. Supply as a ReactElement for additional customization.
| LucideIcon
| ReactElement
| null
Allows you to replace the component's HTML element with a different tag or component. Learn more
| ReactElement
| ((
props: object,
) => ReactElement)
The size of the component and its icons.
| 'sm'
| 'md'
| 'lg'
'md'
Icon positioned before the text content. If supplied as a LucideIcon, the size will automatically match the size prop. Supply as a ReactElement for additional customization.
| LucideIcon
| ReactElement
| null
The style variant of the button. Governs colors.
| 'fill'
| 'ghost'
| 'outline'
'fill'
v1.32.0
Description
A 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.
Type
| 'default'
| 'compact'
Description
The density of the button. Governs padding and height.
Type
boolean
Description
Controls whether the component is interactive. When true, pointer/focus events are blocked, and the component is visually dimmed.
Type
| 'neutral'
| 'primary'
| 'danger'
| 'persistent-white'
| 'persistent-black'
| 'inverse'
| 'white-persistent'
| 'black-persistent'
Description
The style variant of the button. Governs colors.
Type
| LucideIcon
| ReactElement
| null
Description
Icon positioned after the text content. If supplied as a LucideIcon, the size will automatically match the size prop. Supply as a ReactElement for additional customization.
Type
| ReactElement
| ((
props: object,
) => ReactElement)
Description
Allows you to replace the component's HTML element with a different tag or component. Learn more
Type
| 'sm'
| 'md'
| 'lg'
Description
The size of the component and its icons.
Type
| LucideIcon
| ReactElement
| null
Description
Icon positioned before the text content. If supplied as a LucideIcon, the size will automatically match the size prop. Supply as a ReactElement for additional customization.
Type
| 'fill'
| 'ghost'
| 'outline'
Description
The style variant of the button. Governs colors.
Updated by Ryan Bower