Skip to content
kitn AI/UI

Suggestions

kai-suggestions

Can sit above an empty thread or under a reply, in a row or a full-width stack.

  • Shadow DOM
  • 3 chip styles
  • Block layout mode
  • Substring highlight
  • 1 event

Assign the suggestions property and listen for kai-select:

<kai-suggestions id="suggs" variant="outline"></kai-suggestions>
<script type="module">
import '@kitn.ai/ui/web-components';
await customElements.whenDefined('kai-suggestions');
const suggs = document.getElementById('suggs');
suggs.suggestions = ['Explain the architecture', 'Show me a code example'];
suggs.addEventListener('kai-select', (e) => console.log(e.detail.value));
</script>

For the declarative path, use <kai-suggestion> children — value sets the emitted value, text content is the label. Prop items render first; declarative children are appended after.

Child elementAttributesText contentNotes
iconvalue
YesParse a single `<kai-suggestion>` node into an `Item` descriptor.

variant="ghost" — no border, subtle hover. Good when chips should blend into the surrounding UI.

block stacks suggestions as full-width rows — useful in sidebars or constrained panels.

highlight emphasises the matching substring in every chip — ideal for autocomplete or search-suggestion lists.

Pass { label, value } objects when the displayed text and the emitted value should differ.

PropertyTypeDefaultNotes
theme'auto'Color mode (`auto` follows prefers-color-scheme).
suggestions[]The suggestions: strings, or `{ label, value }` when the displayed text and emitted value differ. JS property (array).
variant'outline'Chip style. Defaults to `outline`.
size'md'Row height for the list layout. Defaults to `md`; chips are unaffected.
layout'chips'A wrapping row of pills (the default), or full-width rows with a leading icon.
blockfalseFull-width left-aligned rows instead of pills.
highlight—Substring to highlight within each suggestion.
EventDetailNotes
A suggestion was clicked.

This element wraps these SolidJS components — reach for them directly when you need finer control than the props expose.

PromptSuggestion