Skip to content
caliper ui pro docs

Inline suggest

A text field that offers how your sentence might go on, in grey after the caret. Tab takes all of it, ⌘→ or Ctrl→ one word, Escape or typing something else sets it aside; typing what it says keeps the rest on offer.

Pro

When to use

  • Composing messages, replies, commit messages and prompts.
  • Any long text where a likely ending saves real typing.

When not to use

  • Short fields such as names and search; use `Combobox`.
  • Suggestions people must review carefully, like legal text.

Installation

terminal
pnpm dlx shadcn@latest add @caliper/inline-suggest

Adds its 4 files to components/ui/, each with its own stylesheet, and installs their packages. Pro installs with your access token, set up once per project. See Pro access. The first part also adds Caliper UI’s tokens; import them once as in Installation.

API reference

InlineSuggest

4 props

Also accepts the native props of its root element and a ref.

PropTypeDefaultDescription
value *string—
onValueChange *(value: string) => void—
suggest *(text: string) => string | Promise<string | undefined> | undefined—Returns how the text might continue, or nothing. Called after typing pauses; may be async.
delaynumber350Pause after typing before asking for a suggestion, in ms.

Keyboard

Tab
Moves focus through the part's focusable elements.
→
Moves to the next item or value.
Escape
Closes or cancels, then returns focus to where it came from.

Accessibility

It is built on native elements and keeps aria-describedby, aria-hidden and aria-live in step with state. Changes that matter are announced through a live region.

Notes for AI

Give your coding assistant this page as Markdown instead of screenshots: the props, keyboard and examples in one file.

/docs/components/inline-suggest.md

The index of every part is at /llms.txt.

More in Text motion