Auto tag

Tag and category suggestions constrained to the app's own list, fuzzy-matched after the model answers.

Mock· scripted answersNo model runs in a browser, so every answer here is scripted. On a phone it comes from the model.
  • Apple Foundation Models: supported
  • Gemini Nano: supported
  • Llama (not yet supported): not supported
  • A cloud model: supported

Install

npx ondai add auto-tag

Usage

import { AutoTag } from '@/components/ondai/auto-tag'

<AutoTag text={note.body} tags={allTags} selected={note.tags} onChange={setTags} presentation="chips" max={3} />
  • The model can only pick from your list; results are fuzzy-matched back to it, so "Travel" becomes travel.

Customize

Every AI component takes the same look and customization props, so it fits your app rather than ours.

<AutoTag
  variant="pop"
  tint="#FF5A5F"
  size="lg"
  radius={12}
  icons={{ header: Search, add: null }}
  labels={{ title: '…', thinking: '…' }}
/>
PropWhat it does
variantThe look of the whole component: clean, minimal, glass, pop, candy, metal, shine
sizesm, md, lg; type, rows, icons and keys scale together
tintAny colour; the variant paints its keys, tiles and glow in it
radiusCorner radius of the container
iconsReplace any icon (a lucide component, an element, or null to hide it): header, add, accepted, tag, addAll, empty, error
labelsEvery visible and spoken string; defaults are exported as autoTagLabels: title, thinking, suggested, pending, addAll, empty, add, remove
SlotsDraw a part yourself: renderTag, renderEmpty, renderAddAll
stylesStyle any named part

Variants

PropOptions
presentationchips, inlineGhost, dropdown
variantclean, minimal, glass, pop, candy, metal, shine
sizesm, md, lg

Token budget

Input budget: 1500 tokens. One structured call with an enum-constrained array; results fuzzy-matched to the list.

Fallback

When no provider is ready the component renders the unavailable state (AvailabilityGate copy) and, where a deterministic path exists, keeps working without the model.

Eval score

Fixtures: evals/auto-tag/fixtures.json.

Files

Registry dependencies: button, chip, on-device-badge, shimmer-text, surface, skeleton

npm dependencies: @ondai/core, @ondai/tokens, expo-haptics, lucide-react-native, react-native-reanimated, zod

On this page