import {WidgetEditor} from "@site/src/components/social-widget"
The TypeAhead
component provides a type-ahead input field for selecting an option from a list of choices. This component is imported from the react-bootstrap-typeahead
package; more information about the component can be found here.
Example
The code example below demonstrates how to use the TypeAhead
component to create an input field for selecting a fruit from a list of options.
“`jsx
const options = [“Apple”, “Banana”, “Cherry”, “Durian”, “Elderberry”];
return (
placeholder=’Choose a fruit…’
/>
Selected: {JSON.stringify(state.choose)}
);
“`