delbari-dropdown-react
v6.1.8
Published
For SuperStar Dropdowns
Downloads
5
Readme
delbari-dropdown-react
For SuperStar Dropdowns
Install
npm install --save delbari-dropdown-react
Usage
import React from 'react'
import { ExampleComponent } from 'delbari-dropdown-react'
import 'delbari-dropdown-react/dist/index.css'
const App = () => {
const list = [
{id:1,title:"Cristiano",age:38,ghad:'192'},
{id:2,title:"Drogba",age:36,ghad:'169'},
{id:3,title:"Zidan",age:25,ghad:'182'},
{id:4,title:"Messi",age:45,ghad:'198'},
{id:5,title:"Check",age:26,ghad:'126'},
]
const onChange = (item) => {
console.log(item)
}
return <ExampleComponent
keyItem={"title"} // requaired !!
autoComplate
data={list} // requaired !!
onChange={onChange}
otherKeys={["Orders","title","age","ghad"]}
value={list[2]} />
}
export default App
Api
Props
autoComplate : true | false.
title : Object key in array for searching and view text on dropdown .
keyItem : Requaired . for search and action by key.
otherKeys : for show other keys each item in dropdown.\
Props
| Prop | Type | valueExample | description|
|:-----|:--------:|------:|-----------:|
| autoComplate | Boolin | True | |
| keyItem | String | title
| |
| data | Array | [{id:1,title:"ali",age:"25",weight:"60"}]
| |
| onChange | Function | onChange(item) | |
| value | Object | {id:1,title:"ali",age:"25",weight:"60"}
| |
| otherKeys | Array | ["title","age","weight"]
| |
License
MIT © ard4030