npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-native-cross-select

v0.0.7

Published

React Native Cross Select Component With Portal

Downloads

5

Readme

react-native-cross-select

Select component for react native

Features

  • Using Portal
  • Multiple and Single Select
  • Searchable Select
  • Fully Modifiable

Installation

With NPM

npm install react-native-cross-select

With YARN

yarn add react-native-cross-select

Usage

  • Add provider to main app file
import { SelectProvider } from 'react-native-cross-select';

const Index = () => (
  <SelectProvider>
    <App />
  </SelectProvider>
);

Components

  • Single Select
import Select, { ISelect } from 'react-native-cross-select';

const DATA = [
    {
        label:"Input 1",
        value:1
    },
    {
        label:"Input 2",
        value:2
    }
]

const App = () => {
    const handleChange:ISelect.Select.SelectOnSelectProp = (data) => {
        console.log('Data: ', data);
    };
    
    return(
        <Select data={DATA} onSelect={handleChange} />
    )
};

  • Multiple Select
import { ISelect, MultipleSelect } from 'react-native-cross-select';

const DATA = [
    {
        label:"Input 1",
        value:1
    },
    {
        label:"Input 2",
        value:2
    }
]

const App = () => {
    const handleMultipleChange:ISelect.Select.MultipleSelectOnSelectProp = (data) => {
        console.log('Datas: ', data);
    };
    
    return(
        <MultipleSelect data={DATA} onSelect={handleMultipleChange} />
    )
};

  • Single Select With Search
import Select, { ISelect } from 'react-native-cross-select';

const DATA = [
    {
        label:"Input 1",
        value:1
    },
    {
        label:"Input 2",
        value:2
    }
]

const App = () => {
    const handleChange:ISelect.Select.SelectOnSelectProp = (data) => {
        console.log('Data: ', data);
    };
    
    return(
        <Select data={DATA} onSelect={handleChange} searchable />
    )
};

  • Multiple Select With Search
import { ISelect, MultipleSelect } from 'react-native-cross-select';

const DATA = [
    {
        label:"Input 1",
        value:1
    },
    {
        label:"Input 2",
        value:2
    }
]

const App = () => {
    const handleMultipleChange:ISelect.Select.MultipleSelectOnSelectProp = (data) => {
        console.log('Datas: ', data);
    };
    
    return(
        <MultipleSelect data={DATA} onSelect={handleMultipleChange} searchable />
    )
};

Props

| Name | Description | Type | Default | Required |---|---|---|---|---| | data | Data array | {label:string; value:string|number}[] (Array of data object) | [] | true | | placeholder | Placeholder for select box | string | Please select... (if searchable true then it's "Search here...") | false | | width | width of select box | number | 250 | false | | height | height of select box | number | 40 | false | | boxClosedBorderColor | Box border color while it's close state | string | - | false | | boxOpenedBorderColor | Box border color while it's open state | string | - | false | | closeOnSelect | Close on select (it's only for single select) | boolean | true | false | | onSelect | Callback function to handle change | function | - | true | | placeHolderTextStyle | Custom text style for placeholder | RN style object | {} | false | | textStyle | Custom text style | RN style object | {} | false | | arrowColorOnSelected | Arrow color while select box open state | string | - | false | | arrowColor | Arrow color while select box close state | string | - | false | | backgroundColor | Background color of box | string | - | false | | searchable | Searchable support | boolean | - | false | | listItemTextStyle | Custom text style for list item | RN style object | {} | false | | listBoxBackgroundColor | List box background color | string | - | false | | maxListHeight | Max list height | number | - | false | | listItemSelectedTextStyle | Custom text style for list item while selected state | RN style object | {} | false | | listItemSelectedBackgroundColor | Custom style for list item while selected state | RN style object | {} | false | | notFoundTextStyle | Not found text style | RN style object | {} | false | | noDataText | No data text | string | No data found | false | | defaultValue | Default value [For single select] | string | - | false | | defaultValues | Default values [For multiple select] | array | - | false |


Thanks for


License

MIT