New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

react-native-chooser

Package Overview
Dependencies
Maintainers
2
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-chooser

Simple Cross platform SELECT tag for React-Native

latest
Source
npmnpm
Version
1.7.0
Version published
Weekly downloads
16
100%
Maintainers
2
Weekly downloads
 
Created
Source

React Native Chooser

Simple DropDown menu for React Native App! Your Select Tag for React Native. Fully Customizable too.

Introduction

React Native Chooser is simple, customizable and easy to use dropdown in React Native. It has been tested on both Android and IOS and works like a charm.

Installation

npm i react-native-chooser --save

Usage

import React, { Component } from 'react';
import {Select, Option} from "react-native-chooser";

import {
  AppRegistry,
  StyleSheet,
  Text,
  View
} from 'react-native';

export default class AwesomeProject extends Component {

  constructor(props) {
    super(props);
    this.state = {value : "Select Me Please"}
  }
  onSelect(value, label) {
    this.setState({value : value});
  }

  render() {
    return (
      <View style={styles.container}>
        <Select
            onSelect = {this.onSelect.bind(this)}
            defaultText  = {this.state.value}
            style = {{borderWidth : 1, borderColor : "green"}}
            textStyle = {{}}
            backdropStyle  = {{backgroundColor : "#d3d5d6"}}
            optionListStyle = {{backgroundColor : "#F5FCFF"}}
          >
          <Option value = {{name : "azhar"}}>Azhar</Option>
          <Option value = "johnceena">Johnceena</Option>
          <Option value = "undertaker">Undertaker</Option>
          <Option value = "Daniel">Daniel</Option>
          <Option value = "Roman">Roman</Option>
          <Option value = "Stonecold">Stonecold</Option>
          <Option value = "Rock">Rock</Option>
          <Option value = "Sheild">Sheild</Option>
          <Option value = "Orton">Orton</Option>

        </Select>
      </View>
    );
  }
}

Props

Props for Select

Prop NameData TypeDefault ValuesDescription
onSelectfunctionnullfunction that executes on selection of an option
defaultTextstringClick To SelectText to show as default text
styleobjectnullTo style the select box.
backdropStyleobjectnullTo style the overlay
textStyleobjectnullTo style the text shown in the box
optionListStyleobjectnullTo style the selection box
transparentbooleanfalseTo set the transparent prop on Modal
animationTypestring"none"To set the animationType prop on Modal
indicatorstring"none", "up" or "down""none"
indicatorColorstring"black"The color of the indicator arrow
indicatorSizenumber10The size of the indicator arrow
indicatorStyleobjectnullTo style the indicator arrow
indicatorIconreact elementnullShow the indicator icon
selectedstringnullGive it same value as you give to Option
selectedStyleobjectnullApply styles to the selected Option

Functions for Select

Function NameDescription
setSelectedText(text)Set default text in the select option, often used to reset text.

Props for Option

Prop NameData TypeDefault ValuesDescription
styleobjectnullTo style each option
styleTextobjectnullTo style the text shown in the option

Demo

IOS and Android:

Contributions

Your contributions and suggestions are heartily♡ welcome. (✿◠‿◠)

Keywords

react-native

FAQs

Package last updated on 29 Nov 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts