Filter Chip
- Needs review
- WCAG 2.2 evidence
- RTL
A compact filter control. By default a React Aria ToggleButton: aria-pressed, Space and Enter toggle,
the selected chip shows a check icon and a tinted fill (WCAG 1.4.1, 2.1.1, 4.1.2). With hasDropdown it is a menu button that
opens the library's Menu (arrow keys, type-ahead, Escape returns focus; selection with selectionMode), shows a chevron,
and states in its name when a value is chosen. Keyboard focus shows the shared ring (2.4.7); the 32 px chip with its label is
the whole target (2.5.8). Group several chips with a label: role="group" with aria-label, or React Aria Toolbar (arrow keys between chips) or
ToggleButtonGroup (give each toggle chip an id). Consumer duties: group label and chip wording; announcing how many results a filter change leaves (for example with
announceStatus, WCAG 4.1.3).
import { FilterChip } from "@nexera-ui/react";- 4
- examples
- 34
- props
- 6
- live controls
- 1
- platform
- 7
- WCAG criteria
- 2
- blocks use it
Try every prop. Copy the code.
Change the props and the code updates. Check light and dark, LTR and RTL, and phone width.
import { FilterChip } from "@nexera-ui/react";
<FilterChip />Examples 3
The same examples as Storybook, rendered live. Open Code to copy one.
Dropdown
Figma Dropdown=Yes: the chip opens the library's Menu; a chosen value marks it selected.
import { FilterChip, MenuItem } from "@nexera-ui/react";
export function Dropdown() {
return (
<FilterChip label="Department" hasDropdown selectionMode="multiple">
<MenuItem id="eng" label="Engineering" />
<MenuItem id="design" label="Design" />
<MenuItem id="people" label="People" />
<MenuItem id="finance" label="Finance" />
</FilterChip>
);
}
Filter bar
A filter bar: a labelled React Aria Toolbar (Tab enters once, arrow keys move between chips), toggle chips and a dropdown chip whose label shows the chosen values. Chips wrap onto new lines in narrow containers.
import { useState } from "react";
import { Toolbar, type Selection } from "react-aria-components";
import { FilterChip, MenuItem } from "@nexera-ui/react";
export function FilterBar() {
const [departments, setDepartments] = useState<Selection>(new Set(["eng"]));
const count = departments === "all" ? 4 : departments.size;
return (
<Toolbar aria-label="Filters" className="flex flex-wrap gap-2">
<FilterChip label="Remote" defaultSelected />
<FilterChip label="Full time" />
<FilterChip label="Contract" isDisabled />
<FilterChip
label={count > 0 ? `Department: ${String(count)}` : "Department"}
hasDropdown
selectionMode="multiple"
selectedKeys={departments}
onSelectionChange={setDepartments}
>
<MenuItem id="eng" label="Engineering" />
<MenuItem id="design" label="Design" />
<MenuItem id="people" label="People" />
<MenuItem id="finance" label="Finance" />
</FilterChip>
</Toolbar>
);
}
Long label and right to left
Long labels wrap inside the chip (it grows from 32 px); right-to-left layouts mirror padding and icons.
import { FilterChip, MenuItem } from "@nexera-ui/react";
export function LongLabelAndRightToLeft() {
return (
<div className="flex max-w-xs flex-col items-start gap-4">
<FilterChip label="Employees on extended parental or medical leave" defaultSelected />
<div dir="rtl" lang="ar" className="flex flex-wrap gap-2">
<FilterChip label="عن بعد" defaultSelected />
<FilterChip
label="القسم"
hasDropdown
selectionMode="single"
selectedLabel="تم تطبيق عامل التصفية"
>
<MenuItem id="eng" label="الهندسة" />
</FilterChip>
</div>
</div>
);
}
Props 34
Press "Try it" on a card to load that prop into the playground.
34 props shown
hasDropdownNexerabooleanOpens a menu of options instead of toggling. Opens a menu of options instead of toggling.
childrenNexeraReactNodeOnly for a dropdown chip.
The options: MenuItem elements (and MenuDivider, MenuSection).
label*NexeraVisibleContentVisible label, for example "Remote" or "Department". It is the accessible name; it wraps instead of truncating. On a dropdown chip, consider showing the chosen value ("Department: Engineering").
classNameNexerastringExtra classes, merged last so they win over the defaults.
styleNexeraCSSPropertiesInline style.
selectedLabelNexerastringText added to the accessible name while the chip is selected, because a menu button has no selected state of its own ("Department (filter applied)"). Visually hidden. Translate it.
isOpenNexerabooleanWhether the menu is open (controlled). Use with onOpenChange.
defaultOpenNexerabooleanWhether the menu is open on first render (uncontrolled).
onOpenChangeNexera(isOpen: boolean) => voidCalled when the menu opens or closes.
placementNexera"bottom" | "bottom left" | "bottom right" | "bottom start" | "bottom end" | "top" | "top left" | "top right" | "top start" | "top end" | "left" | "left top" | "left bottom" | "start" | "start top" | "start bottom" | "right" | "right top" | "right bottom" | "end" | "end top" | "end bottom"Where the menu opens relative to its trigger. It flips to stay inside the viewport. Submenus default to
"end top", which mirrors in right-to-left layouts.
idReact AriaKeyWhen used in a ToggleButtonGroup, an identifier for the item in selectedKeys. When used
standalone, a DOM id.
The element's unique identifier. See
[MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id).
aria-labelReact AriastringDefines a string value that labels the current element.
aria-labelledbyReact AriastringIdentifies the element (or elements) that labels the current element.
aria-describedbyReact AriastringIdentifies the element (or elements) that describes the object.
isSelectedReact AriabooleanWhether the element should be selected (controlled).
Shows the chip as Selected: a value is chosen. Defaults to whether the menu has a selection
(selectedKeys / defaultSelectedKeys).
defaultSelectedReact AriabooleanWhether the element should be selected (uncontrolled).
onChangeReact Aria(isSelected: boolean) => voidHandler that is called when the element's selection state changes.
isDisabledReact AriabooleanWhether the button is disabled.
onPressReact Aria(e: PressEvent) => voidHandler that is called when the press is released over the target.
onPressStartReact Aria(e: PressEvent) => voidHandler that is called when a press interaction starts.
onPressEndReact Aria(e: PressEvent) => voidHandler that is called when a press interaction ends, either over the target or when the pointer leaves the target.
onPressChangeReact Aria(isPressed: boolean) => voidHandler that is called when the press state changes.
onPressUpReact Aria(e: PressEvent) => voidHandler that is called when a press is released over the target, regardless of whether it started on the target or not.
autoFocusReact AriabooleanWhether the element should receive focus on render.
formReact AriastringThe <form> element to associate the button with.
The value of this attribute must be the id of a <form> in the same document.
See [MDN](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/button#form).
nameReact AriastringSubmitted as a pair with the button's value as part of the form data.
valueReact AriastringThe value associated with the button's name when it's submitted with the form data.
typeReact Aria"button" | "submit" | "reset"The behavior of the button when used in an HTML form.
selectionModeReact Aria"none" | "single" | "multiple"The type of selection that is allowed in the collection.
selectedKeysReact Aria"all" | Iterable<Key>The currently selected keys in the collection (controlled).
defaultSelectedKeysReact Aria"all" | Iterable<Key>The initial selected keys in the collection (uncontrolled).
onSelectionChangeReact Aria(keys: Selection) => voidHandler that is called when the selection changes.
disallowEmptySelectionReact AriabooleanWhether the collection allows empty selection.
onActionReact Aria(key: Key, value: object) => voidHandler that is called when an item is selected.
* Required. React Aria props shown are the ones most apps use; the component accepts the rest of its React Aria props too.
Accessible by default.
Built on React Aria, and covered by the WCAG 2.2 evidence generated on every build.
WCAG 2.2 evidence
5 direct · 2 supporting- 1.3.1Info and RelationshipsLevel A · tested directly
- 1.4.1Use of ColorLevel A · tested directly
- 1.4.12Text SpacingLevel AA · supporting test
- 2.1.1KeyboardLevel A · tested directly
- 2.4.7Focus VisibleLevel AA · tested directly
- 2.5.8Target Size (Minimum)Level AA · supporting test
- 4.1.2Name, Role, ValueLevel A · tested directly
Fits any width.
Nexera components respond to the space they are given. Drag the corner of the frame, or pick a width.
Styling hooks
Pass className to add Tailwind classes (merged last). State is exposed as data attributes, so you can style it with variants like data-pressed:.
data-disableddata-hovereddata-presseddata-selected
<FilterChip className="data-disabled:opacity-90 shadow-sm" />Used in blocks
Related components
- CalendarDayOne day of a {@link CalendarMonth } grid, built on React Aria `CalendarCell`: a `gridcell` whose button is named by the full, localised date ("Wednesday, October 14, 2026"), with `aria-selected`, `aria-disabled` and the "today" and range descriptions read by screen readers (WCAG 1.3.1, 4.1.2).
- CalendarMonthA month calendar for picking a date or a date range: header with previous / next buttons and the localised month name, weekday row, and six weeks of `CalendarDay`s.
- CheckboxThe bare 18 px checkbox: one independent yes/no choice applied on submit, or a row selector in a table, list or tree.
- CheckboxCardA large checkbox option with an icon, a title and a description, for a few options that need explanation (notification channels, benefits).
- CheckboxFieldA checkbox with a label and optional helper text: the box (the same element as `Checkbox`) followed by the label and description, applied on submit.
- ColorInputA hex colour field with a swatch and a picker popover.
- ColorPickerPicks a colour.
- ColorTokenCardDocumentation card for one colour token: a 96 px colour sample with an "Aa" text sample, then the name, token path, hex value and contrast note as text.