Chip
A pill holding an icon and a short label. inline sits inside a field with no ring; outlined stands on its own with a 1px rule ring. The label is a control's, so it takes the link role (weight 500, -0.03em) like the header's links.
Variants and sizes
Outlined stands alone with a rule ring; inline sits in a field with none. Size owns height and padding.
TSX
// Chip: a pill with an icon and a short label, such as a place or a language.
// outlined stands on its own with a rule ring; inline (the default) sits
// inside a field. A chip that opens something is a trigger, so it puts
// chipVariants on a <button> (or a Base UI trigger) instead of rendering
// <Chip>.
import { Chip, chipVariants } from "@repo/ui/chip";
import { GlobeIcon, PinIcon } from "@repo/ui/icons";
export default function ChipVariants() {
return (
<>
<Chip variant="outlined">
<PinIcon />
Sample place
</Chip>
<Chip variant="outlined">
<GlobeIcon />
Sample language
</Chip>
<Chip>
<PinIcon />
Inline chip
</Chip>
{/* size owns height and padding: touch, icon and bar are all 44px. */}
<button
type="button"
className={chipVariants({ size: "touch", interactive: true })}
>
<PinIcon />
Touch
</button>
{/* An icon-only chip needs its name in aria-label. */}
<button
type="button"
aria-label="Sample language"
className={chipVariants({ size: "icon", interactive: true })}
>
<GlobeIcon />
</button>
{/* fill="track" is the chip inside the composer bar. */}
<button
type="button"
className={chipVariants({
size: "bar",
interactive: true,
fill: "track",
})}
>
<PinIcon />
Composer bar
</button>
</>
);
}Interactive tones
A chip that is itself a trigger takes a tone on hover, press and while its popup is open. A press tones at once.
TSX
// An interactive chip: one that is itself a trigger. interactive: true adds
// the hover, press and open tones (open while its popup is showing). A press
// tones at once. fill="track" takes the track tone instead, for the composer
// bar. The tones come from the classes; write none of your own.
import { chipVariants } from "@repo/ui/chip";
import { PinIcon } from "@repo/ui/icons";
export default function ChipTones() {
return (
<>
<button type="button" className={chipVariants({ interactive: true })}>
<PinIcon />
Interactive
</button>
<button
type="button"
className={chipVariants({
size: "bar",
interactive: true,
fill: "track",
})}
>
<PinIcon />
Composer bar
</button>
</>
);
}Label variant
Not written yet
A label variant for topic labels has been proposed. chip.tsx has only inline and outlined, so there is nothing to show until it is built.
Code
TSX
// Chip in use: a standing chip, and the same look on a trigger. Triggers (the
// footer's language chip, the Ask bar's location chip) put chipVariants on a
// button or a Base UI trigger instead of rendering <Chip>, since <Chip> is a
// plain span.
import { Chip, chipVariants } from "@repo/ui/chip";
import { PinIcon } from "@repo/ui/icons";
export default function ChipUsage() {
return (
<>
<Chip variant="outlined">
<PinIcon />
Sample place
</Chip>
<button
type="button"
className={chipVariants({ size: "touch", interactive: true })}
>
<PinIcon />
Touch
</button>
</>
);
}Triggers (the footer's language chip, the Ask bar's location chip) put chipVariants({ ... }) on a button or a Base UI trigger instead of rendering <Chip>.
Variants
| Prop | Value | How it looks |
|---|---|---|
| variant | inline | No fill, no ring. Text 16/24, weight 500, -0.03em (the link role). Default size has 4px side and 8px top and bottom padding. |
| variant | outlined | Raised fill (#FAFDFF light, #00172E dark), 1px rule ring (#B2D5FF light, #23446A dark), text 14/21 weight 500. Default size is 36px tall with 12px side padding. |
| base | shared | Inline flex, full pill (rounded-full), 6px gap between icon and label, text colour, no wrapping, never shrinks. |
| size | default | Each variant's own height and padding (see above). |
| size | touch | 44px tall. Inline: 6px side padding. Outlined: 12px side padding. |
| size | bar | 44px tall, no vertical padding, 14px padding at the start and 16px at the end: the composer's wider inline padding. |
| size | touch-bar | touch (44px, same padding) below 768px; from 768px it becomes bar's 14px start and 16px end padding. |
| size | icon | 44px square, content centred, no padding, holds only an icon. Needs an aria-label. |
| interactive | true | Tones on the chip itself: hover, active (press) and data-popup-open. Eases over 300ms; a press tones at once (0ms). |
| interactive | group | Same tones driven by a parent with the group class (group-hover, group-active, group-data-popup-open), plus a 2px focus outline at a 2px offset on group-focus-visible. |
| fill | hover | Tone is the tint fill (#EEF6FF light, #122A43 dark). |
| fill | track | Tone is the track fill (ink 14% light, ground 18% dark). |
States
| State | How it looks |
|---|---|
| rest | No tone. A plain chip is not interactive and has no hover. |
| hover | interactive only: the fill tone behind the pill. |
| pressed | interactive only: the same tone, shown at once (no easing) so a tap shows before a menu opens on release. |
| open | interactive only: data-popup-open keeps the tone while its popup is open. |
| focus | true: the global 2px focus ring. group: the chip draws the ring itself because the parent hides its own. |
| disabled | not written |
| label variant | not written. A third variant for topic labels is proposed and is not in the code. |
Props
Import from @repo/ui/chip.
| Prop | Type | Default | What it does |
|---|---|---|---|
| variant | "inline" | "outlined" | default "inline" | inline: no ring, sits inside a field. outlined: stands alone with a 1px rule ring. |
| size | "default" | "touch" | "bar" | "touch-bar" | "icon" | default "default" | Owns height and padding, so a call site never overrides them. |
| interactive | false | true | "group" | default false | true adds hover, press and open tones for a chip that is itself the trigger. "group" does the same when the trigger is a parent with the group class, and draws the focus ring the parent hides. |
| fill | "hover" | "track" | default "hover" | The colour of those tones. track is for the composer's chips. |
| ...rest | ComponentProps<"span"> | A <span>. className is merged with cn(). | |
| chipVariants | cva function | Exported so a button or trigger can wear the same classes. |
Use it well
size owns height and padding. Do not override them at a call site.
An interactive chip is a trigger's look, so put chipVariants on a button, not <Chip> on a span.
Use interactive="group" when a larger hit area (a parent with the group class) is the real trigger.
Use fill="track" inside the Ask bar and composer, whose fills are the track's.
An icon-size chip has no text, so give its button an aria-label.
Join's area chips add a checked look in the caller: hover fill and a 1.5px accent ring (peer-checked), with a check icon.
A label variant is proposed and is not in the code yet. Until it is written, no page should draw one.