Krizaka UI
Krizaka UI
ComponentsForms

Tag selector

Interests, languages, a workspace's tags: toggle chips with a limit and a count — the others rest once the limit is reached. With a marker an option is a tag with its colour; creatable adds a field where Enter takes the tag typed or creates it.

Web · ✓Mobile · ✓Desktop · ✓BetaForms
Domain
Forms
Support level
Beta
Size
4.9 kB gzip, budget 13.8 kB
Who uses it
4 files of the live products and sites import it (Verikora: 3, Folioviv: 1) Counted in the dated inventory of 2026-11-23.
import { TagSelector } from "@krizaka/ui/tag-selector";

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 Verikora, Folioviv.

When to use

  • A profile's interests, up to five.
  • Filters by topic with a limit.
  • A workspace's tags on a file (creatable): choose among the tags that exist, or type a new one and give it a colour of the closed palette.

When not to use

  • To type free words that are not a list the workspace keeps (keywords, e-mail recipients).Use instead: Tag input
  • For one choice.Use instead: Radio group

Installation

Install

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

Styles

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

Import

import { TagSelector } from "@krizaka/ui/tag-selector";

Examples

Interests

Ten interests, up to five.

A workspace's tags

creatable: type to narrow, Enter takes the tag of that name or creates one in the colour chosen; the tags carry their markers.

Props

Toggle chips with a limit and a count — the others rest once the limit is reached; creatable types a new one.

PropTypeDefaultDescription
labelrequiredstring—The group's name (“Interests”) — passed translated.
onValueChangerequired(value: string[]) => void—Called with the tags chosen.
optionsrequiredreadonly TagOption[]—The tags offered.
valuerequiredreadonly string[]—The tags chosen.
classNamestring—Classes merged on the root.
countLabel((count: number, max: number) => string)—The count under the tags: (n, max) => n + " of " + max.
creatableboolean—Adds a field: Enter chooses the tag typed, or asks the host to create it.
createLabel((name: string) => string)(name) => `Create “${name}”`The create button: (name) => "Create “" + name + "”", passed translated.
defaultMarker"blue" | "green" | "amber" | "red" | "violet" | "gray"blueThe colour a new tag starts with (default blue).
emptyLabelstring—What is said when nothing matches and creating is not offered (“No tag of that name”), passed translated.
inputLabelstring—The field's accessible name ("Add a tag"), passed translated.
markerLabelstring—The colour choice's accessible name ("Colour of the new tag").
markerNamesReadonly<Record<"blue" | "green" | "amber" | "red" | "violet" | "gray", string>>—The name of each colour, passed translated: shows the colour choice beside the field.
maxnumber—The most that can be chosen.
maxLengthnumber80The most characters of a name (default 80, the contract's NAME_MAX).
onCreate((name: string, marker: "blue" | "green" | "amber" | "red" | "violet" | "gray") => void)—Called with the new name (trimmed, as typed) and the marker chosen; the host creates the tag (it may refuse), adds the option and chooses it.
placeholderstring—The field's placeholder, passed translated.
showMarkerNamesboolean—Writes each colour's name beside its swatch (MarkerPicker showNames): the colour is never only a hue.

Accessibility

  • A group named by label; each chip says whether it is chosen; the count is announced.
  • creatable: the field has its own accessible name (inputLabel) and controls the group; the colour choice is a named radio group.

Keyboard

KeysAction
Tab / SpaceReach and toggle each chip.
Entercreatable: in the field, chooses the tag typed or creates it.
Backspacecreatable: on an empty field, takes the last chosen tag back.
Esccreatable: clears the field.

Best practices

  • Say the limit in the count (“3 of 5 chosen”).
  • Order the options by popularity, not alphabet.
  • creatable: the host creates the tag in onCreate(name, marker) (it may refuse a duplicate or a limit), adds the option and chooses it; pass markerNames to let the person pick the colour, and showMarkerNames to write each colour's name beside its swatch.
  • Never the only signal: a tag's colour sits beside its name.

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