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

bottomsearchbar

v0.1.1

Published

React native bottom search bar component

Downloads

6

Readme

React Native Bottom Search Bar Component

You can easily add animated search box for your application using this package.

How do i use it?

This package needs react-native-svg package first you install it , you can install with npm i react-native-svg. You can watch(3 min) on youtube how to setup bottom search bar component.

npm install bottomsearchbar

Simple Use

import React, {useState} from 'react';
import {StyleSheet, Text, View} from 'react-native';
import BottomSearch from 'bottomsearchbar';
const initialData = [
  {
    userId: 1,
    id: 1,
    title: 'delectus aut autem',
    completed: false,
  },
  {
    userId: 1,
    id: 2,
    title: 'quis ut nam facilis et officia qui',
    completed: false,
  },
  {
    userId: 1,
    id: 3,
    title: 'fugiat veniam minus',
    completed: false,
  },
];
const App = () => {
  const [data, setData] = useState(initialData);
  return (
    <View style={styles.container}>
      <BottomSearch data={data} />
    </View>
  );
};

export default App;

const styles = StyleSheet.create({
  container: {
    flex: 1,
    backgroundColor: 'grey',
  },
});

Component Props And Sample Prop Datas

| Prop Name | Description | | ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | | customCss | You can put your own styles | | searchResultOnPress | This parameter accepts a function, when the user clicks on the search result, the data of the clicked result is sent to this function | | onSearchTextChange | This function is triggered when the user types in the search box and returns the text written by the user. | | data | Array containing data to search. | | placeHolderText | Search input placeholder text | | cancelText | Text of search box closing button | | customSearchResultItem | You can change search result component with this prop | | icon | You can use your icon component |

Custom Css Sample Object

const customCss = {
  body: {},
  search: {},
  searchInput: {},
  searchResults: {},
  item: {},
  closeButtonColor: '',
};
<BottomSearchBar customCss={customCss} />;

searchResultOnPress Function Sample

<BottomSearchBar searchResultOnPress={item => console.log(item)} />

onSearchTextChange Event Sample

<BottomSearchBar onSearchTextChange={text => console.log(text)} />

Search Data Object Sample

**İmportant : The default search result component shows "title" property on the screen, you need to write the custom search result component to change it. **

const data =[
    {
      id: '0',
      title: 'Street Image',
      download_url:
        'https://unsplash.com/photos/lIVYk4qacSQ/download?force=true&w=640',
    }
  ]
 <BottomSearchBar
	data={data}
 />

customSearchResultItem Component Sample

const customSearchResultItem = ({item, id}) => {
  console.log(item);
  return (
    <View>
      <Text>{item.title}</Text>
    </View>
  );
};
<BottomSearchBar customSearchResultItem={customSearchResultItem} />;

Icon Sample

const icon = <YourIconComponent />;
<BottomSearchBar icon={icon} />;

Search Input Placeholder Text Sample

<BottomSearchBar placeHolderText={'Search'} />

Search Cancel Button Text Sample

<BottomSearchBar cancelText={'Cancel'} />

How can add my components in Bottom Search Bar component?

Thats is simple you can review this code.

<BottomSearchBar>
  <View>
    <Text>My component</Text>
  </View>
</BottomSearchBar>

How do i add my own components under the bottom searchbar component?

<BottomSearchBar/>
<YourComponent/>

I thank JetBrains for their support to students.