Autodesk / orion-ui

UI Components that work seamlessly in multiple UI frameworks
https://goo.gl/shxHPB
Other
22 stars 6 forks source link

Add Dropdown #289

Open nfiniteset opened 7 years ago

nfiniteset commented 7 years ago
As a developer
I want to add dropdowns to my application
So that my users can submit information to the application

Typical usage

<Dropdown
  label="Prefix"
  onChange={this.setUserPrefix}
  initialValue={user.prefix}
>
  {options.map(option => {
    <Option label={option.label} value={option.value} selected={this.state.selectedOptionId === option.id} />
  });}
</Dropdown>

Complete props

Dropdown.propTypes = {
  name: PropTypes.string,
  label: PropTypes.string,
  required: PropTypes.string
  disabled: PropTypes.bool,
  onBlur: PropTypes.func,
  onChange: PropTypes.func,
  onFocus: PropTypes.func,
}

Option.propTypes = {
  label: PropTypes.string,
  value: PropTypes.any,
  selected: PropTypes.bool,
}

TODO