Components Actions
Chip
StableA selectable toggle chip for quick filters and choices.
Use Chip for lightweight on/off choices, such as quick filters above a list. Each chip is a toggle button that reports its state with aria-pressed. For filters with a value to edit, use FilterChip; for removable labels, use Tag.
Overview
import { Chip } from '@bindshq/stance-react';
export function Basic() {
return (
<div role="group" aria-label="Contract status" style={{ display: 'flex', gap: 8 }}>
<Chip defaultSelected>Signed</Chip>
<Chip>Awaiting signature</Chip>
<Chip>Expired</Chip>
</div>
);
}Light, dark and high contrast
Every Stance component is designed and tested in all three appearance modes.
Import
import { Chip } from '@bindshq/stance-react';Platforms
Chip has native counterparts. They share Stance tokens and intent, and use each platform’s own controls and conventions. The live previews on this page are the web implementation.
import { Chip } from '@bindshq/stance-react';Playground
<Chip>Signed</Chip>Examples
Quick filters
A controlled set of chips filtering a list.
Showing: Sales
import * as React from 'react';
import { Chip } from '@bindshq/stance-react';
export function QuickFilters() {
const all = ['Sales', 'Legal', 'Support', 'Engineering'];
const [active, setActive] = React.useState<string[]>(['Sales']);
return (
<div style={{ display: 'grid', gap: 12 }}>
<div
role="group"
aria-label="Departments"
style={{ display: 'flex', flexWrap: 'wrap', gap: 8 }}
>
{all.map((d) => (
<Chip
key={d}
selected={active.includes(d)}
onSelectedChange={(on) => setActive((a) => (on ? [...a, d] : a.filter((x) => x !== d)))}
>
{d}
</Chip>
))}
</div>
<p style={{ margin: 0, fontSize: 14 }}>
Showing: {active.length ? active.join(', ') : 'all departments'}
</p>
</div>
);
}import { Chip, Icon } from '@bindshq/stance-react';
export function Sizes() {
return (
<div style={{ display: 'flex', flexWrap: 'wrap', alignItems: 'center', gap: 8 }}>
<Chip size="sm" icon={<Icon name="clock" size={12} />}>
Recent
</Chip>
<Chip icon={<Icon name="star" size={14} />}>Favourites</Chip>
<Chip disabled>Archived</Chip>
</div>
);
}API reference
| Prop | Type | Default | Description |
|---|---|---|---|
selected | boolean | None | Controlled selected state. |
defaultSelected | boolean | false | Initial state when uncontrolled. |
onSelectedChange | (selected: boolean) => void | None | Called when toggled. |
icon | ReactNode | None | Leading icon; replaced by a check mark while selected. |
size | 'sm' | 'md' | 'md' | Height 26 or 32px. |
...props | ButtonHTMLAttributes | None | Native button attributes. |
Accessibility
- Renders a native button with aria-pressed, announced as a toggle button.
- Selection is shown by fill, a check mark and aria-pressed, not by colour alone.
- Group related chips with role="group" and an aria-label.
Keyboard
| Keys | Action |
|---|---|
| Enter Space | Toggles the chip. |
Usage guidelines
Do
- Use short, parallel labels.
- Label the group, e.g. "Status filters".
Don’t
- Use chips for mutually exclusive choices; use RadioGroup or ToggleButton.