RadioButton
Radio buttons helps to implement selection between multiple options, on the low level it uses TouchableOpacity
of React-Native
Usage
import { RadioButton } from 'frontatish';
<RadioButton
value="selected"
onPress={() => void}
selected={true}
/>;
Props
value
The value of radio button
Type | Default | Required |
---|---|---|
string | None | Yes |
selected
Flag which helps to mark radio button selected or not
Type | Default | Required |
---|---|---|
boolean | false | Yes |
onPress
Callback function which sets the selected value in the parent state
Type | Default | Required |
---|---|---|
function | None | Yes |
size
you can control the size of the checkbox and the icon inside by using this props
Type | Default | Required |
---|---|---|
enum('sm', 'md', 'lg') | 'sm' | No |
disabled
Flag to decide whether to disable the press on radio button or not
Type | Default | Required |
---|---|---|
boolean | false | No |
disabledStyle
Coming soon!!
containerStyle
A react native View style object which gives flexibility to alter the styles of radio-button container
Type | Default | Required |
---|---|---|
ViewStyle | none | No |
labelStyle
A react native Text style object which gives flexibility to alter the styles of label of the radio-button
Type | Default | Required |
---|---|---|
TextStyle | none | No |
customLabel
A react component to render a custom label for your radio button
Type | Default | Required |
---|---|---|
JSX.Element | none | No |