JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2
  • Score
    100M100P100Q58227F
  • License MIT

A react-Library-Dropdown

Package Exports

  • react-library-dropdown

Readme

React + Vite

This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.

Currently, two official plugins are available:

Installation

npm i react-library-dropdown or npm install react-library-dropdown

Web site

https://github.com/deborah-bude/react-library-dropdown

Usage

Import in JSX file:

import { Dropdown } from "react-library-dropdown"

How use ?

Options parameters Normal

const options = [
    {
        value: "item-value-option-1", 
        content: "Item content  1"
    },
    {
        value: "item-value-option-2", 
        content: "Item content 2"
    },
    {
        value: "item-value-option-3", 
        content: "Item content 3"
    },
]

return <Dropdown title="State" options={options}></Dropdown>

With <optgroup label="">

const optionsGroup = [
    { type: 'group', name: 'Foods', items: [
        {
            value: "chocolate", 
            content: "Chocolate"
        },
        {
            value: "vanilla", 
            content: "Vanilla"
        },
        {
            value: "strawberry", 
            content: "Strawberry"
        },]
    },
    { type: 'group', name: 'Colors', items: [
        {
            value: "blue", 
            content: "Blue"
        },
        {
            value: "white", 
            content: "White"
        },
        {
            value: "red", 
            content: "Red"
        },]
    }
]

return <Dropdown title="State" options={optionsGroup}></Dropdown>