Basic Usage
Use {{paper-autocomplete}} to search for matches from local or remote data sources.
Nothing selected...
No search text
Disable input
Simulate query
Highlight first match
Template
<PaperAutocomplete @disabled= @onCreate= @options= @allowClear= @defaultHighlighted= @searchText= @onSearchTextChange= @selected= @search= @searchField="name" @labelPath="name" @placeholder="Select a Country..." @noMatchesMessage="Oops this country doesn't exist. Create a new country?" @onSelectionChange= />
Block Custom template
Use {{paper-autocomplete}} with custom templates to show styled autocomplete results.
Selected: None
Template
<span class="item-title">
<span>
<PaperAutocompleteHighlight @searchText= @flags="i" @label= />
</span>
</span>
Whoops! could not find!
Floating Label
The following example demonstrates floating labels being used as a normal form element.
Nothing is selected.
Disable input
Simulate query
Is required
Allow Clear
Template
<PaperInput @label="Name" @value= @onChange= @class="flex" />
<PaperAutocomplete @disabled= @required= @triggerClass="flex" @options= @selected= @search= @searchField="name" @labelPath="name" @label="Select a Country..." @allowClear= @noMatchesMessage="Oops this country doesn't exist." @onSelectionChange= as |country select|>
<PaperAutocompleteHighlight @label= @searchText= @flags="i" />
</PaperAutocomplete>