2.0.5 • Published 3 years ago

kodobe-react-dropdown v2.0.5

Weekly downloads
30
License
ISC
Repository
-
Last release
3 years ago

Kodobe React Dropdown

This is a simple react dropdown package

Install

npm install kodobe-react-dropdown

or

yarn add kodobe-react-dropdown

Setup

import Dropdown from 'kodobe-react-dropdown';

Usage

import Dropdown from "kodobe-react-dropdown";

function App() {
    return (
        <div>
            <h3>Here is how to use a dropdown</h3>
             <br />
            <Dropdown
                options={[
                { title: "Text 1", value: "text1" },
                { title: "Text 2", value: "text2" },
                { title: "Text 3", value: "text3" },
                ]}
                value={dropdown}
                onChange={(e) => setDropdown(e)}
            />
            <br />
            <Dropdown
                options={[
                { title: "Text 1", value: "text1" },
                { title: "Text 2", value: "text2" },
                { title: "Text 3", value: "text3" },
                ]}
                title={"Menu"}
                onChange={(e) => console.log(e)}
            />
        </div>
    );
}

Options

  • options: List of object of structure {title:"title", value:"value"}
  • title: dropdown title, use this if you want a static dropdown (string)
  • value: dropdown value, use this if you want a dynamic dropdown (any)
  • onChange: handle selection change in dropdown (function)
  • style: style object
  • className: string
2.0.5

3 years ago

2.0.3

3 years ago

2.0.2

3 years ago

2.0.4

3 years ago

2.0.1

3 years ago

2.0.0

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago