QuestionPrompt

A clarifying question from the agent. Tap one or several options, or type your own, then send; skip lets it use its best guess. AI.

Open playground
Which environment should I deploy to?

About

QuestionPrompt is a React component in the AI category of smoui. It is typed, ships no stylesheet, follows your theme through CSS variables, and honors prefers-reduced-motion. Import it with import { QuestionPrompt } from "@ashutoshswamy/smoui" and set question, options, multiple among its 5 props.

Install

Terminal
npm i @ashutoshswamy/smoui

Usage

TSX
import { QuestionPrompt } from "@ashutoshswamy/smoui";

<QuestionPrompt question="Which environment?" options={options} allowOther onSubmit={answer} />

Props 5

question

The question.

string
options

id, label, optional hint.

QuestionOption[]
multiple

Allow several answers.

boolean
allowOther

Adds a free-text row.

boolean
onSubmit / onSkip

Gets { ids, other }.

function