<c-autocomplete>
A filterable value-selection component: a readonly value field that opens a popover panel with a search input above the matching options.
Usage
Options
Options are slotted c-option elements or an items array of
{ name, value } entries. A slotted option's label — the text shown in the
closed field and in its tag, and the text the filter matches — is its name
attribute, else the text of a c-option-value inside it, else the option's
whole text. Wrap the label in c-option-value when an option carries more
than its label, such as a description; the rest of the option's markup still
renders in the row:
<c-option value="ts">
<c-option-value>TypeScript</c-option-value>
<small>JavaScript with static types</small>
</c-option>
<c-option selected> sets the initial value of plain HTML: once, only while
the value is empty, and silently — no value event, so a bound v-model does
not learn it. With a bound value, initialise the model instead.
The row shows a copy of the option's markup, re-created from its HTML inside
the panel. A component nested in an option — a c-icon, say — is therefore
configured through attributes, or props with an attribute form (strings,
numbers, booleans); object props and event listeners on option content do not
carry over. Page CSS does not reach the copy either: give the content a part
and style it through the field:
<c-option value="ts">
<div part="language">
<c-option-value>TypeScript</c-option-value>
<c-icon path="…"></c-icon>
</div>
</c-option>
c-autocomplete::part(language) {
display: flex;
align-items: center;
gap: 0.5rem;
}
While a query is typed, the runs of each option's label that equal it are
marked: inside the c-option-value of a slotted option, or in the plain
label of an items entry. A slotted option without the wrapper is rendered
exactly as authored and never marked. Every occurrence of the literal query
is marked, whatever the filter did — a fuzzy filter, or a name that
differs from the wrapper's text, can leave a row unmarked — and the wrapper's
content is treated as plain text while a query is active. The marks are the
match part:
c-autocomplete::part(match) {
font-weight: 600;
}
Filtering
By default the component filters its options itself: the query typed into the
search input is matched against the start of each option's label. Supply a
filter predicate to change the matching — it receives the normalized option
and the query, and keeps the option when it returns true (see the
custom-filter example). Because filter is a function, it must be bound as a
DOM property, not an attribute.
External data
Set external to hand filtering to your own code — for example a server
search endpoint. The component then renders items verbatim and emits a
change:query event carrying the query string: on every keystroke, and with
an empty string when the panel opens (use that to load the initial,
unfiltered list). Set loading while a request is in flight; the panel shows
a loading row when there is nothing to display yet and keeps the current
options on screen during a refresh.
The component ships no debounce and no minimum query length — debounce the
requests in your handler and skip fetches for too-short queries yourself (see
the external example). The closed field keeps showing the selected option's
label even when a later fetch no longer includes it: the label is remembered
when the option is committed, and a programmatically set value resolves its
label from the current options, or from the object's name when
return-object is used.
Multiple selection
Set multiple to let the user pick several options. The value is then an
array of the picked options' values in the order they were picked (an array
of { name, value } items with return-object), and [] when nothing is
picked. Arrays have no attribute form — bind value as a DOM property
(v-model or :value="…" in Vue; the React wrapper and property
assignment do this naturally). Picking an option toggles it and keeps the
panel open; the search input keeps its query after a pick, so several
matches can be picked in a row. clearable clears the whole selection.
Each picked option shows as a tag inside the field, and the field grows as
the tags wrap. A tag's close button removes that option; Backspace in the
closed field removes the last one. Set max-tags to show only that many
tags and fold the rest into a single "+N more" tag, or max-tags="0" to
show no tags at all — the field then reads "N selected". Assistive
technology always hears the full selection as the field's value. With
external, a pick's label is remembered when it is made, so a later fetch
that no longer lists it keeps its tag readable.
Set select-all to pin a select-all row at the top of the list. It acts on
the options currently listed — the matches while a query is typed, or the
items you supply with external: activating it selects every enabled one
of them, or unselects them all when they already are, and options outside
the list keep their state. Disabled options are left alone, and the row only
appears while there is something to select. Its label is texts.selectAll,
a function receiving the number of listed options.
The row checkboxes recolour like c-checkbox's (::part(indicator),
::part(mark)), the select-all row is the select-all part, and the tags are
stylable through the tags, tag and tag-root parts:
c-autocomplete::part(tag-root) {
background: var(--c-primary-subtle);
}
Texts
Every built-in string — the clear and toggle button labels, the search
input's placeholder and accessible label, the loading and no-results rows,
the select-all row's label, a tag's remove label, the overflow and count
texts — can be replaced for another language through the texts object,
merged over the English defaults. Count and label texts are functions, so the object must be bound
as a DOM property; the placeholder prop still wins over
texts.searchPlaceholder when both are set:
<c-autocomplete
:texts="{
noResults: 'Ei osumia',
remove: (label) => `Poista ${label}`,
}"
multiple
/>
To translate every autocomplete at once, set texts app-wide with
applyDefaults({ 'c-autocomplete': { texts } }) (Customization → App-wide
prop defaults); a per-instance texts still wins key by key.
Scrolling
The panel shows items-per-page full rows (six by default) and then a
half-visible row instead of a scrollbar: the cut row is the cue that more
options follow, and the wheel, touch and arrow keys scroll as usual. Set
items-per-page="0" to let the list grow to the space the panel allows; it
still ends on a half row when it overflows. To bring the native scrollbar
back:
c-autocomplete::part(list) {
scrollbar-width: auto;
}
Narrow viewports
On a viewport narrower than 760px the panel opens as a fullscreen panel
instead of anchoring under the field: a heading row with the field's label and
a close button, the search input beneath it, then the options filling the rest
of the screen. The panel keeps covering the screen and the rows above the
options stay in view while the on-screen keyboard is open; the close button and
Escape both return focus to the field; the page behind the panel is inert until
it closes, and the list has no half-row cut — the screen edge is the cue. The
threshold is the viewport's width, never the field's, so a narrow field on a
desktop keeps its anchored panel. The close button's label is the closePanel
text, and the row's parts are heading-row, heading and close:
c-autocomplete::part(heading-row) {
border-bottom-color: var(--c-primary);
}
Examples
<template>
<div>
<c-autocomplete
v-model="language"
hint="Type to filter the options"
label="Programming language"
placeholder="Start typing to search"
clearable
>
<c-option value="js">
<c-option-value>JavaScript</c-option-value>
</c-option>
<c-option value="ts">
<c-option-value>TypeScript</c-option-value>
</c-option>
<c-option value="py">
<c-option-value>Python</c-option-value>
</c-option>
<c-option value="rs">
<c-option-value>Rust</c-option-value>
</c-option>
</c-autocomplete>
<p>Value: {{ language ?? 'null' }}</p>
</div>
</template>
<script setup lang="ts">
import { ref } from 'vue';
const language = ref<null | string>(null);
</script>
<template>
<div>
<!-- The default filter matches the start of the label; this one matches
anywhere in it. -->
<c-autocomplete
v-model="country"
:filter
:items
hint="Matches anywhere in the label"
label="Country"
placeholder="Type to filter"
clearable
/>
<p>Value: {{ country ?? 'null' }}</p>
</div>
</template>
<script setup lang="ts">
import type { CAutocompleteFilter, CAutocompleteItem } from '@cscfi/csc-ui';
import { ref } from 'vue';
const items: CAutocompleteItem[] = [
{ name: 'Austria', value: 'at' },
{ name: 'Denmark', value: 'dk' },
{ name: 'Estonia', value: 'ee' },
{ name: 'Finland', value: 'fi' },
{ name: 'France', value: 'fr' },
{ name: 'Germany', value: 'de' },
{ name: 'Iceland', value: 'is' },
{ name: 'Netherlands', value: 'nl' },
{ name: 'Norway', value: 'no' },
{ name: 'Sweden', value: 'se' },
];
// Typed via CAutocompleteFilter, so `option` and `query` are fully inferred.
// A custom-element binding can't infer an inline arrow's params, so define
// the predicate here rather than in the template.
const filter: CAutocompleteFilter = (option, query) =>
option.label.toLowerCase().includes(query.toLowerCase());
const country = ref<null | string>(null);
</script>
<template>
<div>
<!-- With `external`, the autocomplete renders `items` verbatim and only
emits `change:query`; filtering happens in a simulated server request.
The event also fires with an empty string when the panel opens, which
is what loads the initial unfiltered list. The component ships no
debounce — do it in the handler, as here. -->
<c-autocomplete
v-model="country"
:items
:loading
hint="Options are fetched as you type"
label="Country"
placeholder="Type to search"
clearable
external
@change:query="onQuery"
/>
<p>Value: {{ country ?? 'null' }}</p>
</div>
</template>
<script setup lang="ts">
import type { CAutocompleteItem } from '@cscfi/csc-ui';
import { onBeforeUnmount, ref } from 'vue';
// ---- a pretend server ------------------------------------------------
const ALL: CAutocompleteItem[] = [
{ name: 'Austria', value: 'at' },
{ name: 'Denmark', value: 'dk' },
{ name: 'Estonia', value: 'ee' },
{ name: 'Finland', value: 'fi' },
{ name: 'France', value: 'fr' },
{ name: 'Germany', value: 'de' },
{ name: 'Iceland', value: 'is' },
{ name: 'Netherlands', value: 'nl' },
{ name: 'Norway', value: 'no' },
{ name: 'Sweden', value: 'se' },
];
const search = (query: string): Promise<CAutocompleteItem[]> =>
new Promise((resolve) =>
setTimeout(
() =>
resolve(
ALL.filter((item) =>
item.name.toLowerCase().includes(query.toLowerCase()),
),
),
600,
),
);
// -----------------------------------------------------------------------
const country = ref<null | string>(null);
const items = ref<CAutocompleteItem[]>([]);
const loading = ref(false);
let debounce: ReturnType<typeof setTimeout> | undefined;
// Drop responses a newer query has superseded.
let requestId = 0;
const load = async (query: string) => {
const id = ++requestId;
loading.value = true;
const result = await search(query);
if (id !== requestId) return;
items.value = result;
loading.value = false;
};
const onQuery = (event: Event) => {
clearTimeout(debounce);
const query = (event as CustomEvent<string>).detail;
debounce = setTimeout(() => load(query), 300);
};
onBeforeUnmount(() => clearTimeout(debounce));
</script>
<template>
<div>
<!-- In multiple mode the value is an array in pick order. The panel stays
open after a pick and keeps its query, so several matches can be
picked in a row; `max-tags` folds the tags past that count into one
"+N more" tag. -->
<c-autocomplete
v-model="languages"
hint="Type to filter, pick several"
label="Programming languages"
max-tags="3"
placeholder="Start typing to search"
clearable
multiple
>
<!-- An option can carry more than its label: wrap the label in
c-option-value and lay the rest out through a `part` — the row
shows a copy of this markup inside the panel, where page classes
do not reach. The icon takes its brand colour through `color`. -->
<c-option
v-for="option in options"
:key="option.value"
:value="option.value"
>
<div part="language">
<c-option-value>{{ option.label }}</c-option-value>
<c-icon :color="option.color" :path="option.icon" />
</div>
</c-option>
</c-autocomplete>
<p>Value: {{ languages.length ? languages.join(', ') : '[]' }}</p>
</div>
</template>
<script setup lang="ts">
import {
mdiLanguageGo,
mdiLanguageJavascript,
mdiLanguagePython,
mdiLanguageRuby,
mdiLanguageRust,
mdiLanguageTypescript,
} from '@mdi/js';
import { ref } from 'vue';
const languages = ref<string[]>(['ts']);
const options = [
{
color: '#F7DF1E',
icon: mdiLanguageJavascript,
label: 'JavaScript',
value: 'js',
},
{
color: '#3178C6',
icon: mdiLanguageTypescript,
label: 'TypeScript',
value: 'ts',
},
{
color: '#3776AB',
icon: mdiLanguagePython,
label: 'Python',
value: 'py',
},
{
color: '#CE422B',
icon: mdiLanguageRust,
label: 'Rust',
value: 'rs',
},
{
color: '#00ADD8',
icon: mdiLanguageGo,
label: 'Go',
value: 'go',
},
{
color: '#CC342D',
icon: mdiLanguageRuby,
label: 'Ruby',
value: 'rb',
},
];
</script>
<style>
/* Option content is copied into the panel: page classes do not reach it,
the `part` does. */
c-autocomplete::part(language) {
display: flex;
align-items: center;
justify-content: space-between;
gap: 0.5rem;
}
</style>
<template>
<div>
<!-- `select-all` pins a row at the top of the list that picks every
enabled option currently listed — type a query and it picks only the
matches. `texts.selectAll` receives that count; the object is bound
as a property because it holds a function. -->
<c-autocomplete
v-model="languages"
:texts
hint="Type to narrow the list, then select all matches"
label="Programming languages"
max-tags="3"
placeholder="Start typing to search"
clearable
multiple
select-all
>
<c-option value="js">
<c-option-value>JavaScript</c-option-value>
</c-option>
<c-option value="ts">
<c-option-value>TypeScript</c-option-value>
</c-option>
<c-option value="py">
<c-option-value>Python</c-option-value>
</c-option>
<c-option value="rs">
<c-option-value>Rust</c-option-value>
</c-option>
<c-option value="go">
<c-option-value>Go</c-option-value>
</c-option>
<c-option value="rb">
<c-option-value>Ruby</c-option-value>
</c-option>
<c-option value="cobol" disabled>
<c-option-value>COBOL</c-option-value>
</c-option>
</c-autocomplete>
<p>Value: {{ languages.length ? languages.join(', ') : '[]' }}</p>
</div>
</template>
<script setup lang="ts">
import { ref } from 'vue';
const languages = ref<string[]>(['ts']);
const texts = {
selectAll: (count: number) => `Select all ${count} matches`,
};
</script>
<template>
<div>
<c-autocomplete
v-model="language"
label="Programming language"
size="small"
>
<c-option value="js">
<c-option-value>JavaScript</c-option-value>
</c-option>
<c-option value="ts">
<c-option-value>TypeScript</c-option-value>
</c-option>
<c-option value="py">
<c-option-value>Python</c-option-value>
</c-option>
</c-autocomplete>
</div>
</template>
<script setup lang="ts">
import { ref } from 'vue';
const language = ref<null | string>(null);
</script>
<template>
<div>
<c-select
v-model="country"
hint="Each c-option provides a name and a value"
label="Country"
placeholder="Choose a country"
clearable
>
<c-option name="Finland" value="fi">Finland</c-option>
<c-option name="Sweden" value="se">Sweden</c-option>
<c-option name="Norway" value="no">Norway</c-option>
<c-option name="Denmark" value="dk" disabled>Denmark</c-option>
</c-select>
<p>Value: {{ country ?? 'null' }}</p>
</div>
</template>
<script setup lang="ts">
import { ref } from 'vue';
const country = ref<null | string>(null);
</script>
<template>
<div>
<!-- The label lives in c-option-value; the description after it renders
in the row but is not part of the label, so the filter matches and
the closed field shows only "TypeScript". While a query is typed the
runs of the label equal to it are marked (`::part(match)`). -->
<c-autocomplete
v-model="language"
hint="Only the c-option-value text is filtered, marked and used as the label"
label="Programming language"
placeholder="Start typing to search"
clearable
>
<c-option value="js">
<c-option-value>JavaScript</c-option-value>
<small>Web pages and Node.js</small>
</c-option>
<c-option value="ts">
<c-option-value>TypeScript</c-option-value>
<small>JavaScript with static types</small>
</c-option>
<c-option value="py">
<c-option-value>Python</c-option-value>
<small>Scripting and data science</small>
</c-option>
<c-option value="rs">
<c-option-value>Rust</c-option-value>
<small>Systems programming</small>
</c-option>
</c-autocomplete>
<p>Value: {{ language ?? 'null' }}</p>
</div>
</template>
<script setup lang="ts">
import { ref } from 'vue';
const language = ref<null | string>(null);
</script>
API reference
<c-autocomplete>
A filterable value-selection component: a readonly value field that opens a popover panel with a search input above the matching options.
Properties
| Property | Attribute | Type | Default | Description |
|---|---|---|---|---|
clearable | clearable | boolean | false | Make the selected value clearable |
disabled | disabled | boolean | false | Disable the input |
errorMessage | error-message | string | '' | Error message shown in place of the hint while the autocomplete is invalid |
external | external | boolean | false | The consumer owns filtering: the component renders its options verbatim and only emits `change:query` as the user types. Pair with `loading` and an async data source feeding `items` |
filter | — | | — | Custom filter predicate; receives a normalized option + the query. Ignored when `external` is set |
hideMessage | hide-message | boolean | false app default | Hide the message line — the hint and error messages under the field — and the room it keeps. |
hint | hint | string | '' | Hint text for the input |
invalid | invalid | boolean | false | Show the control as invalid: its `error-message`, when set, replaces the hint, and the control is marked `aria-invalid`. |
items | — | | () => [] | Dropdown items (when not using <c-option> elements) |
itemsPerPage | items-per-page | number | 6 app default | Items per page before the list scrolls |
label | label | string | '' | Element label |
labelOnTop | label-on-top | boolean | false app default | Label on top of the input |
loading | loading | boolean | false | Show loading state |
maxTags | max-tags | number | — | In `multiple` mode, show at most this many selected-value tags and fold the rest into one "+N more" tag; `0` shows no tags and reads "N selected" instead; unset shows every tag |
multiple | multiple | boolean | false | Allow selecting several options: rows toggle, the panel stays open and keeps its query, `value` becomes an array of the selected values (items with `return-object`) in the order they were picked, and the picks show as tags inside the field. Arrays have no attribute form — bind `value` as a DOM property |
name | name | string | '' | The name the picked value submits under in a native `<form>` — one entry per value with `multiple` |
placeholder | placeholder | string | '' | Placeholder for the in-panel search input |
required | required | boolean | false | Set the autocomplete as required |
returnObject | return-object | boolean | false | Return object instead of value |
selectAll | select-all | boolean | false | In `multiple` mode, pin a select-all row at the top of the list. Its checkbox shows whether none, some or all enabled options currently listed — the matches while a query is typed, the given `items` with `external` — are selected; activating it selects them all, or, when all are selected, unselects them. Ignored in single mode |
shadow | shadow | boolean | false app default | Shadow variant |
size | size | CFieldSize | 'default' app default | Field height: the 52px default (the shared control height) or the 36px `small` box |
texts | — | | {} app default | UI text overrides (i18n), merged over the English defaults. Objects have no attribute form — bind as a DOM property (`:texts.prop` in Vue) |
value | value | | null | Selected value: the option's value, or the whole item with `return-object`; an array of them in `multiple` mode |
hideDetails deprecated | hide-details | boolean | false app default | Deprecated. Use `hide-message`. Hide the hint and error messages |
app default marks a prop you can set for every instance at once with applyDefaults() — an explicit attribute or property on an instance still wins.
Events
| Event | Detail | Description |
|---|---|---|
change | CAutocompleteValue | Fired when the selected value changes (an option is committed or the selection is cleared), carrying the new value — the option's value, or the whole `{ name, value }` item when `return-object` is set; `null` when cleared. In `multiple` mode the whole array of picked values, in pick order (`[]` when cleared). |
change:query | string | Fired whenever the query changes — on every keystroke in the search input, and with an empty string when the panel opens. Carries the query string. With `external`, drive your data source from this (debounce on your side) and feed the results back via `items`. |
input | void | Native bubbling input event dispatched alongside every value change so a plain `v-model` stays in sync. Carries no detail. |
update:value | CAutocompleteValue | Fired alongside `change` with the same detail — the `v-model` contract. |
Methods
| Method | Signature | Description |
|---|---|---|
focus | (options?: FocusOptions): void | Focus its combobox, as `focus()` does on a native control: the element renders no box of its own to take it. |
Slots
| Slot | Description |
|---|---|
pre | Content placed before the value field inside the input row |
default | The c-option elements used as the data source (never rendered in place) |
post | Content placed after the value field inside the input row |
CSS parts
Style from outside with c-autocomplete::part(name) — parts are the library's only styling customization API.
| Part | Description |
|---|---|
panel | The top-layer popover container anchored below the field |
card | The elevated surface inside the panel holding the search row and the list |
heading-row | The top row of the fullscreen panel (narrow viewports): the field label as heading and the close button |
heading | The field label naming the fullscreen panel |
close | The close button of the fullscreen panel |
search | The search-input row at the top of the panel |
list | The scrollable options listbox |
option | One option row in the list |
select-all | The pinned select-all row at the top of the list (`multiple` mode with `select-all`); carries the same indicator / mark parts as an option row |
indicator | The decorative checkbox box on an option row in `multiple` mode; border, fill and glyph draw with `currentColor`, so `color` recolours them together (the c-checkbox recipe) |
mark | The check glyph inside a row indicator; draws with `currentColor` |
match | A run of an option's label equal to the query, in the row; underlined in the primary colour, text inherits the row |
info | The info row: loading while `loading` with an empty list, otherwise no-results when the query matches no options |
tags | The row of selected-value tags inside the field (`multiple` mode) |
tag | One selected-value tag: the `c-tag` host, including the overflow tag |
tag-root | The pill box inside each tag (the `c-tag` `root` part), for colours and borders |
message | The hint / error message area below the field (always reserved unless `hide-message`) |
Types
Importable from the package root: import type { … } from '@cscfi/csc-ui'
CAutocompleteFilter
Custom filter predicate for `c-autocomplete`. Return `true` to keep the option for the current query. The default matches the start of the label.
export type CAutocompleteFilter = (
option: CAutocompleteOption,
query: string,
) => boolean;CAutocompleteItem
A `c-autocomplete` item. Identical shape to ; aliased for a name that reads naturally at the autocomplete call site.
export type CAutocompleteItem = CSelectItem;CAutocompleteOption
The normalized option handed to a `c-autocomplete` `filter` predicate. `label` is the option's `name` (or its trimmed text content when authored as a slotted `<c-option>`).
export interface CAutocompleteOption {
/** Whether the option is disabled. */
disabled: boolean;
/**
* The option's label: its `name`, else the text of its `c-option-value`,
* else its whole text content (for an `items` entry, its `name`).
*/
label: string;
/** The option's value. */
value: number | string;
}CAutocompleteTexts
UI texts of `c-autocomplete`, shallow-merged over the English defaults. Static labels are strings; count- or label-interpolated ones are functions.
export interface CAutocompleteTexts {
/** Accessible label of the clear button. */
clearSelection?: string;
/** Accessible label of the close button in the fullscreen panel (narrow viewports). */
closePanel?: string;
/** Accessible label of the search input inside the panel. */
filterOptions?: string;
/** Text of the loading row shown while `loading` with nothing to list. */
loading?: string;
/**
* Text of the overflow tag when `max-tags` folds the selection; receives the
* number of hidden tags.
*/
more?: (count: number) => string;
/** Text of the row shown when the query matches no options. */
noResults?: string;
/** Accessible label of a tag's remove button; receives the option label. */
remove?: (label: string) => string;
/** Placeholder of the search input when the `placeholder` prop is empty. */
searchPlaceholder?: string;
/**
* Label of the select-all row; receives the number of enabled options
* listed.
*/
selectAll?: (count: number) => string;
/**
* Field text when `max-tags="0"` shows no tags; receives the selection
* count.
*/
selected?: (count: number) => string;
/** Accessible label of the chevron button that opens and closes the panel. */
toggleOptions?: string;
}CAutocompleteValue
Selection value of `c-autocomplete`: the committed option's value — or the whole `{ name, value }` item with `return-object` — and `null` when cleared. In `multiple` mode an array of them in the order they were picked, `[]` when empty.
export type CAutocompleteValue =
| (number | string)[]
| CAutocompleteItem
| CAutocompleteItem[]
| null
| number
| string;CFieldSize shared
Field height of the form controls built on `c-input`. `default` is the 44px field; `small` is the 36px field. Owned here because the value passes from the wrapping control (`c-select`) into `c-input`.
export type CFieldSize = 'default' | 'small';CSelectItem shared
A selectable item for the value-selection components (`c-select`, `c-autocomplete`) when options are supplied via the `items` prop instead of slotted `<c-option>` elements.
export interface CSelectItem {
/** Disable the item so it cannot be selected. */
disabled?: boolean;
/** The item's display label. */
name: string;
/** The value emitted via v-model when the item is selected. */
value: number | string;
}<c-option>
One option of a `c-select` or `c-autocomplete`: `value` is what the field reports when the option is picked, and the option's label is its `name`, else the text of a `c-option-value` inside it, else its whole text. `disabled` keeps it from being picked, and `selected` sets the field's initial value once, silently, while that value is empty — with a bound `v-model`, initialise the model instead.
Properties
| Property | Attribute | Type | Default | Description |
|---|---|---|---|---|
disabled | disabled | boolean | false | Set option as disabled |
name | name | string | — | Option name (display label fallback) |
selected | selected | boolean | false | Set option as selected |
value | value | number | string | — | Option value |
Slots
| Slot | Description |
|---|---|
default | The option's content, rendered in the list row; wrap the label text in c-option-value when the option carries more than its label |
<c-option-value>
The label region of a `c-option`: wraps the text that c-select and c-autocomplete use as the option's label — in the closed field, its tag and the autocomplete filter — so the option can carry a description or an icon beside its label, and the region in which c-autocomplete marks the runs equal to the query (`::part(match)`).
Slots
| Slot | Description |
|---|---|
default | The option's label: the text c-select and c-autocomplete use for the option in the closed field, its tag and the filter, and the region c-autocomplete marks query matches in |