import {InlineAutocomplete} from '@primer/react/drafts'
The InlineAutocomplete
component extends an Input
or Textarea
component to provide inline suggestions, similar to those provided by a code editor.
Input components must always be accompanied by a corresponding label to improve support for assistive technologies. Examples below are provided for conciseness and may not reflect accessibility best practices.
InlineAutocomplete
can be used with the FormControl
component to render a corresponding label.
Try typing a #
symbol to see suggestions. Use Enter
or click to apply a suggestion.
Name | Type | Default | Description |
---|---|---|---|
children Required | React.ReactNode | An | |
triggers Required | Array<Trigger> | Register the triggers that can cause suggestions to appear. | |
onSelectSuggestion | (event: SelectSuggestionsEvent) => void | Called when a suggestion is selected. This should be used only for performing side effects, not for modifying
the inserted text. Do not call | |
onShowSuggestions Required | (event: ShowSuggestionsEvent) => void | Called when a valid suggestion query is updated. This should be handled by setting the | |
onShowSuggestions Required | () => void | Called when suggestions should be hidden. Set | |
suggestions Required | Suggestion[] | null | 'loading' | The currently visible list of suggestions. If | |
tabInsertsSuggestions | boolean | false | If |
sx | SystemStyleObject |