Socket
Book a DemoInstallSign in
Socket

react-search-panel

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-search-panel

An expandable search panel React component where results can be displayed as links, checkboxes, or radio buttons.

Source
npmnpm
Version
1.0.0
Version published
Weekly downloads
9
Maintainers
1
Weekly downloads
 
Created
Source

React Search Panel

A react search panel that expands, autocompletes, and support single or multi select.

Demo

There is a demonstration of react-search-panel as coded in the example folder.

Many other variants of this component are demonstrated in this Storybook demonstration.

Documentation

Here is documentation of the component API.

Getting started

For development

  • npm install --save-dev react-search-panel

Run example locally

  • git clone https://github.com/jeremydavidson/react-search-panel
  • cd example
  • npm install
  • npm start

Usage

Typescript example

This is an example in Typescript with all available props:

    import React from "react";
    import { SearchPanel } from "react-search-panel";
    import "react-search-panel/dist/index.css";

    const App = () => {
      const [input, setInput] = React.useState("");
      const [, setSelectedKeys] = React.useState<Array<string>>([]);

      return (
        <SearchPanel
          choices={choices}
          onChange={event => setInput((event as React.ChangeEvent<HTMLInputElement>).target.value)}
          onSelectionChange={selected => setSelectedKeys(selected)}
          noChoiceItem={noChoiceItem}
          placeholder="Search"
          shadow
          small
          value={input}
          variant={SearchPanelVariant.checkbox}
        />
      );
    }
    export default App;

Javascript

This is an example in Javascript with only the required props.

    import React from "react";
    import { SearchPanel } from "react-search-panel";
    import "react-search-panel/dist/index.css";

    const App = () => {
      const [input, setInput] = React.useState("");

      return (
        <SearchPanel
          choices={choices}
          onChange={event => setInput(event.target.value)}
          placeholder="Search"
          value={input}
        />
      );
    }
    export default App;

Keywords

react-search-panel

FAQs

Package last updated on 05 Sep 2020

Did you know?

Socket

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