• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

ananddayalan/react-native-material-design-searchbar: react native material desig ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

ananddayalan/react-native-material-design-searchbar

开源软件地址(OpenSource Url):

https://github.com/ananddayalan/react-native-material-design-searchbar

开源编程语言(OpenSource Language):

JavaScript 100.0%

开源软件介绍(OpenSource Introduction):

react-native-material-design-searchbar

A React Native Material Design SearchBar

Setup

Install the SearchBar from npm with npm i -S react-native-material-design-searchbar. Then, require it from your app's JavaScript files with import SearchBar from 'react-native-material-design-searchbar'. This library depends on react-native-vector-icons. Please link it by following their installation guide.

Usage

All props are optional except height.

import React, { Component } from 'react';
import SearchBar from 'react-native-material-design-searchbar';

export default class ExampleComponent extends Component {
  render() {
    return (
      <SearchBar
        onSearchChange={() => console.log('On Search Change')}
        height={50}
        onFocus={() => console.log('On Focus')}
        onBlur={() => console.log('On Blur')}
        placeholder={'Search...'}
        autoCorrect={false}
        padding={5}
        returnKeyType={'search'}
      />
    );
  }
};

Available Props

  • onSearchChange: Callback on search change
  • onClear: Callback when the 'X' button is pressed. This also calls onSearchChange with an empty string.
  • searchValue: Initializes the input field. Changing this prop does not change the input value.
  • onBackPress: Optional function, Callback on back icon pressed
  • alwaysShowBackButton: Optional bool, use if you want to always show the back button instead of search, default is false
  • iconCloseName: Optional string, use it to customize the close icon
  • iconSearchName: Optional string, use it to customize the search icon
  • iconBackName: Optional string, use it to customize the back icon
  • iconCloseComponent: Optional object, custom component for the close icon (overrides iconCloseName)
  • iconSearchComponent: Optional object, custom component for the search icon (overrides iconSearchName)
  • iconBackComponent: Optional object, custom component for the back icon (overrides iconBackName)
  • iconColor: Optional string, use it to define a different padding size, default is #737373
  • placeholder: Optional string, use it to customize the placeholder text, default is eSearch...
  • placeholderColor: Optional string, use it to define a different placeholder color, default is #bdbdbd
  • returnKeyType: Optional string, use it to customize the return key type
  • padding: Optional string, use it to define a different padding size, default is 5
  • inputStyle: Optional string, use it to pass your style to the containing View
  • inputProps: Optional object, use it to pass additional props to the TextInput, for example {autoFocus: true}
  • textStyle: Optional string, use it to pass your style to the TextInput

The React packager will include the SearchBar component in your app's JS package and make it available for your app to use.

Contributing

Contributions are welcome.

LICENSE

MIT




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap