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-search-select

v4.0.2

Published

An animated searchbar component so you can search and select objects

Downloads

12

Readme

:information_source: About the project

This project was made for my final paper in the Computer Science course at UFES (Federal University of Espírito Santo), where I created this public library to study the acceptance of the developer community with new proposals for reuse.

Please leave a STAR at the repository and contribute to my work.

:rocket: Getting Started

  1. Install react-native-vector-icons and the icon sources you want. In the main example, we use Ionicons. You can see all the sources and its icons here

  2. Install this library. You can use $ yarn add react-native-search-select or $ npm install react-native-search-select

:information_source: Usage

  1. In this example, you can select several objects, also using the counter and the list of selected objects
  1. In this example, you can select a single option in a simple way

:scroll: Props

Configuration props

| Property | Type | Required | Description | | --------------------- | :--------------------------------------------------------: | :------: | ---------------------------------------------------------------------------------------------------------- | | placeholder | String | False | placeholder of the searchbar TextInput | | options | array of { key: string; label: string; selected: boolean } | True | array of items to search and select | | setOptions | function | False | function that set the value of options array | | multipleSelect | Boolean | True | if the search should allow to select multiple options or not | | isPaginated | Boolean | False | if the list is paginated (default is false) | | pageSize | Number | False | in case the list is paginated, what would be the number of items of every page | | showSelectedOptionsOnTop | Boolean | False | boolean value that says if the selected option should appear on the top of the bar | | showSelectedOptionsCounter | Boolean | False | boolean value to show a counter of selected options. Shows nothing when there is no selected options. | | onSelectOption | Function | False | function called when the option is selected. Use as (selectedIndex, selectedOption) => {} | | setIsShowingList | function | False | function that sets a boolean value that says if the list is showing or not | | setHasSelectedOptions | function | False | function that sets a boolean value that says if there is any option selected |

Styling props

| Property | Type | Required | Description | | ---------------------- | :-------: | :------: | ----------------------------------------------------------------------------------------------- | | placeholderTextColor | String | False | color of the placeholder of the searchbar TextInput | | searchTextColor | String | False | color of the text of the serch in the serachbar TextInput. It can also be set in the inputStyle | | searchContainerStyle | ViewStyle | False | style of the View that wraps the searchBar | | itemListContainerStyle | ViewStyle | False | style of the View that wraps individually the result of the search | | inputStyle | ViewStyle | False | style of the searchbar TextInput | | optionsOnTopContainerStyle | ViewStyle | False | style of every view that wraps the selected option at the top of the bar | | optionsOnTopTextStyle | TextStyle | False | style of the text in selected options in the top of the bar | | counterTextStyle | TextStyle | False | style of the text of the selected options counter | | counterContainerStyle | ViewStyle | False | style of the view of the selected options counter | | paginationWrapContainerStyle | ViewStyle | False | style of the pagination container, applied into ListFooterComponentStyle and into the style of the view that wraps the component | | paginationComponentContainerStyle | ViewStyle | False | style of the pagination container individual components, applied the views that wraps the TouchableOpacity component that changes the page, and into the View componenent that wraps the informs the current page | | paginationComponentTextStyle | TextStyle | False | style of every text that appears into the pagination component |

Animation props

| Property | Type | Required | Description | | -------------- | :----: | :------: | ------------------------------------------------------------------------------------------------------------------------------------------------------ | | animationList | String | False | name of the choosen react-native-animatable animation for the entrance of the list | | animationInput | String | False | name of the choosen react-native-animatable animation for the entrance of the input |

Icon props

| Property | Type | Required | Description | | ----------------------- | :----------------------------------------------------------------------------------------------: | :---------------------------------: | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | IconSource | React-native-vector-icons icon component | True | name of the selected source of the React-native-vector-icons source | | searchIcon | String | False | name of the icon that it will represent the search. It will be located in the right of the searchBar TextInput. It will only appears when there isn’t any item selected on the list | | searchIconColor | String | False | color of the icon that represent the search. Default is 'black' | | searchIconSize | Number | False | size of the icon that represent the search. Default is 6% of the width | | closeIcon | String | False | name of the icon that it will represent closing the search. It will be located in the right of the searchBar TextInput. It will only appears when there is selected items on the list | | closeIconColor | String | False | color of the icon that represent closing the search. Default is 'black' | | closeIconSize | Number | False | size of the icon that represent closing the search. Default is 6% of the width | | optionSelectedIcon | String | False | name of the icon that it will represent when the the individual item is selected. It will only appers at the right side of the selected item | | optionSelectedIconColor | String | False | color of the icon when the option is selected. Default is 'black' | | optionSelectedIconSize | Number | False | size of the icon when the option is selected. Default is 6% of the width | | closeTopOptionIcon | String | False | name of the icon that it will represent when an option at the top of the bar will be deleted | | closeTopOptionIconSize | Number | False | size of the icon the icon that it will represent when a selected option at the top of the bar will set as unselected | | closeTopOptionIconColor | String | False | color of the icon the icon that it will represent when a selected option at the top of the bar will set as unselected |

:rocket: How to contribute

  1. Clone the library repository
git clone https://github.com/Danilo-Js/react-native-search-select.git
  1. Create a test project in the same folder where you cloned the repository
npx react-native init teste --template react-native-template-typescript
  1. Install the library at "teste" by following the Getting Started steps

  2. You can test your changes by using the script below. It will compile all the changes and past at the project "teste"

yarn compile
  1. Create your branch, commit and push your changes

  2. Wait for feedback approval

:memo: License

This project is under the MIT license. See the LICENSE for more information.


Made by Danilo José Lima de Oliveira ♥

Get in touch! with me