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



react-native~Component → CheckboxGroup

CheckboxGroup Component


 <CheckboxGroup ref="CheckboxGroup1" name="group2" onSelect={(value) => {
                      }} primary={primary}>
     <Checkbox value="1" label="Checkbox On" checked={true}/>
     <Checkbox value="2" label="Checkbox Off"/>
     <Checkbox value="3" label="Checkbox On Disabled" checked={true} disabled={true}/>
     <Checkbox value="4" label="Checkbox Off Disabled" disabled={true}/>
     <Checkbox value="5" checked={true}/>
     <Checkbox value="6"/>
 <View style={[styles.content,styles.action]}>
     <Text style={{flex:1}}>Selected {this.state.group2Selected.join(',')}</Text>
     <Button raised={true} value="Press to select 1,2,6" onPress={()=>{this.refs.CheckboxGroup1.value = ['1','2','6']}} />

Constructor Summary

Public Constructor

Member Summary

Public Members

state: {selected: *[]}

public get

value: Array: *

Get the value of checked Checkbox in CheckboxGroup.

public set

value(value: string[]): *

Make CheckboxGroup set some checkbox checked

Public Constructors

public constructor(props: object) source


props object
props.name string

CheckboxGroup name. Often use in form

props.theme enum(THEME_NAME)
  • optional

Checkbox theme option

props.primary enum(COLOR_NAME)
  • optional

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

props.value string[]
  • optional
  • default: []

A array save the values of checked Checkbox

props.onSelect function(value: string)
  • optional

When CheckboxGroup value change will trigger this function

Public Members

public state: {selected: *[]} source

public get value: Array: * source

Get the value of checked Checkbox in CheckboxGroup. Often use in form.



public set value(value: string[]): * source

Make CheckboxGroup set some checkbox checked