{"id":4041,"url":"https://github.com/react-native-vietnam/react-native-search-box","last_synced_at":"2025-08-04T00:31:03.553Z","repository":{"id":44746049,"uuid":"83567423","full_name":"react-native-vietnam/react-native-search-box","owner":"react-native-vietnam","description":"A simple search box with animation, inspired from ios search bar. Lightweight, fast, flexible.","archived":false,"fork":false,"pushed_at":"2023-04-18T06:29:22.000Z","size":85,"stargazers_count":476,"open_issues_count":39,"forks_count":132,"subscribers_count":12,"default_branch":"master","last_synced_at":"2024-10-29T13:49:53.651Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/react-native-vietnam.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2017-03-01T15:04:40.000Z","updated_at":"2024-07-31T20:18:19.000Z","dependencies_parsed_at":"2023-07-18T00:51:56.967Z","dependency_job_id":null,"html_url":"https://github.com/react-native-vietnam/react-native-search-box","commit_stats":null,"previous_names":["agiletechvn/react-native-search-box","crabstudio/react-native-search-box"],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/react-native-vietnam%2Freact-native-search-box","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/react-native-vietnam%2Freact-native-search-box/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/react-native-vietnam%2Freact-native-search-box/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/react-native-vietnam%2Freact-native-search-box/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/react-native-vietnam","download_url":"https://codeload.github.com/react-native-vietnam/react-native-search-box/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228576892,"owners_count":17939645,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-01-05T20:16:59.308Z","updated_at":"2024-12-07T07:30:57.381Z","avatar_url":"https://github.com/react-native-vietnam.png","language":"JavaScript","funding_links":[],"categories":["Components","JavaScript"],"sub_categories":["UI"],"readme":"## React Native Search Box\n- A simple search box with animation, inspired from ios search bar.\n- Lightweight, fast, flexible, customizable.\n- Support both iOS/Android devices\n- Support vertical, horizontal layout\n- Shadow invisible by default\n\n## Install\n```\nnpm install --save react-native-search-box\n\nor\n\nyarn add react-native-search-box\n```\n\n## Demo\n\n| Platform | Android | iOS |\n|:--------:|:-------:|:---:|\n| Demo | ![Android](https://media.giphy.com/media/3oKIPja49woFsDBuPC/giphy.gif) | ![iOS](https://media.giphy.com/media/3oKIPvb7oymPsobWI8/giphy.gif) |\n\n## Example code\n\n[Example](https://github.com/agiletechvn/react-native-atoz-listview/blob/master/example/src/screens/Contacts/Home.js#L162)\n\n## Usage\n\n```javascript\nimport React, { PureComponent } from 'react';\nimport { TouchableHightLight, Text, View } from 'react-native';\nimport AtoZListView from 'react-native-atoz-listview';\nimport Search from 'react-native-search-box';\n\nconst rowHeight = 40;\n\nclass MyScene extends PureComponent {\n\n  state = {\n    data: {\n      \"A\": [\n        {\n          \"name\": \"Anh Tuan Nguyen\",\n          \"age\": 28\n        },\n        {\n          \"name\": \"An Nhien\",\n          \"age\": 2\n        },\n      ],\n      \"Z\": [\n        {\n          \"name\": \"Thanh Tu Pham\",\n          \"age\": 32\n        },\n        {\n          \"name\": \"Tien Thanh\",\n          \"age\": 24\n        },\n      ]\n    }\n  }\n\n    renderRow = (item, sectionId, index) =\u003e {\n      return (\n        \u003cTouchableHightLight\n          style={{\n            height: rowHeight,\n            justifyContent: 'center',\n            alignItems: 'center'}}\n        \u003e\n          \u003cText\u003e{item.name}\u003c/Text\u003e\n        \u003c/TouchableHightLight\u003e\n      );\n    }\n\n    // Important: You must return a Promise\n    onSearch = (searchText) =\u003e {\n        return new Promise((resolve, reject) =\u003e {\n            console.log(searchText);\n            console.log('Add your search function here.');\n            resolve();\n        });\n    }\n    \n    // Important: You must return a Promise\n    beforeFocus = () =\u003e {\n        return new Promise((resolve, reject) =\u003e {\n            console.log('beforeFocus');\n            resolve();\n        });\n    }\n\n    // Important: You must return a Promise\n    onFocus = (text) =\u003e {\n        return new Promise((resolve, reject) =\u003e {\n            console.log('onFocus', text);\n            resolve();\n        });\n    }\n\n    // Important: You must return a Promise\n    afterFocus = () =\u003e {\n        return new Promise((resolve, reject) =\u003e {\n            console.log('afterFocus');\n            resolve();\n        });\n    }\n\n  render() {\n    // inside your render function\n    return (\n      \u003cView style={{ flex: 1}}\u003e\n        \u003cSearch\n          ref=\"search_box\"\n          onSearch={this.onSearch}\n          /**\n          * There many props that can customizable\n          * Please scroll down to Props section\n          */\n        /\u003e\n\n        \u003cAtoZListView\n          data={this.state.data}\n          renderRow={this.renderRow}\n          rowHeight={rowHeight}\n          sectionHeaderHeight={40}\n        /\u003e\n      \u003c/View\u003e\n    );\n  }\n}\n```\n\n## Props\n\n```\n    /**\n     * onFocus\n     * return a Promise\n     * beforeFocus, onFocus, afterFocus\n     */\n    beforeFocus: PropTypes.func,\n    onFocus: PropTypes.func,\n    afterFocus: PropTypes.func,\n\n    /**\n     * onSearch\n     * return a Promise\n     * NOTE: As of RN V0.48.3 the blurOnSubmit property must be set to {true} for this to trigger\n     */\n    beforeSearch: PropTypes.func,\n    onSearch: PropTypes.func,\n    afterSearch: PropTypes.func,\n\n    /**\n     * onChangeText\n     * return a Promise\n     */\n    onChangeText: PropTypes.func,\n\n    /**\n     * onCancel\n     * return a Promise\n     */\n    beforeCancel: PropTypes.func,\n    onCancel: PropTypes.func,\n    afterCancel: PropTypes.func,\n\n    /**\n     * async await\n     * return a Promise\n     * beforeDelete, onDelete, afterDelete\n     */\n    beforeDelete: PropTypes.func,\n    onDelete: PropTypes.func,\n    afterDelete: PropTypes.func,\n\n    /**\n     * styles\n     */\n    backgroundColor: PropTypes.string,\n    placeholderTextColor: PropTypes.string,\n    titleCancelColor: PropTypes.string,\n    tintColorSearch: PropTypes.string,\n    tintColorDelete: PropTypes.string,\n    cancelButtonWidth: PropTypes.number,\n    cancelButtonStyle: PropTypes.PropTypes.oneOfType([\n        PropTypes.number,\n        PropTypes.object\n    ]),\n    cancelButtonTextStyle: PropTypes.PropTypes.oneOfType([\n        PropTypes.number,\n        PropTypes.object\n    ]),\n    onLayout: PropTypes.func,\n    inputStyle: PropTypes.oneOfType([\n        PropTypes.number,\n        PropTypes.object\n    ]),\n\n    /**\n     * text input\n     */\n    defaultValue: PropTypes.string,\n    placeholder: PropTypes.string,\n    cancelTitle: PropTypes.oneOfType([\n        PropTypes.string,\n        PropTypes.object\n    ]),\n    iconDelete: PropTypes.object,\n    iconSearch: PropTypes.object,\n    returnKeyType: PropTypes.string,\n    keyboardType: PropTypes.string,\n    keyboardAppearance: PropTypes.string,\n    autoCapitalize: PropTypes.string,\n    inputHeight: PropTypes.number,\n    inputBorderRadius: PropTypes.number,\n    contentWidth: PropTypes.number,\n    middleWidth: PropTypes.number,\n    editable: PropTypes.bool,\n    blurOnSubmit: PropTypes.bool,\n    keyboardShouldPersist: PropTypes.bool,\n    useClearButton: PropTypes.bool,\n\n    /**\n     * Positioning\n     */\n    positionRightDelete: PropTypes.number,\n    searchIconCollapsedMargin: PropTypes.number,\n    searchIconExpandedMargin: PropTypes.number,\n    placeholderCollapsedMargin: PropTypes.number,\n    placeholderExpandedMargin: PropTypes.number,\n```\n\n## Prop Defaults\n```\n    searchIconCollapsedMargin: 25,\n    searchIconExpandedMargin: 10,\n    placeholderCollapsedMargin: 15,\n    placeholderExpandedMargin: 20,\n    shadowVisible: false\n```\n\n## LICENSE\n\nThe MIT License\n\nCopyright (c) 2017 Agiletech. https://github.com/agiletechvn\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freact-native-vietnam%2Freact-native-search-box","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freact-native-vietnam%2Freact-native-search-box","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freact-native-vietnam%2Freact-native-search-box/lists"}