Skip to Content
ComponentsInputRadioGroup

RadioGroup

Exclusive choice with a string value. optionType="button" renders a segmented control instead of radios.

Plan
View
import { RadioGroup } from '@gg-software/ui'; <RadioGroup label="Plan" options={[ { label: 'Basic', value: 'basic' }, { label: 'Pro', value: 'pro' }, ]} value={plan} onChange={(value) => setPlan(value)} /> // segmented control <RadioGroup optionType="button" direction="horizontal" options={views} />

Props

PropTypeDefaultDescription
options*RadioGroupOption[]
valuestring
defaultValuestring
onChange((value: string) => void)
disabledbooleanfalse
direction"horizontal" | "vertical"vertical
optionType"default" | "button"default"default" = radios, "button" = segmented control
labelReactNode
hintReactNode
errorReactNode
requiredboolean
namestring
classNamestring

* required · generated from packages/ui/src/input/RadioGroup/RadioGroup.tsx

Types

type RadioGroupOption = { label: ReactNode; value: string; disabled?: boolean; };