Argent

RadioGroup

One choice from a few.

Plan
import { RadioGroup } from '@rajatweb/argent'

<RadioGroup
  label="Plan"
  options={[
    { value: 'starter', label: 'Starter' },
    { value: 'growth', label: 'Growth' },
  ]}
  onValueChange={setPlan}
/>

Props

PropTypeDefaultWhat it does
label requiredstring
options requiredreadonly Option[]
defaultValuestring
disabledboolean
errorstringError text. Also marks the field invalid.
hintstringHelp text under the field.
onValueChange(value: string) => void
requiredboolean
valuestring

Accessibility

  • Arrow keys move between options on the web.

Do

  • Use it for two to five options.

Don’t

  • Use it for long lists. Use Select.