smrt
Open the smrt source on GitHub Switch to dark color scheme
← All UI components

Chat · Components

AssistantChoiceCards

The options an assistant offered (see `./assistant-choices.svelte.ts`), as cards the person picks from.

Public export

typescript
import { AssistantChoiceCards } from '@happyvertical/smrt-chat/svelte';
Import path
@happyvertical/smrt-chat/svelte
Props
6
Props described
6 of 6
Bindable state
0
Callback events
5
Verified release
0.62.10

Props

NameTypeRequiredDescription
choicesAssistantChoiceSet[]YesThe controller's `choices` (dismissed sets are hidden).
onchoose(setId: string, optionId: string) => voidYesThe person picked an option (`controller.chooseOption`).
ondismiss(setId: string) => voidYesThe person wants none of them (`controller.dismissChoices`).
onpreview(setId: string, optionId: string) => voidNoPreview a card of a previewable set in place (`controller.previewOption`).
oncommit(setId: string) => voidNoApply the previewed card (`controller.commitOption`).
oncancel(setId: string) => voidNoRestore the original and close the set (`controller.cancelChoices`).

Bindable state

This component has no bindable public state.

Callback events

  • onchoose(setId: string, optionId: string) => void
  • ondismiss(setId: string) => void
  • onpreview(setId: string, optionId: string) => void
  • oncommit(setId: string) => void
  • oncancel(setId: string) => void

Examples and explanation