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

Latest commit

 

History

History
40 lines (34 loc) · 1014 Bytes

custom_select.md

File metadata and controls

40 lines (34 loc) · 1014 Bytes

Forms/CustomSelect

Renders a component looking like a select button where content is completely customizable.

Custom Select example

<div>
  <CustomSelect
    inputRenderer={this.inputRenderer}
    disabled={boolean('Disabled', false)}
    displayInputWhenOpened={boolean('Display input when opened', false)}
  >
    <List style={{maxHeight: 200, overflowY: 'scroll'}}>
      {multiOptions.map(option => (
        <ListElement
          key={option.value}
        >
          <Checkbox
            checked={options.indexOf(option.value) !== -1}
            value={option.value}
            onChange={this.onChange}
          >{option.label}</Checkbox>
        </ListElement>
      ))}
    </List>
  </CustomSelect>
</div>

Props

inputRenderer={function}
Function / Class to render input element.

disabled={boolean}
Disable the element.

displayInputWhenOpened={boolean}
Hide / Show the input when the menu is opened.