Socket
Socket
Sign inDemoInstall

slick-react-multiselect-dropdown

Package Overview
Dependencies
5
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    slick-react-multiselect-dropdown

slick design lightweight multiple selection dropdown component


Version published
Weekly downloads
19
decreased by-45.71%
Maintainers
1
Install size
12.5 kB
Created
Weekly downloads
 

Readme

Source

Slick React Multiselect Dropdown

A very lightweight and simple multiple selection dropdown component with search

NPM gzip

✨ Features

  • 🕶 Zero Dependency
  • 🍃 Lightweight (<5KB)
  • ✌ Written w/ TypeScript
  • ⌨ Keyboard navigation to search, move, close dropddown items
  • 🔍 Search character hightlights
  • 💄 Fully themable

🔧 Installation

npm i slick-react-multiselect-dropdown    # npm
yarn add slick-react-multiselect-dropdown # yarn

📦 Example

 const listItems = [
    { label: "Apple 🍎", key: "apple" },
    { label: "Unicorn 🦄", key: "unicorn" },
    { label: "Burger 🍔", key: "burder" },
    { label: "Cheers 🥂", key: "cheers" },
  ];

  const [selectedItem, setSelectedItem] = useState([]);

   <MultiSelect
        placeholder="Select from list"
        list={listItems}
        selectedItems={selectedItem}
        setSelectedItems={setSelectedItem}
    />

💄 Themable

color values for selected Items could be in all css accepted formats. such as #cece rgb(254 242 242) green


  const colorSelectedItem = {
    { border: "red", background: "rgb(254 242 242)" }
  }

   <MultiSelect
        placeholder="Select from list"
        list= {listItems}
        selectedItems= {selectedItem}
        setSelectedItems= {setSelectedItem}
        colorSelectedItem= {colorSelectedItem}
    />

Result

Wrap Items

Types

export type Item = { label: string; key: string };

export type IProps = {
  placeholder?: string;
  list: Item[];
  selectedItems: Item[];
  setSelectedItems: any;
  enableSearch?: boolean;
  colorSelectedItem?: { border: string; background: string };
  selectBoxcss?: {}; // any inline css properties e.g  selectBoxcss={{padding: '.2rem'}}
};

Keywords

FAQs

Last updated on 16 Dec 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