Tone check

Reads the tone of a draft as you type (friendly, neutral, blunt or tense, casual to formal) and offers a one-tap softer rewrite when it reads off.

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 tone-check

Usage

import { ToneCheck } from '@/components/ondai/tone-check'

<ToneCheck value={draft} onAccept={setDraft} />
  • Tones: friendly, neutral, blunt, tense, plus formality from casual (0) to formal (1) and a short note on how the message may land.
  • Runs after a pause in typing (debounceMs, default 700) once there are minChars (default 12) characters. A stale reading dims and its knobs spring to the new one, so the meter moves instead of jumping.
  • offTones (default ['blunt', 'tense']) decide when a softer version is offered. suggest="auto" writes it straight away, suggest="tap" waits for the Soften key, suggest="off" only reads.
  • Headless: useToneCheck() returns reading, suggestion, phase, isOff, check(text) and soften(text).

Customize

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

<ToneCheck
  variant="pop"
  tint="#FF5A5F"
  size="lg"
  radius={12}
  icons={{ blunt: CircleAlert, soften: Wand2 }}
  labels={{ blunt: '…', accept: '…' }}
/>
PropWhat it does
variantThe look of the whole component: clean, minimal, glass, pop, candy, metal, shine, bevel
sizesm, md, lg; type, the pill, the meters and keys scale together
tintAny colour; the variant paints its keys in it. Tone colours stay semantic
radiusCorner radius of the card
iconsReplace any icon (a lucide component, an element, or null to hide it): friendly, neutral, blunt, tense, soften, accept, reject, retry
labelsEvery visible and spoken string; defaults are exported as toneCheckLabels: title, friendly, neutral, blunt, tense, warm, sharp, casual, formal, formality, thinking, softening, idle, softer, soften, accept, reject, retry, preparing
SlotsDraw a part yourself: renderMeter, renderSuggestion
stylesStyle any named part

Variants

PropOptions
variantclean, minimal, glass, pop, candy, metal, shine, bevel
presentationcard, pill
sizesm, md, lg

Token budget

Input budget: 1800 tokens. The draft is truncated to half the window so the softer rewrite fits in the rest; the reading is a small JSON object.

Fallback

When structured output is not available the reading falls back to three plain lines (tone:, formality:, note:). When no provider is ready the component shows the unavailable copy, or the download bar while a model prepares.

Files

Registry dependencies: button, model-download, on-device-badge, shimmer-text, streaming-text, surface

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

On this page