Skip to content
Kimenpre-v1documentation home
Color scheme

ki-suggestions

Use cards to offer conversation starters with a short description. Use chips for follow-up prompts after an answer.

Theme for this example
Color scheme for this example
Summarise the incidents Draft release notes
<ki-suggestions id="starters" label="Start a conversation" variant="cards" mode="fill">
<ki-suggestion description="From the on-call reports">Summarise the incidents</ki-suggestion>
<ki-suggestion description="For the merged pull requests">Draft release notes</ki-suggestion>
</ki-suggestions>
Theme for this example
Color scheme for this example
Which ones recur? Group them by service Turn this into a table
<ki-suggestions label="Follow-up suggestions">
<ki-suggestion>Which ones recur?</ki-suggestion>
<ki-suggestion>Group them by service</ki-suggestion>
<ki-suggestion>Turn this into a table</ki-suggestion>
</ki-suggestions>

Supply a group label and place each ki-suggestion directly inside it. Write the prompt as plain text. That title is also the button’s accessible name. A supplied description gives assistive technology separate context. Tab moves through the buttons in reading order. Enter or Space chooses the focused suggestion.

Connect a composer

The group dispatches a bubbling, composed and cancelable ki-select. Read event.detail.text to get the chosen prompt. In the default send mode, the application’s event handler sends the prompt. Set mode="fill" to populate the composer’s draft for editing.

Assign composer in JavaScript. It accepts a writable string value and a focus() method. Both modes focus the composer after dispatch. Fill mode also replaces its draft. Cancel the event with preventDefault() when your handler takes over value or focus.

Add a draft field after the starter group in the first example.

<label for="draft">Message</label>
<textarea id="draft"></textarea>
const suggestions = document.querySelector('#starters');
suggestions.composer = document.querySelector('#draft');

Register both tags when using direct imports or framework wrappers.

API reference

When to use: offer suggested prompts to start or continue an assistant conversation.

When not to use: choose a form value, switch views, or display static example text.

Properties & attributes

AttributePropertyTypeDefaultDescription
labellabelstring–Required accessible name for the group.
modemode"fill" | "send"'send'Send through the application or fill its attached editor for revision.
variantvariant"cards" | "chips"'chips'Wrapping chips for follow-ups or cards with room for a description.

Events

EventDetail typeDescription
ki-selectCustomEvent<{ text: string }>Reports the chosen prompt title. Use this event to send the prompt in send mode. Cancel it to take over the default composer write and focus.

Slots

SlotDescription
(default)Direct ki-suggestion children in reading order.

CSS parts

PartDescription
groupThe container that lays out the suggested prompts.

CSS custom properties

The public styling contract of ki-suggestions: reassign these tokens at :root or on a subtree — never override internals.

TokenDescription
--ki-density-space-scaleMultiplies every scaled container padding and gap (card, dialog, alert, list, list item, select listbox, tab panel, tooltip).
--ki-suggestion-card-backdrop-filterFilter behind the card surface.
--ki-suggestion-card-bgResting card surface.
--ki-suggestion-card-bg-imageImage layered over the card surface.
--ki-suggestion-card-borderResting card boundary.
--ki-suggestion-card-fgResting card title.
--ki-suggestion-card-hover-bgCard surface on a hovering device.
--ki-suggestion-card-hover-fgTitle over the card hover surface.
--ki-suggestion-card-insetBlock padding of each starter card.
--ki-suggestion-card-pressed-bgCard surface while a pointer or key holds activation.
--ki-suggestion-card-pressed-fgTitle over the pressed card surface.
--ki-suggestion-card-radiusCorners of a starter card.
--ki-suggestion-card-weightWeight of the card title.
--ki-suggestions-card-widthMaximum inline size of each starter card.
--ki-suggestions-font-familyTypeface inherited by the suggestion group.
--ki-suggestions-gapSpacing between suggestions.

Open ki-suggestions in Storybook