1.0.0 • Published 11 months ago

gpollet-dropdown v1.0.0

Weekly downloads
-
License
UNLICENSED
Repository
-
Last release
11 months ago

GPollet Dropdown

A React component using Typescript to create a dropdown menu from a list of items.

Installation

To install the latest version using npm :

  npm install gpollet-dropdown

To install the latest version using Yarn :

  yarn add gpollet-dropdown

Usage/Examples

Component can be used as a regular React component once imported into a file.

Props

All props are typed using Typescript.

Prop NameRoleTypeRequired
dataValues to display as < option/>{string}</ option> in the dropdown menu{name: string}[]x
labelText content of the tag.stringx
idId that will be assigned to the tag.stringx
nameName that will be assigned to the tag. Default value : {id}string
widthWidth of the element. Default value : 300number
heightHeight of the element. Default value : 300number
import Dropdown from "gpollet-dropdown";

function App() {
	return (
		<>
			<div className="App">
				<Dropdown
					data={[
						{ name: "Option A" },
						{ name: "Option B" },
						{ name: "Option C" },
					]}
					label="Dropdown Example"
					id="dropdown-id"
				/>
			</div>
		</>
	);
}

export default App;
1.0.0

11 months ago