Socket
Socket
Sign inDemoInstall

react-native-search-filter-sort

Package Overview
Dependencies
608
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    react-native-search-filter-sort

## Installation


Version published
Maintainers
1
Created

Readme

Source

SearchingCustomListing

Installation

Install the library

using either Yarn:

yarn add react-native-search-filter-sort

or npm:

npm i react-native-search-filter-sort

Usage

import React from "react";
import { View } from "react-native";
import Searching from "react-native-search-filter-sort";
import Data from "./src/data/generated.json";

const index = () => {
  const searchable = ["name", "email", "phone", "address", "company"];
  const render = [
    {
      title: "Name",
      value: "name",
    },
    {
      title: "Email",
      value: "email",
    },
    {
      title: "Phone",
      value: "phone",
    },
    {
      title: "Company",
      value: "company",
    },
    // {
    //   title: "Gender",
    //   value: "gender",
    // },
    {
      title: "Eye Color",
      value: "eyeColor",
    },
  ];
  const onPressOnCard = () => {};
  const placeholder = "Search";
  const sort = {
    field: "name",
    order: "asc",
  };
  return (
    <>
      <Searching
        render={render} // items which are rendered on the card
        searchable={searchable} // Listing of fields to be searched from data source
        Data={Data} // Data is an array of objects
        onPress={(item) => {
          console.log(item?._id);
        }} // Here we can pass the function to onPressOnCard prop of Searching component
        searchPlaceholder={placeholder} // Search placeholder
        autoCapitalize={"characters"} //characters || sentences || words || none

        // sort={sort} // sort function ||  field to be sorted ||  mode of sorting asc || desc
      />
    </>
  );
};

export default index;

FAQs

Last updated on 08 Aug 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc