1.0.3 • Published 5 months ago

grl-dropdown v1.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

GRL React DropDown

A flexible React dropdown component that supports both single and multiple selections with customizable styling. Github

Installation

npm install grl-dropdown

Usage

import React from "react";
import GRLDropDown from "grl-dropdown";

const options = [
  { key: "1", description: "Option 1" },
  { key: "2", description: "Option 2" },
];

const App = () => {
  const handleDropdownChange = (selected) => {
    console.log(selected);
  };

  return (
    <div>
      <GRLDropDown
        label="Select an option"
        options={options}
        type="single" // or "multiple"
        onDropDownChange={handleDropdownChange}
        placeholder="Choose..."
      />
    </div>
  );
};

export default App;

Props

PropTypeRequiredDefaultDescription
labelstringYes-Label text for the dropdown
optionsarrayYes-Array of objects with key and description
typestringYes-'single' or 'multiple'
onDropDownChangefunctionYes-Callback function when selection changes
placeholderstringNo'Select items'Placeholder text
labelStylesobjectNo{}Custom styles for label
dropdownStylesobjectNo{}Custom styles for dropdown
containerStylesobjectNo{}Custom styles for container
multipleDropdownStylesobjectNo{}Custom styles for multiple dropdown
checkboxListStylesobjectNo{}Custom styles for checkbox list
checkboxItemStylesobjectNo{}Custom styles for checkbox items
initialValueobject/arrayNo-Initial selected value(s)
1.0.3

5 months ago

1.0.2

5 months ago

1.0.1

5 months ago

1.0.0

5 months ago