Form

Input

React Native Store UI Template provides 2 types of input element to receive user input. These components are built on top of react native TextInput and accept all of TextInput props.

FloatingLabelInput

FloatingLabelInput accepts all props as react native TextInput along with 1 additional required props label to set label of input field.

Sample

import React from 'react';
import { Wrapper, Container, FloatingLabelInput } from '../utils';

class App extends React.Component {
    render() {
        return (
            <Wrapper>
                <Container>
                    <FloatingLabelInput 
    										label="Name"  
    										onChangeText={(text) => this.setState({name: text})}
    										value={this.state.name}
    									/>
                </Container>
            </Wrapper>
        );
    }
}

Output

LabelIconInput

LabelIconInput accepts all props as react native TextInput along with 2 additional required props label and icon to set label and icon of input field.

Icons name can be taken from feather icons website.

Sample

import React from 'react';
import { Wrapper, Container, LabelIconInput } from '../utils';

class App extends React.Component {
    render() {
        return (
            <Wrapper>
                <Container>
                    <LabelIconInput 
    										label="Name"  
    										onChangeText={(text) => this.setState({name: text})}
    										value={this.state.name}
    										icon={'user'}
    								/>
                </Container>
            </Wrapper>
        )
    }
}

Output

Picker

React Native Store UI Template provides a custom picker Picker with auto search functionality same for both android and iOS. It can display with other form elements like FloatingLabelInput as it contains the same styles

Sample

import React from 'react';
import { Wrapper, Container, Picker } from '../utils';

class App extends React.Component {
    render() {
        return (
            <Wrapper>
                <Container>
                     <Picker 
    												label="Country"  
    												onChangeItem={(item) => this.setState({country: item.label})}
    												value={this.state.country}
    												items={countries}
    							    />
                </Container>
            </Wrapper>
        )
    }
}

Output

Checkbox

React Native Store UI Template provides a checkbox component including 2 props as follow

Sample

import React from 'react';
import { Wrapper, Container, Checkbox } from '../utils';

function App() {
    return (
        <Wrapper>
            <Container>
                 <Checkbox 
												onPress={() => this.setState({field: !this.state.field})}
							          selected={this.state.field === true}
							    />
            </Container>
        </Wrapper>
    )
}

Last updated