0.1.14 • Published 11 months ago

@chainplatform/dropdown v0.1.14

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

React Native Dropdown

@chainplatform/dropdown is a React Native library that provides a Dropdown component for react-native and react-native-web.

Install

npm install @chainplatform/dropdown --save

or

yarn add @chainplatform/dropdown

Usage

import React from 'react';
import {StyleSheet} from 'react-native';
import CheckBox from '@chainplatform/dropdown';

class App extends React.Component {

    constructor(props) {
        super(props);

        this.state = {
            lists: [{label: "the First"}],
            open: false,
            idefaultIdex: -1,
        };

        this.exchangeRef = React.createRef(null);
    }


  onSelectExchange(index, item) {
    console.log("onSelectExchange ", index, item);
  }

  render() {
    return (
      <View style={{flex:1}}>
            <Dropdown
                            ref={this.exchangeRef}
                            placeholder={"search"}
                            containerStyle={{
                                width: "100%",
                                borderRadius: 4,
                                borderColor: "#DDD",
                                borderWidth: 1,
                                flexDirection: "row",
                                alignItems: "center"
                            }}
                            textStyle={{
                                fontSize: 13,
                                textAlign: "left",
                                padding: 11.5
                            }}
                            stickerStyle={{
                                marginRight: 8,
                                justifyContent: "center",
                                alignItems: "center",
                                width: 20,
                                height: 20,
                                color: "#DDD"
                            }}
                            dropdownContainerStyle={{
                                width: "100%",
                                maxHeight: 165,
                                maxWidth: 430,
                                borderColor: "#DDD",
                                borderWidth: 1,
                            }}
                            defaultIndex={this.state.idefaultIdex}
                            data={this.state.lists}
                            onSelect={(selected, item) => this.onSelectExchange(selected, item)}
                        />
      </View>
    );
  }
}
0.1.10

11 months ago

0.1.11

11 months ago

0.1.12

11 months ago

0.1.13

11 months ago

0.1.14

11 months ago

0.1.8

11 months ago

0.1.7

11 months ago

0.1.9

11 months ago

0.1.4

11 months ago

0.1.6

11 months ago

0.1.5

11 months ago

0.1.3

11 months ago

0.1.2

12 months ago

0.1.1

12 months ago

0.1.0

12 months ago