Summarize
The gist of long text: card, inline, sheet or tooltip. Streams, and map-reduces input that does not fit the on-device context.
- Apple Foundation Models: supported
- Gemini Nano: supported
- Llama (not yet supported): not supported
- A cloud model: supported
Install
npx ondai add summarizeUsage
import { Summarize } from '@/components/ondai/summarize'
<Summarize text={thread.text} presentation="card" length="bullets" emphasis="plain" />- Short input streams in one pass; long input is chunked, summarized per chunk and reduced (progress shown).
useSummarize()exposes the same logic headlessly.
Customize
Every AI component takes the same look and customization props, so it fits your app rather than ours.
<Summarize
variant="pop"
tint="#FF5A5F"
size="lg"
radius={12}
icons={{ title: Search, run: null }}
labels={{ title: '…', run: '…' }}
/>| Prop | What it does |
|---|---|
variant | The look of the whole component: clean, minimal, glass, pop, candy, metal, shine |
size | sm, md, lg; type, rows, icons and keys scale together |
tint | Any colour; the variant paints its keys, tiles and glow in it |
radius | Corner radius of the container |
icons | Replace any icon (a lucide component, an element, or null to hide it): title, run, toggle, retry, copy, copied, again, bullet |
labels | Every visible and spoken string; defaults are exported as summarizeLabels: title, run, thinking, reading, idle, retry, copy, copied, again, preparing, tokens, show, hide |
| Slots | Draw a part yourself: renderBullet, renderSummary, renderEmpty, renderAction, renderError |
styles | Style any named part |
Variants
| Prop | Options |
|---|---|
variant | clean, minimal, glass, pop, candy, metal, shine |
presentation | card, inline, sheet, tooltip |
size | sm, md, lg |
length | oneLine, bullets, paragraph |
emphasis | plain, quote, highlighted |
Token budget
Input budget: 3400 tokens. Single streamed pass when the text fits; otherwise map (bullets per chunk) then reduce (streamed).
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/summarize/fixtures.json.
Files
Registry dependencies: button, model-download, on-device-badge, sheet, shimmer-text, skeleton, streaming-text, surface
npm dependencies: @ondai/core, @ondai/tokens, expo-clipboard, expo-haptics, lucide-react-native, react-native-reanimated











