import AutoComplete from 'sentry/components/autoComplete'; const items = [ { name: 'Apple', }, { name: 'Pineapple', }, { name: 'Orange', }, ]; export default { title: 'Components/Forms/Auto Complete', parameters: { controls: {hideNoControlsWarning: true}, }, }; export const Input = () => ( item.name}> {({ getRootProps, getInputProps, getMenuProps, getItemProps, inputValue, highlightedIndex, isOpen, }) => { return (
{isOpen && (
{items .filter( item => item.name.toLowerCase().indexOf(inputValue.toLowerCase()) > -1 ) .map((item, index) => (
{item.name}
))}
)}
); }}
); Input.parameters = { docs: { description: { story: 'Autocomplete on an input', }, }, };