1.2.3 • Published 5 years ago
custom-item-select v1.2.3
custom-item-select
The React component used to select options visualized by the HTML/React components.
Install
npm install --save custom-item-select
No additional dependencies, React only!
Demo
Usage
import React, { Component } from 'react'
import Select from 'custom-item-select'
const items = [
{ key: "one", component: <Item>Custom item component</Item> },
{ key: "two", component: <Item>Custom item component 2</Item> },
{ key: "three", component: <AnotherItem>Three</AnotherItem> }
]
function() {
const [value, setValue] = React.useState()
return (
<Select
items={items}
onSelect={(key) => setValue(key)}
placeholder="select one element..."
/>
)
}
License
MIT © ktomecki
Made with create-react-library