Skip to content

Radio Group

The Radio Group component lets users pick one single option out of a list.

PropertyTypeRequiredDescription
type"radio"YesIdentifies the field
optionsArray<{ label: string; value: string; icon?: ReactNode }>YesOptions to display
schemaz.ZodTypeYesShould validate selected value
Gender selection
basic-radio.tsx
import { z } from "zod";
import { createExampleForm } from "../createExampleForm";
export const BasicRadio = createExampleForm({
formId: "basic-radio",
fields: {
gender: {
type: "radio",
label: "Gender",
options: [
{ label: "Male", value: "male" },
{ label: "Female", value: "female" },
{ label: "Other", value: "other" },
],
schema: z.string().min(1, "Please choose an option"),
},
},
steps: {
step1: {
id: "step1",
fields: ["gender"],
},
},
});
  • Each item is tabbable and announced via screen readers.
  • Label for/id connections are handled for you.