SSocratic UI

Single Select

Open in playground

Pick one option from a list. Supports an optional freeform note for extra context, and tapping a selected option clears it.

Preview

01

How are you building this product?

Pick the option that best describes your setup

Usage

import { SingleSelect } from "@/components/socratic-ui/single-select";

const [value, setValue] = useState<string | null>(null);

<SingleSelect
  question="How are you building this product?"
  options={[
    { title: "Solo founder" },
    { title: "Co-founding team" },
  ]}
  value={value}
  onChange={setValue}
/>

API Reference

PropTypeDefault
questionrequired

The headline shown above the options.

string
subtitle

Optional supporting copy beneath the question.

string
optionsrequired

The list of selectable options.

{ title: string; subtitle?: string }[]
valuerequired

Title of the currently selected option, or null.

string | null
onChangerequired

Called when the selection changes. Tapping a selected option clears it.

(value: string | null) => void
number

Optional leading question number, e.g. "01".

string
freeformPlaceholder

When provided, renders an extra textarea beneath the options.

string
freeformValue

Controlled value for the freeform textarea.

string
onFreeformChange

Controlled setter for the freeform textarea.

(value: string) => void