Krizaka UI
Krizaka UI
ComponentsFoundations

Chip

A selectable pill: alone a toggle, in a group a single or multiple choice, or a removable tag. Also the tags of a workspace: TagChip, with a colour marker from the closed palette.

Web · ✓Mobile · ✓Desktop · ✓BetaForms
Support level
Beta
Size
3.7 kB gzip, budget 13.0 kB
Who uses it
21 files of the live products and sites import it (Verikora: 4, Folioviv: 3, Sovkora: 3, krizaka.com: 2) Counted in the dated inventory of 2026-11-23.
import { Chip, TagChip, TagMarker, MarkerPicker } from "@krizaka/ui/chip";
Change its props: the component re-renders, the code follows.
size
selected
removable
tsx
<Chip removeLabel="Remove">Subtitles</Chip>

Web and mobile — the same component for React and React Native. Beta: its API may still change in a minor version.

Why it is here. Used by Sovkora, Verikora, Folioviv, krizaka.com.

When to use

  • To filter a list with a few short options shown at once: format, genre, speed.
  • Chip.Group type="multiple" for several tags; type="single" (with required) for one filter.
  • removable for the values already chosen: tags, recipients, active filters.
  • TagChip for the tags a person puts on a file (a client, an invoice, an applicant): the name with its marker, a dot or a ribbon. MarkerPicker recolours one from the six colours.

When not to use

  • To switch between views of the same page.Use instead: Tabs
  • To choose in a form that is submitted, with labels that read as sentences.Use instead: Radio group
  • For the state of an entity whose kind has a status set.Use instead: Status chip
  • For a status that cannot be changed.Use instead: Badge
  • To run an action.Use instead: Button

Installation

Install

npm install @krizaka/ui @krizaka/tailwind @krizaka/tokens tailwindcss

Styles

@import "tailwindcss";
@import "@krizaka/tailwind";
@import "@krizaka/ui/tailwind.css";

Import

import { Chip, TagChip, TagMarker, MarkerPicker } from "@krizaka/ui/chip";

Examples

Toggle

Alone, off and on: a pressed button.

Single choice

One choice in a group: a filter; required keeps one chosen.

Multiple choice

Several choices: tags.

Small

size="sm" for dense toolbars.

Removable

Chosen tags, each with a named remove button.

Tags with a marker

TagChip: a client's tags as a filter, and worn tags with a ribbon marker, removable.

Recolour a tag

MarkerPicker: the six colours of the closed palette, named and ticked.

Props

Chip

Chip (selectable, removable) and Chip.Group (single · multiple).

PropTypeDefaultDescription
onRemoverequired() => void—Runs when the remove button is pressed.
removeLabelrequiredstring—The accessible name of the remove button — passed translated, e.g. "Remove #night".
defaultSelectedboolean—Alone: pressed at first, uncontrolled.
onSelectedChange((selected: boolean) => void)—Alone: called with the new state on every press.
removableboolean—A pressable chip (the default); true makes it a static chip with a remove button. A static chip (a chosen tag, an applied filter) with a remove button.
selectedboolean—Alone: pressed or not (defaultSelected uncontrolled), onSelectedChange on every press.
size"sm" | "md"mdsm · md (inside Chip.Group, the group's size by default).
valuestring—Inside Chip.Group: the value this chip stands for (required there, ignored alone).

ChipGroup

Chips that choose together: type single · multiple, value/defaultValue + onValueChange.

PropTypeDefaultDescription
typerequired"single" | "multiple"—One choice: the chips behave as radios. Any number of choices: the chips are pressed buttons.
defaultValuestring | string[]—The value chosen at first, uncontrolled. The values chosen at first, uncontrolled.
disabledboolean—Disables every chip of the group.
labelstring—The group's accessible name — passed translated ("Filter by format").
loopboolean—Arrow keys wrap from the last chip to the first (default true).
onValueChange((value: string) => void) | ((value: string[]) => void)—Called with the new value on every choice. Called with the new values on every press.
orientation"horizontal" | "vertical"—The arrow keys that move: left / right (horizontal, a row) or up / down (vertical, a column).
requiredboolean—Keeps one chip selected: pressing the selected chip does not clear it (default false).
routeKeystring—Binds the choice to this search parameter of the URL (?type=…): the URL is the state. Without it the state is local — only for an ephemeral choice.
routeValuesreadonly string[]—The values the parameter may hold (the chips' values).
size"sm" | "md"mdsm · md: the size of every chip of the group.
valuestring | string[]—The chosen value (controlled), "" when none. The chosen values (controlled).

MarkerPicker

Recolours a tag from the closed palette: a radio group of swatches (arrow keys), the chosen one ticked and named.

PropTypeDefaultDescription
labelrequiredstring—The group's accessible name ("Colour of the tag"), passed translated.
namesrequiredReadonly<Record<"blue" | "green" | "amber" | "red" | "violet" | "gray", string>>—The name of each colour, passed translated: { blue: "Blue", … }. The swatches are named, never colour alone.
classNamestring—Classes merged on the root.
defaultValue"blue" | "green" | "amber" | "red" | "violet" | "gray"—The colour chosen at first, uncontrolled.
disabledboolean—Not available.
markersreadonly ("blue" | "green" | "amber" | "red" | "violet" | "gray")[]["blue", "green", "amber", "red", "violet", "gray"] as constThe colours offered (default: the six).
onValueChange((value: "blue" | "green" | "amber" | "red" | "violet" | "gray") => void)—Called with the colour chosen.
showNamesbooleanfalseWrites each colour's name beside its swatch (44 px targets, wrapping): a sighted person who cannot tell two hues apart still reads « red » and « amber ».
value"blue" | "green" | "amber" | "red" | "violet" | "gray"—The colour chosen (controlled).

TagChip

A tag: its marker and its name. Alone a toggle (a filter), inside Chip.Group an item, or removable (a tag worn by a file) — the behaviour of Chip, with the marker before the name.

PropTypeDefaultDescription
markerrequired"blue" | "green" | "amber" | "red" | "violet" | "gray"—The tag's marker: a name of the closed palette (blue · green · amber · red · violet · gray).
onRemoverequired() => void—Runs when the remove button is pressed.
removeLabelrequiredstring—The accessible name of the remove button — passed translated, e.g. "Remove #night".
defaultSelectedboolean—Alone: pressed at first, uncontrolled.
onSelectedChange((selected: boolean) => void)—Alone: called with the new state on every press.
removableboolean—A pressable chip (the default); true makes it a static chip with a remove button. A static chip (a chosen tag, an applied filter) with a remove button.
selectedboolean—Alone: pressed or not (defaultSelected uncontrolled), onSelectedChange on every press.
shapeMarkerShapedotdot · ribbon.
size"sm" | "md"mdsm · md (inside Chip.Group, the group's size by default).
valuestring—Inside Chip.Group: the value this chip stands for (required there, ignored alone).

TagMarker

The marker alone, decorative (aria-hidden): put the tag's name beside it.

PropTypeDefaultDescription
markerrequired"blue" | "green" | "amber" | "red" | "violet" | "gray"—A name of the closed palette.
shapeMarkerShapedotdot · ribbon.

Accessibility

  • Radix Toggle and ToggleGroup: alone aria-pressed; in a single group a radio (aria-checked), in a multiple group pressed buttons.
  • Chip.Group takes label as the group's accessible name.
  • The remove button is a separate button named by removeLabel.
  • A marker is decorative (aria-hidden); the tag's name is the chip's name. MarkerPicker is a radio group of named swatches (arrow keys), the chosen one ticked; showNames writes each name beside its swatch (44 px targets, wraps).

Keyboard

KeysAction
TabMoves into the group (one tab stop) and out of it.
Arrow keysMove between the chips of a group.
Space / EnterToggles the focused chip.

Best practices

  • One or two words per chip; the group's label says what is being chosen.
  • Keep the order stable when a chip is selected: do not move it to the front.
  • Give each removable chip a removeLabel that names it: “Remove #night”, not “Remove”.
  • A marker sits beside the name and never fills the chip: the colour is never the only signal. Keep tag names short; the closed palette has six colours, the tokens --kz-tag-<name> and --kz-tag-<name>-text (≥ 3:1 and ≥ 4.5:1 on every surface).

Generated from the code of @krizaka/ui 5.3.4: its meta.ts, its examples and its types.Edit this documentation on GitHub

On this page