Home Manual Reference Source Repository
import RadioButtonGroup from 'mrn/lib/RadioButtonGroup.js'
public class | source

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

Member Summary

Public Members
public

state: {selected: *}

public get

Get the value of checked RadioButton in RadioButtonGroup.

public set

value(value: string): *

Specifies that which RadioButton should be pre-selected

Public Constructors

public constructor(props: object) source

Params:

NameTypeAttributeDescription
props object
props.name string

RadioButtonGroup name. Often use in form

props.theme enum(THEME_NAME)
  • optional

RadioButton theme option

props.primary enum(COLOR_NAME)
  • optional

RadioButton primary color name. Specifies that which RadioButton should be pre-selected

props.value string
  • optional

The value of checked RadioButton

props.onSelect function(value: string)
  • optional

When RadioButtonGroup value change will trigger this function

Public Members

public state: {selected: *} source

public get value: string: * source

Get the value of checked RadioButton in RadioButtonGroup. Often use in form.

Return:

string

public set value(value: string): * source

Specifies that which RadioButton should be pre-selected