Skip to content

Suggestion

Prompts a person can send with one press, in a row that scrolls or wraps.

Pick a prompt.

Installation

  1. Add the registryOnce per project
  2. Add suggestion

Usage

onSelect receives the suggestion's value, which is also its label unless you pass children. Return a promise from onSelect to keep the suggestion pending until the promise settles. Your own onClick runs first, and calling event.preventDefault() in it skips onSelect. When a row of suggestions doesn't fit, it scrolls horizontally and fades at the edges where there's more to scroll.

Composition

Examples

Wrapped

wrap wraps the suggestions onto as many lines as they need.

Props

Base UI's styling (opens in a new tab) and composition (opens in a new tab) guides say more about className, style and render.

SuggestionGroup

Suggestion