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

Button

Extends:

react-native~Component → Button

Button Component

Example:


<Subheader text="Light Theme"/>
<View style={styles.content}>
<Button value="NORMAL FLAT" primary={primary} onPress={()=> console.log(this.refs)}/>
<Button value="DISABLED FLAT" disabled={true} primary={primary}/>
<Button value="NORMAL RAISED" raised={true} primary={primary}/>
<Button value="DISABLED RAISED" disabled={true} raised={true} primary={primary}/>
</View>
<Subheader text="Dark Theme"/>
<View style={{
           backgroundColor: COLOR.paperGrey900.color,
           padding: 16,
       }}>
<Button value="NORMAL FLAT" theme="dark" primary={primary}/>
<Button value="DISABLED FLAT" disabled={true} theme="dark" primary={primary}/>
<Button value="NORMAL RAISED" theme="dark" raised={true} primary={primary}/>
<Button value="DISABLED RAISED" disabled={true} theme="dark" raised={true} primary={primary}/>
</View>

Constructor Summary

Public Constructor
public

Public Constructors

public constructor(props: object) source

Params:

NameTypeAttributeDescription
props object
props.value string

Button Text. If language is english, all letters should be capitalized.

props.disabled boolean
  • optional
  • default: false

if true, Button can't be pressed

props.theme enum(THEME_NAME)
  • optional
  • default: 'light'

Button Theme

props.primary enum(COLOR_NAME)
  • optional
  • default: PRIMARY

Primary color name

props.raised boolean
  • optional
  • default: false

Whether Button looks like raised or not. If in a Modal, should not be true

props.onPress function
  • optional

Function will be triggered when click the Button