Skip to content
This repository has been archived by the owner on Feb 22, 2024. It is now read-only.

Dropdown

Kelly edited this page Jul 3, 2018 · 1 revision

API

Property Description Type Default
className Custom dropdown style string -
is_nativepicker Whether to show nativepicker boolean -
list Array of dropdown options; objects with text and value properties array|object -
name Sets the dropdown name attribute string -
onChange Callback function for when a dropdown option is selected function() -
type Sets the dropdown type string -
value Sets the dropdown value number|string -

How to use

const list = [
  {
    text: 'Apple',
    value: 'apple',
  }, 
  {
    text: 'Orange',
    value: 'orange',  
  }
];

let value = '';
function onChange(e) {
    value = e.target.value;
}

<Dropdown
    name='fruits'
    list={list}
    value={value}
    onChange={onChange}
    is_nativepicker={false}
/>
 
Clone this wiki locally