Smart reply

Three reply suggestions for the last message in a thread: chips, a stack, or ghost text inside the input, with an optional tone picker.

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 smart-reply

Usage

import { SmartReply } from '@/components/ondai/smart-reply'

<SmartReply thread={messages} presentation="chips" onSelect={(text) => composer.setText(text)} />
  • Only the last six messages are sent, trimmed from the start.
  • The ghost presentation shows the first suggestion as faded text inside the input; Tab or the arrow accepts it.

Customize

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

<SmartReply
  variant="pop"
  tint="#FF5A5F"
  size="lg"
  radius={12}
  icons={{ reply: Search, insert: null }}
  labels={{ placeholder: '…', inputLabel: '…' }}
/>
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): reply, insert, accept, more
labelsEvery visible and spoken string; defaults are exported as smartReplyLabels: placeholder, inputLabel, thinking, thinkingOne, more, moreLabel, accept, empty, tone, toneNeutral, toneFriendly, toneFormal, toneBrief
SlotsDraw a part yourself: renderReply, renderEmpty, renderFooter, renderAccept
stylesStyle any named part

Variants

PropOptions
variantclean, minimal, glass, pop, candy, metal, shine
presentationchips, stack, ghost
sizesm, md, lg
toneneutral, friendly, formal, brief

Token budget

Input budget: 1200 tokens. Only the last 6 messages are sent, trimmed from the start.

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/smart-reply/fixtures.json.

Files

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

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

On this page