Skip to main content

Radio

Component for selecting a single option. Supports custom sizes, statuses, positions, default values, and full styling customization.

Usage

Enable Awesome Feature
function RadioUsage() {
const [isOn, setIsOn] = useState(false)

return (
<View>
<Radio
label="Enable Awesome Feature"
value={isOn}
onValueChange={setIsOn}
/>
</View>
)
}

Status

primary
accent
success
info
warning
error
function RadioStatuses() {
return (
<View style={{justifyContent: 'space-evenly'}}>
<Radio
status="primary"
label="primary"
containerStyle={styles.container}
/>
<Radio status="accent" label="accent" containerStyle={styles.container} />
<Radio
status="success"
label="success"
containerStyle={styles.container}
/>
<Radio status="info" label="info" containerStyle={styles.container} />
<Radio
status="warning"
label="warning"
containerStyle={styles.container}
/>
<Radio status="error" label="error" containerStyle={styles.container} />
</View>
)
}

Size

small
medium
large
function RadioSizes() {
return (
<View row style={{justifyContent: 'space-evenly'}}>
<Radio label="small" size="small" />
<Radio label="medium" size="medium" />
<Radio label="large" size="large" />
</View>
)
}

Disabled

Use the disabled prop to make radio buttons non-interactive.

󰐽
Disabled
󰐽
Disabled
󰐽
Disabled
function RadioDisabled() {
return (
<View row style={{justifyContent: 'space-evenly'}}>
<Radio label="Disabled" disabled />
<Radio label="Disabled" value status="primary" disabled />
<Radio label="Disabled" size="large" disabled />
</View>
)
}

Positions

Use the position & adjacent prop together to place the label on the left or right of the radio button & spacing between them.

Left Adjacent Position
Right Adjacent Position
Right Adjacent Position
Right Adjacent Position
Left Position
Right Adjacent Position
Right Position
Right Adjacent Position
function RadioPositions() {
return (
<View>
<Radio
label="Left Adjacent Position"
caption="Right Adjacent Position"
containerStyle={styles.container}
/>
<Radio
label="Right Adjacent Position"
caption="Right Adjacent Position"
position="right"
containerStyle={styles.container}
/>
<Radio
caption="Right Adjacent Position"
label="Left Position"
adjacent={false}
containerStyle={styles.container}
/>
<Radio
caption="Right Adjacent Position"
label="Right Position"
position="right"
adjacent={false}
containerStyle={styles.container}
/>
</View>
)
}

Default Value

Use defaultValue to preselect a radio button when the component mounts.

󰐾
function RadioDefaultValue() {
return (
<View>
<Radio defaultValue />
</View>
)
}

Custom

Agree to T&C
Click here to see Privacy Policy
Please Agree to T&C to continue
Centered color Radio

Props

PropData TypeDefault ValueDescription
ExtendsRNSwitchProps--Inherits properties from RNSwitchProps
position"left" | "right"rightControl the position of the field
adjacentbooleantrueSet it to false to position them apart i.e. space-between
defaultValuebooleanfalseDefault value for the field
colorstring--Set custom color
labelstring--Label text above the input
captionstring--Caption text below the text input
errorstring--Error text in error `status` below caption text
containerStyleStyleProp<ViewStyle>--Container view style
textFieldsContainerStyleStyleProp<ViewStyle>--Text field Container view styleContainer for label, caption & error i.e. the right/left section opposite to the boolean field
labelStyleStyleProp<TextStyle>--Label text style
captionStyleStyleProp<TextStyle>--Caption text style
errorStyleStyleProp<TextStyle>--Error text style
statusBlossomStatusprimaryStatus of the component to apply color variants'primary' | 'accent' | 'success' | 'info' | 'warning' | 'error'
sizeBlossomSizemediumSize of the component'small' | 'medium' | 'large'