Autocomplete

Modals are streamlined, but flexible, dialog prompts with the minimum required functionality and smart defaults.

const Autocomplete = require('gitbook-styleguide/lib/Autocomplete');

Example

<Autocomplete
placeholder="Enter a language"
onFetch={(query, callback) => {
callback([
{ id: 'en', label: 'English' },
{ id: 'fr', label: 'French' }
])
}}
onChange={(query, result) => alert('Selected is ' + result.label)}
renderResult={({result}) => <span><b>{result.id}</b> {result.label}</span>}
/>