Chip
Chip presents one compact authored or selected value with an optional, explicitly named remove action. It does not replace Badge, Button, Toggle, Link, or a future token-entry collection.
Built from the published package
Know when Chip is the right part
Use it when
Use Chip for values already present in application state: an assignee, recipient, selected category, or applied filter value. Include RemoveTrigger only when the surrounding application can remove that value and deliberately handle focus afterward.
Choose another path when
Use Badge for passive status/category metadata, Button for a momentary action, Toggle or ToggleGroup for selectable filters, Link for navigation, and NotificationBadge for an attached count/dot. “Tag” is usage terminology, not a Brick export. Editable tag entry, token navigation, automatic focus recovery, and arbitrary creation require a future Atom-backed parent component.
Installation and imports
The complete stylesheet above is the recommended default. For a measured route-aware build, replace it with the shared foundation and this component's stylesheet:
Add the modular stylesheet for every other Brick component the route renders.
Do not combine modular styles with styles.css or tokens.css.
Quick start
Visual recipes and states
Soft supplies a quiet surface; outline supplies a transparent bordered token. Neutral and accent express identity emphasis, not status. Sizes coordinate 28/32/36px-class roots while preserving a minimum 24px remove target. Shape changes corners only. Hover, active, focus-visible, and disabled styling affect RemoveTrigger paint without changing token geometry.
Examples
API
Start with the public parts and root options below. Components with multiple parts separate each area into its own named subsection.
ChipRoot and ChipRootProps
| Prop | Values | Default |
|---|---|---|
variant | soft, outline | soft |
tone | neutral, accent | neutral |
size | sm, md, lg | md |
shape | rounded, pill | pill |
Root preserves Atom Badge native span props, asChild, render, class,
style, slot, and ref. color is omitted because tone owns visual color.
ChipRoot is also available through Chip.Root. ChipLabel and its
ChipLabelProps accept native span props and ref. ChipRemoveTrigger and its
ChipRemoveTriggerProps require
ariaLabel: string and preserves Atom Button disabled, onPress, button
props, composition, class, style, slot, and ref. href and loading are not
supported. Chip adds no value state, selected state, automatic removal, link,
form behavior, or generated accessible copy.
The public recipe types are ChipVariant, ChipTone, ChipSize, and
ChipShape. ChipLabel is available as Chip.Label, and
ChipRemoveTrigger is available as Chip.RemoveTrigger.
Accessibility
Root adds no role, tab stop, selection state, or announcement. Every RemoveTrigger needs a localized accessible name containing the visible value, for example “Remove Riley Chen.” Atom owns Enter/Space activation and disabled behavior; Brick owns focus visibility, contrast, target geometry, zoom, forced-color, and RTL paint.
onPress only requests removal. The parent owns state mutation, any needed
announcement, and the next focus destination if the focused trigger disappears.
Standalone Chip does not promise Backspace/Delete token removal, group
navigation, form submission, or editable-field semantics.
Responsive behavior
One Chip is inline-flex, max-inline-size 100%, and truncates a one-line Label without displacing leading content or RemoveTrigger. Surrounding layout owns wrapping between Chips. Logical padding and child order work in RTL. Consumers must not hide the only removal action at narrow widths.
Styling and tokens
Customization
Prefer component recipes, then semantic tokens and the documented
--brick-chip-* properties. Author Icon or Avatar before Label. Use className
and style only as final escape hatches, preserving the passive Root and actual
button semantics.
Tokens and CSS hooks
Stable classes are .brick-chip, .brick-chip__label, and
.brick-chip__remove-trigger. Stable slots are badge on Root,
chip-label, and chip-remove-trigger. Root exposes data-variant,
data-tone, data-size, and data-shape; RemoveTrigger exposes Atom
data-disabled when applicable. Every part exposes its stable data-slot.
Public component properties:
--brick-chip-background,--brick-chip-foreground,--brick-chip-border-color,--brick-chip-radius;--brick-chip-min-block-size,--brick-chip-padding-inline-start,--brick-chip-padding-inline-end,--brick-chip-gap,--brick-chip-font-size,--brick-chip-leading-size;--brick-chip-remove-size,--brick-chip-remove-foreground,--brick-chip-remove-background,--brick-chip-remove-hover-background, and--brick-chip-remove-active-background.
Advanced reference
Open these details only when you need to inspect DOM ownership, native forwarding, or lower-level composition.