Radio Group

The `Radio` component is used to select a single option from a list of options. It consists of `Radio.Group` and `Radio.Item`.


Usage

import { Radio } from '@smartacteam/react-native-ui';
<Radio.Group
  value={value}
  onChange={setValue}
  description="Select your preferred option"
>
  <Radio.Item value="option1" label="First Option" />
  <Radio.Item value="option2" label="Second Option" description="This is additional info" />
  <Radio.Item value="option3" label="Third Option" />
</Radio.Group>

Example

Preview

Radio.Group Props

PropTypeDescription
childrenReactElement<ItemProps>[]A list of Radio.Item components
valueanyCurrently selected value
formNamestringOptional identifier for form integration
errorbooleanIf true, shows the description text in error color
descriptionstringText below the group; animates color based on error
onChange(value: Value) => voidCalled when a Radio.Item is selected
styleViewStyleCustom styles for the container

Radio.Item Props

PropTypeDescription
labelstringText label shown for this item
descriptionstringOptional smaller text below the label
valueanyValue represented by this radio item
selectedbooleanControlled by Radio.Group; indicates if item is selected
onSelect(value: Value) => voidCalled when the item is pressed
colorkeyof GlobalColorsTypeOptional color override for selected state
labelFontWeightTextWeightControls font weight of label text
styleTouchableOpacityPropsAdditional style props