4.0.2 • Published 4 months ago

react-native-search-select v4.0.2

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

: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

PropertyTypeRequiredDescription
placeholderStringFalseplaceholder of the searchbar TextInput
optionsarray of { key: string; label: string; selected: boolean }Truearray of items to search and select
setOptionsfunctionFalsefunction that set the value of options array
multipleSelectBooleanTrueif the search should allow to select multiple options or not
isPaginatedBooleanFalseif the list is paginated (default is false)
pageSizeNumberFalsein case the list is paginated, what would be the number of items of every page
showSelectedOptionsOnTopBooleanFalseboolean value that says if the selected option should appear on the top of the bar
showSelectedOptionsCounterBooleanFalseboolean value to show a counter of selected options. Shows nothing when there is no selected options.
onSelectOptionFunctionFalsefunction called when the option is selected. Use as (selectedIndex, selectedOption) => {}
setIsShowingListfunctionFalsefunction that sets a boolean value that says if the list is showing or not
setHasSelectedOptionsfunctionFalsefunction that sets a boolean value that says if there is any option selected

Styling props

PropertyTypeRequiredDescription
placeholderTextColorStringFalsecolor of the placeholder of the searchbar TextInput
searchTextColorStringFalsecolor of the text of the serch in the serachbar TextInput. It can also be set in the inputStyle
searchContainerStyleViewStyleFalsestyle of the View that wraps the searchBar
itemListContainerStyleViewStyleFalsestyle of the View that wraps individually the result of the search
inputStyleViewStyleFalsestyle of the searchbar TextInput
optionsOnTopContainerStyleViewStyleFalsestyle of every view that wraps the selected option at the top of the bar
optionsOnTopTextStyleTextStyleFalsestyle of the text in selected options in the top of the bar
counterTextStyleTextStyleFalsestyle of the text of the selected options counter
counterContainerStyleViewStyleFalsestyle of the view of the selected options counter
paginationWrapContainerStyleViewStyleFalsestyle of the pagination container, applied into ListFooterComponentStyle and into the style of the view that wraps the component
paginationComponentContainerStyleViewStyleFalsestyle 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
paginationComponentTextStyleTextStyleFalsestyle of every text that appears into the pagination component

Animation props

PropertyTypeRequiredDescription
animationListStringFalsename of the choosen react-native-animatable animation for the entrance of the list
animationInputStringFalsename of the choosen react-native-animatable animation for the entrance of the input

Icon props

PropertyTypeRequiredDescription
IconSourceReact-native-vector-icons icon componentTruename of the selected source of the React-native-vector-icons source
searchIconStringFalsename 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
searchIconColorStringFalsecolor of the icon that represent the search. Default is 'black'
searchIconSizeNumberFalsesize of the icon that represent the search. Default is 6% of the width
closeIconStringFalsename 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
closeIconColorStringFalsecolor of the icon that represent closing the search. Default is 'black'
closeIconSizeNumberFalsesize of the icon that represent closing the search. Default is 6% of the width
optionSelectedIconStringFalsename 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
optionSelectedIconColorStringFalsecolor of the icon when the option is selected. Default is 'black'
optionSelectedIconSizeNumberFalsesize of the icon when the option is selected. Default is 6% of the width
closeTopOptionIconStringFalsename of the icon that it will represent when an option at the top of the bar will be deleted
closeTopOptionIconSizeNumberFalsesize of the icon the icon that it will represent when a selected option at the top of the bar will set as unselected
closeTopOptionIconColorStringFalsecolor 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

2) Create a test project in the same folder where you cloned the repository

npx react-native init teste --template react-native-template-typescript

3) Install the library at "teste" by following the Getting Started steps

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

yarn compile

5) Create your branch, commit and push your changes

6) 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

4.0.2

4 months ago

4.0.1

5 months ago

4.0.0

6 months ago

3.1.1

8 months ago

3.1.0

9 months ago

3.0.9

9 months ago

3.0.8

1 year ago

3.0.7

1 year ago

3.0.6

1 year ago

3.0.5

1 year ago

3.0.4

1 year ago

3.0.3

1 year ago

3.0.2

1 year ago

3.0.1

1 year ago

1.2.3

1 year ago

1.2.2

1 year ago

1.2.1

1 year ago