Kinetik UI

Tag Field

.md

Typed words that pop into tags while the rest make room; a duplicate makes the existing tag jump instead.

v1.0.0Live on webreact-native-reanimatedreact-native-worklets
Component preview

Installation

Kinetik CLI
npx kinetik-ui add tag-field

The CLI copies the source and installs native dependencies with npx expo install, so versions match your Expo SDK. With shadcn: npx shadcn@latest add https://kinetik-ui.dev/r/tag-field.json

Install manually

  1. Install dependencies
    npx expo install react-native-reanimated react-native-worklets
  2. Copy the source files
    • components/kinetik/tag-field.tsx
    View source files

Usage

import { TagField } from '@/components/kinetik/tag-field';

<TagField label="Topics" value={tags} onChange={setTags} maxTags={6} />;

When to use

  • Short free-form values people add several of: topics, skills, email recipients, labels.
  • Lists where people should see and edit everything they have added in one place.

When not to use

  • Choosing from a known, short list. Use Filter Chips.
  • A single value. Use Float Field.

Notes

  • Return or any of separators (a comma by default) ends a tag; pasted text with commas becomes several tags.
  • A duplicate (ignoring case) makes the existing tag jump instead of adding another; validate can refuse a tag, which shakes the field.
  • Backspace in the empty field first marks the last tag, then removes it. Additions and removals are announced to screen readers.
  • Each remove button is a full 44 pt square inside the 32 pt pill.

Props

TagFieldProps

PropTypeDefaultDescription
valuerequiredreadonly string[]—
onChangerequired(tags: string[]) => void—
labelrequiredstring—Shown above the field and used as the input's accessible name.
placeholderstring'Add a tag'
separatorsreadonly string[][',']Characters that end a tag as they are typed. Return always does. Defaults to [","].
maxTagsnumber—No more tags can be added past this.
validate(tag: string) => boolean—Return false to refuse a tag; the field shakes.
hapticsbooleantrueTicks as tags are added and removed. Defaults to true.
testIDstring—
styleStyleProp<ViewStyle>—

Performance and accessibility

Performance

Budget
Plain views with Reanimated layout transitions, which run only when a tag is added or removed. Nothing runs at rest.
Measured

Pixel 9 emulator, API 35, release build · interaction median 0.94× the system Settings app on the same emulator (indicative only) · no frames drawn at rest · 137 MB app memory. p99 spikes are the keyboard opening and closing.

Real-device measurement pending.

Accessibility

Reduced motion
Tags appear and disappear at once and the rest move without a spring.
Screen readers
A text field named by its label whose hint lists the tags; each tag has a Remove button. Changes are announced.
Touch target
Each remove button is 44 by 44 pt; the field is at least 52 pt tall.

Source files

components/kinetik/tag-field.tsx is in the Code tab of the preview above.