Use Chip for interactive filter and on/off choices.
Chip
Interactive compact control for toggles and filter selections.
- .source-chip Root button element
- aria-pressed Toggle state
- data-selected Visual selected state
States
Default
Selected
Disabled
Selected + disabled
StateBehavior
DefaultNeutral surface, secondary text. Communicates an available but unactivated filter.
HoverLight palette tint on background and border. Signals interactivity.
SelectedPalette fill,
aria-pressed="true". Communicates an active filter or active toggle.Focus2px outline in palette color. Keyboard only.
Disabled55% opacity,
cursor: not-allowed. Preserves layout without interactive affordance.Design intent
Chip is the interactive counterpart of Tag. Where Tag labels static taxonomy, Chip acts: it can be toggled, applied as a filter, or used in multi-select groups. Keep chips short and give each group enough context so the selection state is immediately apparent.
Semantic palettes
Categorical palettes
Use these when the selected color identifies a category rather than a status. Useful for filter groups where each chip maps to a distinct topic or type.
When to use
Do
Keep each chip label specific and compact.
Reflect state with selected and visible pressed styling.
Don't
Do not use Chip for non-interactive categories. Use Tag.
Do not use Chip as a status badge. Use Badge.
Designer checklist
- Selected state is conveyed by more than color alone (border weight, shape, or icon change).
- Chips in a filter group do not overflow horizontally on small screens without a scroll affordance.
- Each chip label fits on one line at the intended size.
Props
PropTypeDefaultDescription
childrenReactNoderequiredChip label.
selectedbooleanfalseSets `aria-pressed` and selected visuals.
disabledbooleanfalseDisables interaction.
palette`neutral \| accent \| success \| warning \| danger \| info \| blue \| green \| red \| orange \| yellow \| pink \| purple \| teal`neutralSelected-state color — semantic or categorical.
tonesame as `palette`nullDeprecated alias kept for backward compatibility.
leadingIconReactNodenullOptional icon before label.
trailingIconReactNodenullOptional icon after label.
onClickMouseEventHandler<HTMLButtonElement>nullClick handler.
classNamestringnullExtra class on root.
Usage
import { Chip } from '@pierredelattre/source-react';
function Filters({ activeOnly, setActiveOnly }) {
return (
<Chip selected={activeOnly} onClick={() => setActiveOnly(!activeOnly)}>
Active only
</Chip>
);
}
Component tokens
TokenDefault
--chip-bg--color-surface
--chip-bg-hover--color-surface-raised
--chip-bg-selected--color-surface-raised
--chip-color--color-text-secondary
--chip-color-selected--color-text
--chip-border-color--color-border
--chip-border-color-hover--color-border-strong
--chip-border-color-selected--color-border-strong
--chip-padding-x0.625rem
--chip-padding-y0.3125rem
--chip-font-size--text-sm
--chip-radius--radius-full
--chip-icon-size0.875rem
Accessibility
AspectBehavior
RoleRendered as a native
<button type="button">.Toggle stateExposed with
aria-pressed when selected.KeyboardSpace/Enter trigger clicks by default button behavior.