Components
Components are stateless rect elements. They render what you pass to them and call function as callbacks. Components are essential part of the app. Here's the list of available components:

Button

Regular Button can be rendered like this:
1
<Button
2
style={styles.demoButton}
3
primary
4
caption="Button"
5
onPress={this.buttonClicked}
6
/>
Copied!
Button component takes the following props:
Prop name
Type
Description
primary
boolean
Make button BG primary colored
secondary
boolean
Make button BG secondary colored
bordered
boolean
Button without bg, but with borders
rounded
boolean
Adds border radius to componen
small
boolean
Renders small button
icon
Icon for the button
caption
string
Button's label
onPress
function
onPress handler
bgColor
string
Background color
textColor
string
Text color
bgGradientStart
string
Color of gradient bg start
bgGradientEnd
string
Color of gradient bg end
action
boolean
Renders action button
loading
boolean
Renders loading indicator

Radio Group

Renders a tab-style radio group.
Can be rendered:
1
<RadioGroup
2
style={styles.demoItem}
3
items={['One', 'Two', 'Three']}
4
selectedIndex={props.radioGroupsState[0]}
5
onChange={index => props.setRadioGroupsState({ ...props.radioGroupsState, 0: index })}
6
/>
Copied!
Component's props:
Prop name
Type
Description
items
array[string]
Items to render on the Radio button
secondary
boolean
Renders secondary-styles radio group
rounded
boolean
Renders radio group with rounded corners
underline
boolean
Renders underline-styled radio button
onChange
function
Called when the button in the group is clicked
selectedIndex
number
Index of selected item
Use the dropdown this way:
1
<Dropdown
2
onSelect={() => {}}
3
items={['option 1', 'option 2']}
4
/>
Copied!
Dropdown's props:
Prop name
Type
Description
onSelect
function
Callback that called after the item is selected
items
array[string]
Items for the dropdown
Last modified 3yr ago
Copy link