Autocomplete

Autocomplete helps users find and select values by suggesting options as they type.

React

Is new design vision part implemented using new tokens?

Up to date

Resources

Example


                                                        
                                                        
                                                            import { useState } from 'react';
                                                        import { Select } from '@optimus-web/core';
                                                        
                                                        const MySelectComponent = () => {
                                                            const [selectedValue, setSelectedValue] = useState<InputValue>('');
                                                        
                                                            const selectOptions = [
                                                                { key: 'fujiyama', value: 'fujiyama', label: 'Fujiyama Hotel' },
                                                                { key: 'boomerang', value: 'boomerang', label: 'Boomerang Hotel' },
                                                                { key: 'le-grand-hotel', value: 'le-grand-hotel', label: 'Le Grand Hotel' },
                                                            ];
                                                        
                                                            return (
                                                                <Autocomplete
                                                                    value={selectedValue}
                                                                    label="Choose your property"
                                                                >
                                                                    {selectOptions.map((item: { key: string; value: string; label: string }) => (
                                                                    <DropdownItem key={item.key} value={item.value} label={item.label} />
                                                                )),}
                                                                </Autocomplete>
                                                            );
                                                        };