New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

multiselectpackage

Package Overview
Dependencies
Maintainers
1
Versions
68
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

multiselectpackage

Description A React component which provides multi select functionality with features like selection checkbox, Change the button text, color, background and disable button, single select dropdown and grouping features.

latest
npmnpm
Version
7.1.24
Version published
Weekly downloads
8
300%
Maintainers
1
Weekly downloads
 
Created
Source

Multiselectdropdown

Description

A React component which provides multi select functionality with features like selection checkbox, Change the button text, color, background and disable button, single select dropdown and grouping features.

screenshot screenshot

Getting Started

Features

  • Dropdown with grouping & multiple selection option
  • Bind to custom data source
  • Select/De-select all items
  • Select/de-select a single items
  • Group select/unselect
  • You can Change the button text color
  • You can Change the button background color
  • You can Change the Checkbox background color on select
  • You can Add Texts in the buttons
  • You can Disable both the buttons

Installation

The easiest way to use react-select is to install it from npm and build it into your app with Webpack.

npm i multiselectpackage

Then use it in your app

Usage

import { MultiSelectDropdown } from 'multiselectpackage';

function App() {

const options = {
"France":[{"name": " Antoine Griezmann",selected: false,id: 454}, {"name": "Paul Pogba",selected: false,id: 254}], "Croatia":[{"name": "Luka Modrić",selected: false,id: 354},
{"name": "Ivan Rakitić",selected: false, id: 442}], "Argentina":[{"name": "Lionel Messi",selected: false, id: 404},
{
"name":"Elena Martínez",selected: false,id: 402}] };

const backgroundColor ="red"; const label ="Select"; const label2 ="Unselect"; const color ="green"; const disable =true; const checkboxcolor ="yellow";
const checkboxcolor = "yellow" const handleSelect = (groupIndex, options) => { console.log(Select clicked for Group ${groupIndex + 1}); console.log(${JSON.stringify(options)}); };

const handleClear = (groupIndex, options) => { console.log(Clear clicked for Group ${groupIndex + 1}); console.log(${JSON.stringify(options)}); };

const handleOptionclear = (groupIndex, options) => { console.log(Unselected a member for group ${groupIndex + 1}); console.log(${JSON.stringify(options)}); };

return( <> <MultiSelectDropdown options={options} onSelect={handleSelect} onClear={handleClear} onSingleClear={handleOptionclear} backgroundColor={backgroundColor} label={label} label2={label2} color={color} checkboxcolor={checkboxcolor} disable={disable} /> </> ); }

Props 💬

PropTypeDefaultDescription
optionsobject{}Dropdown options
onSelectfunctionfuncCallback function will invoked on onSelect event. Params are groupIndex and options.
onClearfunctionfuncCallback function will invoked on clear event. Params are groupIndex and options
onSingleClearbooleantrueIt sets false and behave like a normal dropdown(unselect single dropdown).Params are groupIndex and options.
groupIndexIndexNumberIt gives selected group or selected dropdown Index.
options(in callback Functions){}objectIt will give you the entire object with selected or unselected values of dropdown.
displayValuestringvalueProperty name and selected should be in the object to display in the dropdown. Refer Basic Usage section
backgroundColorstring''backgroundColor will set the new background color of both buttons(All, clear). if you want to change the background color then pass the color in props and if you don't want to change the background color then don't use the backgroundColor field as props in component
labelstring''label will set the new text of button(All). if you want to change the text then pass the text in props and if you don't want to change the text then don't use the label field as props in component
label2string''label2 will set the new text of button(Clear). if you want to change the text then pass the text in props and if you don't want to change the text then don't use the label2 field as props in component
textLimitstring''label and label2 have text limit of length less than 9 as it will not fit in the button if it exceeds.
colorstring''color will set the new color of text of both buttons(All, clear). if you want to change the text color pass the color in props and if you don't want to change the color then don't use the color field as props in component
checkboxcolorstring''checkboxcolor will set the checkbox background color. if you want to change the checkbox background color pass the color in props and if you don't want to change the text color then don't use the checkboxcolor field as props in component
disablebool''disable will disable both the buttons(All, Clear) if you want to disable just pass the bool value as true in props and if you don't want to disable the button then don't use the disable field as props in component

Demo

Run locally

  • Clone the repository or downlod the .zip,.tar files.
  • Run npm install
  • Run npm start
  • Navigate to http://localhost:4000/

Library Build / NPM Package

Run npm build:lib to build the library and generate an NPM package. The build artifacts will be stored in the dist-lib/ folder.

Development

This project was generated with React CLI version ^18.2.0.

License

MIT License.

Keywords

npm

FAQs

Package last updated on 21 Jul 2023

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