Combobox
This package implements a Combobox
component. This component combines a Autocomplete
component with a TextInput
and a Button
.
Example
Key points
- Uses a
Autocomplete
component - Clicking the button will show all items
- Typing text will filter the list
Usage
<Combobox = = />
Prop types and default props
static propTypes = ...BoxpropTypes items: PropTypesarrayisRequired selectedItem: PropTypesany defaultSelectedItem: PropTypesany itemToString: PropTypesfunc width: PropTypes height: PropTypesnumber onChange: PropTypesfunc inputProps: PropTypesobject buttonProps: PropTypesobject openOnFocus: PropTypesbool autocompleteProps: PropTypesobject static defaultProps = openOnFocus: false width: 224
Complete Story
import storiesOf from '@storybook/react'import React from 'react'import Box from 'ui-box'import starWarsNames from 'starwars-names'import Combobox from '../src/' // Generate a big list of itemsconst items = ...starWarsNamesall ...starWarsNamesall ...starWarsNamesall const handleChange = { console}