0.1.2 • Published 6 years ago

react-native-hardskilled-picker v0.1.2

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

Data Picker for React Native

Example

Installation

npm install react-native-hardskilled-picker --save

Example

import React, { Component } from 'react';
import { Text } from 'react-native';
import Picker from 'react-native-hardskilled-picker';

export default class Example extends Component {
    constructor(props) {
        super(props);
        this.state = { array: [] };
    }

    componentWillMount() {
        const array = [];
        for (let i = 0; i < 24; i++) {
            array.push({ value: i, label: `It's ${i}` });
        }

        this.setState({
            array: array
        });
    }

    handlerOnChange(item) {
        console.warn(item);
    }

    render() {
        return (
            <Picker
                array={this.state.array} // List of elements
                elements={5} // Number of elements shown
                onChange={this.handlerOnChange} // onChange callback
                upButton={<Text>Woo UP!</Text>} // Component for "up" button
                downButton={<Text>Woo Down!</Text>} // Component for "down" button
                buttonsStyles={{ backgroundColor: '#ccc' }} // Style for button
                currentTextStyles={{ color: 'orange' }} // Style for current element
                currentTopStyles={{ borderTopColor: 'orange' }} // Style for top border
                currentBottomStyles={{ borderBottomColor: 'orange' }} // Style for bottom border
                textItem={{ fontSize: 20 }} // Text item style
                viewItem={{ height: 26 }} // View item style
                value={5} // Default value
            />
        );
    }
}

Hire us via Upwork! | Our website

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago

0.0.9

7 years ago

0.0.8

7 years ago

0.0.7

7 years ago

0.0.6

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago