RadioButtonGroup
Extends:
react-native~Component → RadioButtonGroup
RadioButtonGroup Component
Example:
<RadioButtonGroup ref="Group1" primary={primary} name="group1" onSelect={(value) => {
this.setState({group1Selected: value});
}}>
<RadioButton value="1" label="RadioButton On" checked={true}/>
<RadioButton value="2" label="RadioButton Off"/>
<RadioButton value="3" label="RadioButton Off Disabled" disabled={true}/>
<RadioButton value="4" disabled={true}/>
</RadioButtonGroup>
<View style={[styles.content,styles.action]}>
<Text style={{flex:1}}>Selected {this.state.group1Selected}</Text>
<Button raised={true} value="Press to select 2"
onPress={()=>{this.refs.Group1.value = 2}}/>
</View>
Constructor Summary
Public Constructor | ||
public |
constructor(props: object) |
Member Summary
Public Members | ||
public |
state: {selected: *} |
|
public get |
Get the value of checked RadioButton in RadioButtonGroup. |
|
public set |
Specifies that which RadioButton should be pre-selected |
Public Constructors
public constructor(props: object) source
Params:
Name | Type | Attribute | Description |
props | object | ||
props.name | string | RadioButtonGroup name. Often use in form |
|
props.theme | enum(THEME_NAME) |
|
RadioButton theme option |
props.primary | enum(COLOR_NAME) |
|
RadioButton primary color name. Specifies that which RadioButton should be pre-selected |
props.value | string |
|
The value of checked RadioButton |
props.onSelect | function(value: string) |
|
When RadioButtonGroup value change will trigger this function |