Skip to content
Vertical Jump Designs-uiFront-End Studio
Get Pro

v3.9 is out.

Data display

Chip

Free12.8 KB gzipped

A compact pill for tags, filters, and selections. Unlike Badge, a chip can be removable (onRemove), clickable (onClick or href), or selectable (selected / onSelectedChange, or value in a ChipGroup).

Accessibility: WCAG 2.2 AA · No A or AA violations in light or dark mode · Keys: Enter, Space, Backspace and 1 more · Full report

Import

tsx
import { Chip, ChipGroup } from "@vjdesigns/vjdesigns-ui";

Importing only Chip adds about 12.8 KB of minified, gzipped JavaScript to your app (React not included). The stylesheet is shared by every component and loaded once: 75.1 KB gzipped.

Examples

Variants

SoftSolidOutline
Jordan LeeShippedIn review
tsx
import { Avatar, Chip, Flex, Stack } from "@vjdesigns/vjdesigns-ui";

export function Variants() {
  return (
    <Stack gap={3} align="center">
      <Flex gap={2} wrap="wrap" justify="center">
        <Chip variant="soft">Soft</Chip>
        <Chip variant="solid" tone="primary">
          Solid
        </Chip>
        <Chip variant="outline">Outline</Chip>
      </Flex>
      <Flex gap={2} wrap="wrap" justify="center">
        <Chip avatar={<Avatar name="Jordan Lee" colorFromName />}>Jordan Lee</Chip>
        <Chip tone="success">Shipped</Chip>
        <Chip tone="warning">In review</Chip>
      </Flex>
    </Stack>
  );
}

Removable

With onRemove, a chip gets a remove button. Backspace or Delete removes a focused chip.

OpenAssigned to meHigh priority
tsx
import { useState } from "react";
import { Chip, ChipGroup } from "@vjdesigns/vjdesigns-ui";

export function Removable() {
  const [filters, setFilters] = useState(["Open", "Assigned to me", "High priority"]);
  return (
    <ChipGroup aria-label="Active filters">
      {filters.map((filter) => (
        <Chip key={filter} onRemove={() => setFilters((current) => current.filter((f) => f !== filter))}>
          {filter}
        </Chip>
      ))}
    </ChipGroup>
  );
}

Filter chips

With selectionMode, a ChipGroup works like a set of toggle buttons for filtering.

Showing: react

tsx
import { useState } from "react";
import { Chip, ChipGroup, Stack, Text } from "@vjdesigns/vjdesigns-ui";

export function FilterChips() {
  const [selected, setSelected] = useState(["react"]);
  return (
    <Stack gap={3} align="center">
      <ChipGroup selectionMode="multiple" value={selected} onValueChange={setSelected} aria-label="Frameworks" variant="outline">
        <Chip value="react">React</Chip>
        <Chip value="angular">Angular</Chip>
        <Chip value="vue">Vue</Chip>
        <Chip value="svelte">Svelte</Chip>
      </ChipGroup>
      <Text size="sm" tone="muted">
        Showing: {selected.join(", ") || "everything"}
      </Text>
    </Stack>
  );
}

Accessibility

Filter chips are toggle buttons: they expose aria-pressed and show a check icon, so the selected state isn't color alone. Every remove button has its own name, here "Remove filter: Size M".

Size: MColor: Blue
tsx
import { useState } from "react";
import { Chip, ChipGroup, Flex, Stack } from "@vjdesigns/vjdesigns-ui";

export function Accessibility() {
  const [filters, setFilters] = useState(["Size: M", "Color: Blue"]);
  return (
    <Stack gap={4}>
      <ChipGroup aria-label="Filter by status" selectionMode="multiple" defaultValue={["open"]}>
        <Chip value="open">Open</Chip>
        <Chip value="closed">Closed</Chip>
        <Chip value="draft">Draft</Chip>
      </ChipGroup>
      <Flex gap={2} wrap="wrap">
        {filters.map((filter) => (
          <Chip
            key={filter}
            removeLabel={`Remove filter: ${filter.replace(": ", " ")}`}
            onRemove={() => setFilters((all) => all.filter((f) => f !== filter))}
          >
            {filter}
          </Chip>
        ))}
      </Flex>
    </Stack>
  );
}

Translated

Without a removeLabel, each remove button is named from the locale and the chip's text (Spanish here).

Talla: MColor: azulEn oferta
tsx
import { useState } from "react";
import { Chip, Flex, LocaleProvider } from "@vjdesigns/vjdesigns-ui";
import es from "@vjdesigns/vjdesigns-ui/locales/es";

export function Translated() {
  const [chips, setChips] = useState(["Talla: M", "Color: azul", "En oferta"]);
  return (
    <LocaleProvider locale="es" messages={es}>
      <Flex gap={2} wrap="wrap">
        {chips.map((chip) => (
          <Chip key={chip} onRemove={() => setChips((all) => all.filter((c) => c !== chip))}>
            {chip}
          </Chip>
        ))}
      </Flex>
    </LocaleProvider>
  );
}

Right to left

The first example again, inside a right-to-left LocaleProvider (Arabic). Layout, spacing and arrow icons mirror, and the components' built-in text is translated. The example's own text stays in English.

Variants

SoftSolidOutline
Jordan LeeShippedIn review
tsx
import { LocaleProvider } from "@vjdesigns/vjdesigns-ui";
import ar from "@vjdesigns/vjdesigns-ui/locales/ar";

// Variants is the "Variants" example above.
<LocaleProvider locale="ar" messages={ar}>
  <Variants />
</LocaleProvider>

Usage notes

  • Static: a <span>. A remove button, if any, is its only tab stop.
  • Clickable: a <button> or <a>.
  • Selectable: a <button aria-pressed> with a check icon when selected.
  • Interactive and removable: the action and the remove button are sibling buttons inside one pill (never nested).

API reference

Chip

Chip props
PropTypeDefault
children

The chip label. Long labels truncate with an ellipsis; the full text stays in the accessible name and in a title tooltip when it is a string.

ReactNode—
variant

Visual style. Inside a ChipGroup, defaults to the group's variant.

"solid""soft""outline""soft"
tone

Semantic color. Inside a ChipGroup, defaults to the group's tone.

"neutral""primary""accent""success""warning""danger""info""neutral"
size

Height, padding, and type size. Inside a ChipGroup, defaults to the group's size.

"sm""md""lg""md"
radius

Corner rounding.

"none""xs""sm""md""lg""xl""2xl""pill""pill"
startIcon

Decorative icon before the label. Hidden from assistive technology, so the label must carry the meaning.

ReactNode—
avatar

A small avatar before the label, e.g. <Avatar size="xs" name="Dana" />. Hidden from assistive technology because the label already names the person.

ReactNode—
onRemove

Makes the chip removable: shows a remove button (a real <button>, at least 24x24 px). Backspace or Delete on a focused chip also removes it. Inside a ChipGroup, focus moves to the next chip after removal.

() => void—
removeLabel

Accessible name of the remove button.

string"Remove {label}"
removeTabIndex

tabIndex of the remove button. Pass -1 when a parent manages focus across many chips (a roving tab stop, as TagInput does), so the list is one Tab stop; the button stays clickable and focusable from script.

number—
disabled

Disables the chip and its remove button. Inside a ChipGroup, the group's disabled also applies.

booleanfalse
selected

Selected state for a filter chip (controlled). Setting selected, defaultSelected, or onSelectedChange makes the chip a toggle button (aria-pressed) that shows a check icon when selected.

boolean—
defaultSelected

Initial selected state when uncontrolled.

boolean—
onSelectedChange

Called with the next selected state when the chip is toggled.

(selected: boolean) => void—
value

Value of this chip inside a ChipGroup with selectionMode. The group then manages selected, and the chip's own selected is ignored.

string—
href

Makes the chip a link. Ignored when the chip is selectable.

string—
target

Link target (with href).

ComponentPropsWithoutRef<"a">["target"]—
rel

Link relationship (with href).

string—
download

Download hint (with href).

ComponentPropsWithoutRef<"a">["download"]—
onClick

Click handler. Makes the chip a <button> (unless href is set).

MouseEventHandler<HTMLElement>—
onKeyDown

Key handler on the chip's interactive element (or its root when static). Call preventDefault() to skip Backspace/Delete removal.

KeyboardEventHandler<HTMLElement>—
ref

Ref to the chip's primary element: the <button> or <a> when the chip is clickable or selectable, otherwise the root <span>.

Ref<HTMLElement>—

Also accepts native <button> attributes, plus className, style and ref.

ChipGroup

Lays out chips with a gap and wraps them. As a tag list (role="list", the default), each chip becomes a listitem. With selectionMode, it is a role="group" that manages selected chips by their value.

After a chip is removed, focus moves to the next chip, else the previous one, else focusFallback, else the group itself.

ChipGroup props
PropTypeDefault
role

list (default without selectionMode): a tag list; each chip is wrapped in a listitem. group (default with selectionMode): a set of filter chips; give it aria-label or aria-labelledby.

"list""group"—
size

Size for every chip (a chip's own size wins). Also sets the gap.

"sm""md""lg""md"
variant

Variant for every chip (a chip's own variant wins).

"solid""soft""outline"—
tone

Tone for every chip (a chip's own tone wins).

"neutral""primary""accent""success""warning""danger""info"—
disabled

Disables every chip in the group.

booleanfalse
focusFallback

Where focus goes when the last remaining chip is removed. Without it, the group container itself receives focus.

ChipFocusFallback—
children

Chip elements.

ReactNode—
selectionMode

Lets the group manage selectable chips (each needs a value).

"single""multiple"—
value

Controlled value: the selected chip's value, or null.

string | null | string[]—
defaultValue

Initial value when uncontrolled.

string | null | string[]null
onValueChange

Called with the next value (null when the selected chip is unselected).

(value: string | null) => void | (value: string[]) => void—
aria-label

Defines a string value that labels the current element.

string—
aria-labelledby

Identifies the element (or elements) that labels the current element.

string—

Also accepts standard HTML attributes, plus className, style and ref.

See what changed in each version in the Changelog.

Accessibility report

Chip targets WCAG 2.2 AA. Below: a live axe-core audit of this page's examples, Lighthouse scores for the page in both modes, the accessibility behavior built into the component, and the checks only a person can do.

axe-core audit (live)

Running accessibility audit

Checking the examples above…

Lighthouse audit

Light mode

Score 100

35 passed · 0 failed · 30 not applicable · 10 to check by hand

Dark mode

Score 100

35 passed · 0 failed · 30 not applicable · 10 to check by hand

Lighthouse 13.5.0 audits the whole docs page (header and sidebar included), not just the examples, in English. Last run 11/27/2026. Some failed audits carry no weight in the score, so a page can score 100 and still list one.

Built-in behavior

Keyboard

Keyboard
KeyAction
EnterSpaceToggles a selectable chip, or activates a clickable one.
BackspaceDeleteRemoves a removable chip when it has focus; focus moves to the next chip.

Roles and states

Roles and states
ElementRoleStates and properties
Selectable chipbuttonaria-pressed
Remove buttonbuttonaria-label ("Remove …")
ChipGrouplist or grouparia-label; chips are list items

Manual checks

Automated tools find roughly a third of accessibility issues. Test these in your app, with your content.

Manual accessibility checks
CheckWhat to testWCAG 2.2
KeyboardEvery action works with Tab, Shift+Tab, Enter, Space and the arrow keys, and focus never gets stuck.2.1.1 (A), 2.1.2 (A)
FocusFocus moves in a logical order, is always visible, and isn't hidden behind sticky headers.2.4.3 (A), 2.4.7 (AA), 2.4.11 (AA), 2.4.13 (AAA)
Screen readersNames, roles and states are announced correctly, and status changes are announced without moving focus.1.3.1 (A), 4.1.2 (A), 4.1.3 (AA)
ColorMeaning never depends on color alone; your own colors meet contrast in both modes.1.4.1 (A), 1.4.3 (AA), 1.4.11 (AA), 1.4.6 (AAA)
Zoom and reflowAt 200% text size and at 320px wide (400% zoom), nothing is cut off and no sideways scrolling is needed.1.4.4 (AA), 1.4.10 (AA), 1.4.12 (AA)
Pointer targetsClick and tap targets are at least 24×24px (44×44px for AAA), or spaced so they don't overlap.2.5.8 (AA), 2.5.5 (AAA)
MotionAnimations respect the reduced-motion setting.2.3.3 (AAA)