Radio
The Radio Button component in React Native provides users with a customizable
interface for selecting options exclusively. It includes properties such as
checked for managing state, onChange for updating state, and styling options
to tailor its appearance.
Props
checked
| Type: |
boolean |
| Description: |
Indicates whether the radio button is checked or not. |
<Radio checked={isChecked} ... />
onChange
| Type: |
(isChecked: boolean) => void |
| Description: |
Callback function invoked when the radio button state changes. |
<Radio onChange={handleCheckboxChange} ... />
style
| Type: |
Style Object |
| Description: |
Description: Custom styles to apply to the radio button container. |
<Radio style={{ color: 'red' }} ... />
prefix
| Type: |
React Node |
| Description: |
Content displayed before the radio button input. |
<Radio prefix={<Text>Select: </Text>} ... />
suffix
| Type: |
React Node |
| Description: |
Content displayed after the radio button input. |
<Radio suffix={<Text>{isChecked ? 'Checked' : 'Unchecked'}</Text>} ... />
color
| Type: |
string
|
| Description: |
Specifies the color of the radio button or its associated elements. |
<Radio color="blue" ... />
justifyContent
| Type: |
string |
| Description: |
Custom 'justifyContent' style to control the alignment of children
along the primary axis of the radio button's layout.
|
<Radio justifyContent="center" ... />
marginHorizontal
| Type: |
number |
| Description: |
Specifies custom horizontal margin for the radio button. |
<Radio marginHorizontal={10} ... />