On this page

InstallationAnatomyThree partsOne partA status's dotAvatarsAn icon markNo markA condition that cannot changeA long valueIn the dashboardAccessibilityAPI ReferenceFilterChipMarksTokensRulesWritten down

Filter chip

One applied filter on a list: what is filtered, how, and by which value, with an x to remove it.

Status
1<FilterChip2  label="Status"3  icon={Pulse}4  condition="is"5  value="Suspended"6  marks={[{ status: "warning" }]}7  onConditionClick={openConditions}8  onValueClick={openValues}9  onRemove={remove}10/>

Installation

import { FilterChip } from "@catalog-developer/components";

A page does not draw each chip: it places FilterChips, which draws one chip per filter that is on, then + and Clear. See the Table's page. FilterChip is the chip alone, by what it draws.

Anatomy

Status
1234
  1. 1 — Label. What is filtered, with its icon. It does nothing, and is set a step quieter than the rest.
  2. 2 — Condition. How: "is", "is any of", "contains". A button when it can change.
  3. 3 — Value. By which value, after its marks. A button, and the one part whose words are cut when they are too long.
  4. 4 — x. Removes the filter.

Three parts

What is filtered, how, and by which value, then the x. The label does nothing. The condition and the value are buttons: a list's filters open a menu from each. A chip is 24px tall, with 12px type and 12px icons.

Status
1<FilterChip2  label="Status"3  icon={Pulse}4  condition="is"5  value="Suspended"6  marks={[{ status: "warning" }]}7  onConditionClick={openConditions}8  onValueClick={openValues}9  onRemove={remove}10/>

One part

parts={1} is the value and the x, for a filter that is on or off: there is no other value to pick, so nothing opens. Its label is not drawn; it still names the chip and its x.

Violations only
1<FilterChip2  parts={1}3  label="Show violations"4  value="Violations only"5  marks={[{ icon: ExclamationCircleFill, color: "warning" }]}6  onRemove={remove}7/>

A status's dot

A status mark is the Status dot in a Badge color, in a small tint of that color. A filter that holds several values says their count ("3 statuses") after their dots; in a list's row, the names are in the value's tooltip.

Status
Status
1<span className="flex flex-wrap items-center justify-center gap-3">2  <FilterChip label="Status" icon={Pulse} condition="is" value="Active" marks={[{ status: "success" }]} onConditionClick={openConditions} onValueClick={openValues} onRemove={remove} />3  <FilterChip4    label="Status"5    icon={Pulse}6    condition="is any of"7    value="3 statuses"8    marks={[{ status: "success" }, { status: "warning" }, { status: "error" }]}9    onConditionClick={openConditions}10    onValueClick={openValues}11    onRemove={remove}12  />13</span>

Avatars

An avatar mark is a face the page hands in, an AvatarFace. The AvatarGroup draws them, at its 16px size: each over the one before it, the one behind cut around the next (it keeps 11 of its 16px) with its edge following the cut. The chip does nothing of its own to them: it hands every avatar to the group, which behaves as it does everywhere. By default that is three avatars, then the group's count for the rest ("+1"). avatarGroup hands the group its own max, size and tooltip. 16px and 20px fit the 24px chip (4px and 2px above and below); at 24px an avatar touches the chip's edge, and a larger one sticks out of it.

Owner
Owner
1<span className="flex flex-wrap items-center justify-center gap-3">2  <FilterChip label="Owner" icon={Building} condition="is" value="Maya Okafor" marks={[{ avatar: <AvatarFace name="Maya Okafor" /> }]} onConditionClick={openConditions} onValueClick={openValues} onRemove={remove} />3  <FilterChip4    label="Owner"5    icon={Building}6    condition="is any of"7    value="4 owners"8    marks={[9      { avatar: <AvatarFace name="Maya Okafor" /> },10      { avatar: <AvatarFace name="Jonas Weber" /> },11      { avatar: <AvatarFace name="Priya Raman" /> },12      { avatar: <AvatarFace name="Lucas Ferreira" /> },13    ]}14    onConditionClick={openConditions}15    onValueClick={openValues}16    onRemove={remove}17  />18</span>

An icon mark

An icon mark is 12px: gray like the chip's other icons, or in an intent's text color with a color. The chip itself stays neutral: only the value's mark takes a color.

Type
Violations only
1<span className="flex flex-wrap items-center justify-center gap-3">2  <FilterChip label="Type" icon={ShapesSquareCircle} condition="is" value="Managed" marks={[{ icon: ShapesSquareCircle }]} onConditionClick={openConditions} onValueClick={openValues} onRemove={remove} />3  <FilterChip parts={1} label="Show violations" value="Violations only" marks={[{ icon: ExclamationCircleFill, color: "warning" }]} onRemove={remove} />4</span>

No mark

A text, a number or a date has no mark: the value is its words.

Name
Created
1<span className="flex flex-wrap items-center justify-center gap-3">2  <FilterChip label="Name" icon={TextAa} condition="contains" value="“billing”" onConditionClick={openConditions} onValueClick={openValues} onRemove={remove} />3  <FilterChip label="Created" icon={Calendar} condition="after" value="1 week ago" onConditionClick={openConditions} onValueClick={openValues} onRemove={remove} />4</span>

A condition that cannot change

Without onConditionClick the condition is text, set like the label, and nothing opens from it. A filter that has one condition says it this way. With no condition at all, a chip draws no middle part.

Type
is
1<FilterChip label="Type" icon={ShapesSquareCircle} condition="is" value="Managed" onValueClick={openValues} onRemove={remove} />

A long value

A chip is 320px at most, and its value's words 200px. The value is what gives way: it is cut with an ellipsis and says itself whole in a tooltip. The label and the condition are never cut: if they need more than 320px by themselves, they keep their room. Alone, a chip keeps its full width; in a list's row it gives up its value's width first, down to 24px, before the row wraps.

Name
1<FilterChip2  label="Name"3  icon={TextAa}4  condition="does not contain"5  value="“compliance-evidence-collector-production-eu-west”"6  onConditionClick={openConditions}7  onValueClick={openValues}8  onRemove={remove}9/>

In the dashboard

Where the dashboard shows a Filter chip today: under the toolbar of the two lists on the design system's Table. No screen's filter has avatars yet. The other filtered lists still draw older chips of their own: Audit and Rules (components/shared/filters.tsx), and Callers and the Guards' filters (components/reui/filters).

Type
is
Status

The Agents list's filters

Under the list's toolbar, one chip per filter that is on: Status, Created, Last active, and Type where managed agents are on. The Filters draw them from the list's fields; they give the value its menu, and the condition one where the field has more than one.

components/agents/agent-table.tsx, ds/components/filters.tsx (FilterChips)

Violations only

An on/off filter

The Agents list's Show violations is a switch in the Filter menu. On, its chip is one part: “Violations only”, with the filled “!” in the warning text color.

components/agents/agent-table.tsx

Last active

The Devices list's filters

Status, Created and Last active: the Agents list's fields without Type and Show violations.

app/(authenticated)/[kind]/[scopeId]/devices/page.tsx

Accessibility

A chip is a group named by its label ("Status filter"). In a chip of three parts the keyboard stops on the condition (when it is a button), the value and the x, in that order; the label is text. Their names say what they are: "Condition: is", "Value: Suspended", "Remove the Status filter".

In a chip of one part the keyboard stops on the x alone, and on the value too when it is cut, so the keyboard reaches its tooltip. The label is not drawn, and still names the group and the x ("Remove the Show violations filter").

The marks are hidden from a screen reader. For one value, the words say what its mark shows; for several, the words give their count only ("3 statuses"). A value that is cut says itself whole in a tooltip, under the pointer and on keyboard focus.

API Reference

FilterChip

Besides these, the props of a <div>, except children.

PropTypeDefaultDescription
parts1 | 333: label, condition, value. 1: the value alone, with its marks. Both end with the x.
labelstring—Required. What is filtered. A one-part chip does not draw it, and is still named by it.
iconIconComponent—The label's icon, before it. Not drawn in a one-part chip.
conditionstring—The middle part's words: "is", "is any of", "contains". Without it there is no middle part.
valuestring—Required. The last part's words.
marksreadonly FilterChipMark[]—What stands before the value's words. Three dots or icons are drawn at most; avatars all go to the Avatar group, which draws three and counts the rest.
avatarGroupPick<AvatarGroupProps, "max" | "size" | "tooltip">—For marks that are avatars: the Avatar group's own settings, handed on as they are. max is how many are drawn before the group's count ("+2"): 3 unless set, the group's own default. size is the group's size (xxxs, 16px, unless set; 16 and 20px fit the chip). tooltip is each avatar's name on hover (off).
onConditionClick() => void—With it the condition is a button. Without, it is text and does nothing.
onValueClick() => void—The value's press, in a chip of three parts.
onRemove() => void—The x's press. The x is always drawn.

Marks

What stands before the value's words. Each mark is one of three kinds.

PropTypeDefaultDescription
statusBadgeColor—A status's dot in that Badge color.
dotOmit<StatusDotSpec, "color">—Beside status: the Status dot's own settings (its size, its halo, its pulse).
avatarReactNode—A face the page draws. It fills the 16px round box it is given.
iconIconComponent—An icon at 12px, gray.
colorBadgeColor—Beside icon: sets it in that intent's text color.

Tokens

In ds/tokens/filters.css. The chip is a secondary Button group at xs (24px), so the rest of its look is the Button group's.

TokenValueWhat it sets
--filter-chip-field-foreground-textgray-1400 — dark gray-1200The label and its icon, and a condition that is text: a step under the secondary text.
--filter-chip-part-foreground-text--neutral-fg-secondaryThe condition, the value and the x at rest.
--filter-chip-part-hover-foreground-text--neutral-fgThe same three under the pointer and while their menu is open. A one-part chip's value is always in it.
--filter-chip-shadowa 1px ring — dark the secondary button's shadowThe chip's edge: flat in light, the secondary button's whole edge in dark.
--filter-value-{color}-foreground-icon--{color}-fg-secondary — fuchsia --badge-fuchsia-dotAn icon mark with a color: that intent's text color.
--filter-chip-halo-{color}the Badge's tint — dark lighter for fourThe tint around a status's dot.

Rules

Written down

The chip stays neutral; a value carries its own color

A value's mark is in its own color, in the value's part of the chip. The chip itself is never colored.

From ds/README.md (Filters).

A mark is a status's dot, an avatar or an icon, three at most

More than three is said by the value's words ("4 owners"). A status is drawn by the Status dot, as the Table's statuses are.

From ds/components/filter-chip.tsx and ds/README.md (Filters).

The label does nothing, so it is quieter

The label is a step under the secondary text. The condition, the value and the x, which open or act, are in the secondary text, and in the full text color under the pointer and while open.

From ds/tokens/filters.css and ds/README.md (Filters).

The value is what gives way

A chip is 320px at most and its value's words 200px. The value is cut with an ellipsis and whole in a tooltip; the label and the condition are never cut.

From ds/components/filter-chip.tsx and ds/README.md (Filters).

An on/off filter is one part

Its value and the x, with no condition and nothing to open. Its row in the Filter menu says what to do ("Show violations") and its chip what is done ("Violations only"): two strings.

From ds/README.md (Filters).

No empty chip

A chip is there once its filter holds a value. Emptied from the Filter menu it goes at once; emptied from its own menu it stays until that menu closes.

From ds/README.md (Filters).

Flat in light, the button's edge in dark

In light a chip has the secondary button's 1px ring and no drop under it. In dark it has the secondary button's whole edge.

From ds/tokens/filters.css.

A chip's people are the Avatar group

A chip's avatars are the AvatarGroup, at 16px unless the page says another size. The overlap, the cut and the edge along the cut are the group's own, and so are its max of three and the count after them: the chip never cuts, hides or counts an avatar itself.

From ds/components/filter-chip.tsx.

Catalog
Foundations
  • Overview
  • Components
  • Tokens
  • Token usage
  • Typography
  • Icons
Atoms
  • Avatar
  • Badge
  • Button
  • Checkbox
  • Color picker
  • Copy button
  • Icon tooltip
  • Inline code
  • Input
  • Hint
  • Kbd
  • Loader
  • Native select
  • Progress bar
  • Progress ring
  • Radio
  • Select
  • Status dot
  • Switch
  • Text link
  • Textarea
  • Tooltip
  • Truncate
Molecules
  • Accordion
  • Activity chart
  • AI elements
  • Alert
  • Button group
  • Card
  • Code block
  • Combobox trigger
  • Command
  • Content table
  • Context switcher
  • Dropdown menu
  • Empty state
  • Field
  • Field group
  • Filter chip
  • Flow
  • Heading
  • Icon picker
  • Icon flow card
  • Metric card
  • Modal
  • Modal confirmation
  • Pagination
  • Popover
  • Scroll area
  • Sidebar
  • Table
  • Tabs
  • Toggle group
LibraryPublished release