1.1.33 • Published 3 years ago

react-native-search-engine v1.1.33

Weekly downloads
7
License
GNU
Repository
github
Last release
3 years ago

React Native Search Engine

Alert the library is subject to change at least the next 2 months.

>> Examples

It is a type of search engine like the "html5's browsers input", it can be used to auto-complete words or to search for elements within an array or object.

Documentation

React Native Search Engine Component

NameDescriptionDefaultTypeCriterion
searchKeyIf you are working with an array of objects and you want to search by a specific property that all objects have in common, can put something like 'user.name'""StringOptional
valueIf you want me to submit an initial search""StringOptional
dataThe data to searching ArrayOptional
textInfoStyleText information styles{ }ObjectOptional
buttonEnabledIf you want show or not the buttontrueBooleanOptional
showAllModeIf you want to show all options when it can't find anythingfalseBooleanOptional
showNoResultsDoesn't show the options, but the onChange Element gives me the filtered datafalseBooleanOptional
textInputStyleInput text styles{ }ObjectOptional
placeholderHelp text'Search'StringOptional
containerInputStyleStyles of input text containing{ }ObjectOptional
containerTextInfoStyleStyles of information text containing{ }ObjectOptional
containerTextErrorStyles of input text containing{ }ObjectOptional
textInfoStyleErrorStyles of information text containing{ }ObjectOptional
containerScrollStyleText tag container stylesl{ }ObjectOptional
containerButtonStyleOptions display styles{ }ObjectOptional
containerIconStyleIcon Styles{ }ObjectOptional
onChangeSearchGet the text or objectonChangeSearch={object => setOption(object)}FunctionOptional
customizeComponentInputUsed to return an input componentcustomizeComponentInputObjectOptional
customizComponenteResultIt is used to return an output component({ valueResult, element }) => < CustomizComponenteResult/>FunctionOptional
leftIconThis is used to customize the icon() => < leftIcon/>FunctionOptional
erroryou can set if have or no errorfalseBooleanOptional

When you want to customize the component you need set this customizeComponentInput object:

NameDescriptionDefaultTypeCriterion
InputCutomIt is the input component that you want to setundefineArrayOptional
addPropsInputThe properties that you want to pass to the custom componentundefineObjectOptional

Warning

Strings beginning with the following characters will not be found:

Characters
1+
2:
3(
4*
5?
6\
7[
8.
9^
10|
11)

How Implement

Simpler way

     <SearchEngine
      data={data}
      searchKey={'properties.emails.0'}
      onChangeSearch={object => setOption(object)}
      buttonEnabled={true}
      placeholder={'email'}
    />

Complexer way

    import { Icon } from 'native-base';
    <SearchEngine
      data={data}
      searchKey={'properties.emails.0'}
      onChangeSearch={object => setOption(object)}
      buttonEnabled={true}
      placeholder={'email'}
      containerIconStyle={styles.containerIconStyle}
      containerInputStyle={styles.containerInputStyle}
      containerScrollStyle={styles.containerScrollStyle}
      containerTextInfoStyle={styles.containerTextInfoStyle}
      containerButtonStyle={styles.containerButtonStyle}
      leftIcon={() => <Icon name="arrow-down" />}
    />

Example

EXAMPLE CODE


Make a donation


Author

Johan Navarro | https://johansolution.com


License

GNU ©

1.1.33

3 years ago

1.1.32

4 years ago

1.1.30

4 years ago

1.1.31

4 years ago

1.1.29

4 years ago

1.1.28

4 years ago

1.1.27

4 years ago

1.1.26

4 years ago

1.1.25

4 years ago

1.1.24

4 years ago

1.1.23

4 years ago

1.1.22

4 years ago

1.1.21

4 years ago

1.1.20

4 years ago

1.1.19

4 years ago

1.1.18

4 years ago

1.1.17

4 years ago

1.1.16

4 years ago

1.1.15

4 years ago

1.1.14

4 years ago

1.1.13

4 years ago

1.1.12

4 years ago

1.1.11

4 years ago

1.1.10

4 years ago

1.1.9

4 years ago

1.1.8

4 years ago

1.1.7

4 years ago

1.1.6

4 years ago

1.1.5

4 years ago

1.1.1

4 years ago

1.1.2

4 years ago

1.1.0

4 years ago

1.0.8

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago