<span class="kw-chip is-selected"><button type="button" aria-pressed="true">Drafting</button></span>
<span class="kw-chip"><button type="button" aria-pressed="false">Feature film</button></span>
<span class="kw-chip is-selected"><button type="button">Act 2</button><button type="button" class="kw-chip__x" aria-label="Remove filter Act 2"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M18 6 6 18M6 6l12 12"/></svg></button></span>
<button class="kw-chip kw-chip--add" type="button"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true"><path d="M12 5v14M5 12h14"/></svg> Add a name</button>
When to use
To narrow a list by a few known values: Day / Night, a character, a location. A selected chip is lit, not filled: its border takes the project’s light accent and its ground steps up (Home’s filters, the date editor’s Kind and Who it is for).
When not to
Anatomy
- Pill: 32px (44 under a thumb), 1px
--k-line, 999px corners, no fill (.k-chip). - Word: Poppins 500, 12px,
--k-text-2; 0 12px padding on the inner button. - Selected: border
--k-accent-soft, ground--k-raise, text--k-text. It is lit, not filled. - Remove ×: a separate 32px button (44 on a phone) named Remove filter Act 2.
- Add: dashed border, 12px 400, 4px 8px padding (Project home’s Add a name under Directors and Writers).
Tokens
| Token | Light | Dark |
|---|---|---|
--k-line |
#e2e8f0 | rgba(255, 255, 255, .1) |
--k-surface |
#ffffff | #1a1a1a |
--k-text |
#0f172a | #e3e3e3 |
--k-bg |
#f8fafc | #191919 |
--k-radius-pill |
999px | |
--k-fs-meta |
12px |
React
In the Kwark app: import { Chip } from '@/components/ui/Chip'.
<Chip selected={on} onClick={toggle} onRemove={clear} removeLabel="Remove filter Act 2">Act 2</Chip>
| Prop | Type | Notes |
|---|---|---|
selected |
boolean |
|
onClick |
() => void |
makes it a toggle (aria-pressed) |
onRemove |
() => void |
adds the × |
removeLabel |
string |
name of the × |
HTML and CSS
Works anywhere with kwark.css.
<span class="kw-chip is-selected"><button type="button" aria-pressed="true">Drafting</button></span>
<span class="kw-chip"><button type="button" aria-pressed="false">Feature film</button></span>
<span class="kw-chip is-selected"><button type="button">Act 2</button><button type="button" class="kw-chip__x" aria-label="Remove filter Act 2"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M18 6 6 18M6 6l12 12"/></svg></button></span>
<button class="kw-chip kw-chip--add" type="button"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true"><path d="M12 5v14M5 12h14"/></svg> Add a name</button>
- Each chip is a toggle button with
aria-pressed. - Group them with a visible label or
role="group"andaria-label(Filter by time of day).
Rules
- Must use
aria-pressedon filter chips. - Never use a chip for status; use Badge.
- Never put a row of chips above the fold on a phone; use a Sheet.
AI readiness test
Task. Add time-of-day filtering to the scene list on desktop and phone.
Give the agent. Chip, Sheet, Phones pattern, Search and filter pattern.
Constraint. Phone content must start by y≈200.
A reliable answer
- Chips on desktop
- On phone a Filter text button opening a Sheet
- One active-filter line when a filter is on