Combobox
An editable <input> with autocomplete (APG combobox pattern). You type to filter the list and pick an option, or—with data-ts-allow-custom on the root—keep a free-form value. Unlike the Select, the text field is the control.
Forms · TaishoDS Core, in plain HTML.
Examples
One working example per case. Each example is the HTML of its preview—copy it as is, and with Core’s CSS and JS loaded, it looks and works the same.
Search for a team member
<div class="ts combobox" data-ts-listbox="combobox" data-ts-combobox="">
<label class="ts combobox-label" for="ts-combobox-s1">Team member</label>
<div class="ts combobox-control size-md variant-default">
<input
id="ts-combobox-s1"
data-ts-listbox-input=""
class="ts combobox-input"
role="combobox"
aria-autocomplete="list"
aria-expanded="false"
aria-controls="ts-combobox-s1-list"
autocomplete="off"
placeholder="Search for a member"
value=""
/>
<input type="hidden" name="miembro" value="" data-ts-listbox-value="" />
<span class="ts combobox-spinner" data-ts-listbox-spinner="" hidden=""
><span class="ts spinner size-sm" role="status" aria-label="Loading…"></span
></span>
<button
type="button"
class="ts button size-xs variant-tertiary shape-square is-icon-only flex-shrink-0 me-quarter"
tabindex="-1"
aria-label="Show options"
data-ts-listbox-toggle=""
>
<span data-ts-spinner=""><span class="ts spinner size-sm" aria-hidden="true"></span></span>
<span data-ts-content="">
<svg
xmlns="http://www.w3.org/2000/svg"
width="16"
height="16"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
class="ts icon icon-16"
>
<path d="m7 15 5 5 5-5" />
<path d="m7 9 5-5 5 5" />
</svg>
</span>
</button>
</div>
<div
id="ts-combobox-s1-list"
role="listbox"
data-ts-listbox-panel=""
hidden=""
popover="manual"
class="ts combobox-dropdown placement-bottom is-anchored"
>
<div class="ts combobox-loading" data-ts-listbox-loading="" hidden="">
<span class="ts spinner size-sm" role="none" aria-label="" aria-hidden="true"></span>
<span>Loading…</span>
</div>
<button
type="button"
role="option"
data-ts-value="ana"
id="ts-combobox-s1-list-opt-0"
tabindex="-1"
class="ts combobox-option"
aria-selected="false"
>
Ana Torres</button
><button
type="button"
role="option"
data-ts-value="bruno"
id="ts-combobox-s1-list-opt-1"
tabindex="-1"
class="ts combobox-option"
aria-selected="false"
>
Bruno Díaz</button
><button
type="button"
role="option"
data-ts-value="carla"
id="ts-combobox-s1-list-opt-2"
tabindex="-1"
class="ts combobox-option"
aria-selected="false"
>
Carla Ruiz</button
><button
type="button"
role="option"
data-ts-value="diego"
id="ts-combobox-s1-list-opt-3"
tabindex="-1"
class="ts combobox-option"
aria-selected="false"
>
Diego Sosa
</button>
<div class="ts combobox-empty" data-ts-listbox-empty="" hidden="">No results</div>
</div>
</div>Clearable with a value
<div class="ts combobox" data-ts-listbox="combobox" data-ts-combobox="">
<label class="ts combobox-label" for="ts-combobox-s2">Project</label>
<div class="ts combobox-control size-md variant-default">
<input
id="ts-combobox-s2"
data-ts-listbox-input=""
class="ts combobox-input"
role="combobox"
aria-autocomplete="list"
aria-expanded="false"
aria-controls="ts-combobox-s2-list"
autocomplete="off"
placeholder="Choose a project"
value="Payments API"
/>
<input type="hidden" name="proyecto" value="api-pagos" data-ts-listbox-value="" />
<span class="ts combobox-spinner" data-ts-listbox-spinner="" hidden=""
><span class="ts spinner size-sm" role="status" aria-label="Loading…"></span
></span>
<button
type="button"
class="ts button size-xs variant-tertiary shape-square is-icon-only flex-shrink-0"
aria-label="Clear field"
data-ts-clear=""
>
<span data-ts-spinner=""><span class="ts spinner size-sm" aria-hidden="true"></span></span>
<span data-ts-content="">
<svg
xmlns="http://www.w3.org/2000/svg"
width="14"
height="14"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
class="ts icon icon-14"
>
<path d="M18 6 6 18" />
<path d="m6 6 12 12" />
</svg>
</span>
</button>
<button
type="button"
class="ts button size-xs variant-tertiary shape-square is-icon-only flex-shrink-0 me-quarter"
tabindex="-1"
aria-label="Show options"
data-ts-listbox-toggle=""
>
<span data-ts-spinner=""><span class="ts spinner size-sm" aria-hidden="true"></span></span>
<span data-ts-content="">
<svg
xmlns="http://www.w3.org/2000/svg"
width="16"
height="16"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
class="ts icon icon-16"
>
<path d="m7 15 5 5 5-5" />
<path d="m7 9 5-5 5 5" />
</svg>
</span>
</button>
</div>
<div
id="ts-combobox-s2-list"
role="listbox"
data-ts-listbox-panel=""
hidden=""
popover="manual"
class="ts combobox-dropdown placement-bottom is-anchored"
>
<div class="ts combobox-loading" data-ts-listbox-loading="" hidden="">
<span class="ts spinner size-sm" role="none" aria-label="" aria-hidden="true"></span>
<span>Loading…</span>
</div>
<button
type="button"
role="option"
data-ts-value="panel"
id="ts-combobox-s2-list-opt-0"
tabindex="-1"
class="ts combobox-option"
aria-selected="false"
>
Dashboard</button
><button
type="button"
role="option"
data-ts-value="api-pagos"
id="ts-combobox-s2-list-opt-1"
tabindex="-1"
class="ts combobox-option is-selected"
aria-selected="true"
>
Payments API</button
><button
type="button"
role="option"
data-ts-value="marketing"
id="ts-combobox-s2-list-opt-2"
tabindex="-1"
class="ts combobox-option"
aria-selected="false"
>
Marketing site
</button>
<div class="ts combobox-empty" data-ts-listbox-empty="" hidden="">No results</div>
</div>
</div>Read-only
<div class="ts combobox" data-ts-listbox="combobox" data-ts-combobox="">
<label class="ts combobox-label" for="ts-combobox-s3">Environment</label>
<div class="ts combobox-control size-md variant-default is-readonly">
<input
id="ts-combobox-s3"
readonly=""
data-ts-listbox-input=""
class="ts combobox-input"
role="combobox"
aria-autocomplete="list"
aria-expanded="false"
aria-controls="ts-combobox-s3-list"
autocomplete="off"
placeholder="Select an option…"
value="Production"
/>
<input type="hidden" name="entorno" value="produccion" data-ts-listbox-value="" />
<span class="ts combobox-spinner" data-ts-listbox-spinner="" hidden=""
><span class="ts spinner size-sm" role="status" aria-label="Loading…"></span
></span>
<button
type="button"
class="ts button size-xs variant-tertiary shape-square is-icon-only flex-shrink-0 me-quarter"
tabindex="-1"
aria-label="Show options"
data-ts-listbox-toggle=""
hidden=""
>
<span data-ts-spinner=""><span class="ts spinner size-sm" aria-hidden="true"></span></span>
<span data-ts-content="">
<svg
xmlns="http://www.w3.org/2000/svg"
width="16"
height="16"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
class="ts icon icon-16"
>
<path d="m7 15 5 5 5-5" />
<path d="m7 9 5-5 5 5" />
</svg>
</span>
</button>
</div>
<div
id="ts-combobox-s3-list"
role="listbox"
data-ts-listbox-panel=""
hidden=""
popover="manual"
class="ts combobox-dropdown placement-bottom is-anchored"
>
<div class="ts combobox-loading" data-ts-listbox-loading="" hidden="">
<span class="ts spinner size-sm" role="none" aria-label="" aria-hidden="true"></span>
<span>Loading…</span>
</div>
<button
type="button"
role="option"
data-ts-value="produccion"
id="ts-combobox-s3-list-opt-0"
tabindex="-1"
class="ts combobox-option is-selected"
aria-selected="true"
>
Production</button
><button
type="button"
role="option"
data-ts-value="staging"
id="ts-combobox-s3-list-opt-1"
tabindex="-1"
class="ts combobox-option"
aria-selected="false"
>
Staging</button
><button
type="button"
role="option"
data-ts-value="desarrollo"
id="ts-combobox-s3-list-opt-2"
tabindex="-1"
class="ts combobox-option"
aria-selected="false"
>
Development
</button>
<div class="ts combobox-empty" data-ts-listbox-empty="" hidden="">No results</div>
</div>
</div>Compact density, with error
<div class="ts combobox has-error" data-ts-listbox="combobox" data-ts-combobox="">
<label class="ts combobox-label" for="ts-combobox-s4">Project (compact)</label>
<div class="ts combobox-control size-md variant-danger density-compact">
<input
id="ts-combobox-s4"
data-ts-listbox-input=""
class="ts combobox-input"
role="combobox"
aria-autocomplete="list"
aria-expanded="false"
aria-controls="ts-combobox-s4-list"
aria-invalid="true"
aria-describedby="ts-combobox-s4-hint"
autocomplete="off"
placeholder="Choose a project"
value=""
/>
<input type="hidden" name="proyecto-compacto" value="" data-ts-listbox-value="" />
<span class="ts combobox-spinner" data-ts-listbox-spinner="" hidden=""
><span class="ts spinner size-sm" role="status" aria-label="Loading…"></span
></span>
<button
type="button"
class="ts button size-xs variant-tertiary shape-square is-icon-only flex-shrink-0 me-quarter"
tabindex="-1"
aria-label="Show options"
data-ts-listbox-toggle=""
>
<span data-ts-spinner=""><span class="ts spinner size-sm" aria-hidden="true"></span></span>
<span data-ts-content="">
<svg
xmlns="http://www.w3.org/2000/svg"
width="16"
height="16"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
class="ts icon icon-16"
>
<path d="m7 15 5 5 5-5" />
<path d="m7 9 5-5 5 5" />
</svg>
</span>
</button>
</div>
<div
id="ts-combobox-s4-list"
role="listbox"
data-ts-listbox-panel=""
hidden=""
popover="manual"
class="ts combobox-dropdown placement-bottom is-anchored"
>
<div class="ts combobox-loading" data-ts-listbox-loading="" hidden="">
<span class="ts spinner size-sm" role="none" aria-label="" aria-hidden="true"></span>
<span>Loading…</span>
</div>
<button
type="button"
role="option"
data-ts-value="panel"
id="ts-combobox-s4-list-opt-0"
tabindex="-1"
class="ts combobox-option"
aria-selected="false"
>
Dashboard</button
><button
type="button"
role="option"
data-ts-value="api-pagos"
id="ts-combobox-s4-list-opt-1"
tabindex="-1"
class="ts combobox-option"
aria-selected="false"
>
Payments API</button
><button
type="button"
role="option"
data-ts-value="marketing"
id="ts-combobox-s4-list-opt-2"
tabindex="-1"
class="ts combobox-option"
aria-selected="false"
>
Marketing site
</button>
<div class="ts combobox-empty" data-ts-listbox-empty="" hidden="">No results</div>
</div>
<div class="ts input-footer">
<div id="ts-combobox-s4-hint" class="ts input-hint variant-danger" aria-live="polite">
<span>Choose a project from the list.</span>
</div>
</div>
</div>With search icon
<div class="ts combobox" data-ts-listbox="combobox" data-ts-combobox="">
<label class="ts combobox-label" for="ts-combobox-s5">Project</label>
<div class="ts combobox-control size-md variant-default">
<div class="ts combobox-prefix-block">
<svg
xmlns="http://www.w3.org/2000/svg"
width="16"
height="16"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
class="ts icon icon-16"
>
<path d="m21 21-4.34-4.34" />
<circle cx="11" cy="11" r="8" />
</svg>
</div>
<input
id="ts-combobox-s5"
data-ts-listbox-input=""
class="ts combobox-input"
role="combobox"
aria-autocomplete="list"
aria-expanded="false"
aria-controls="ts-combobox-s5-list"
autocomplete="off"
placeholder="Search for a project"
value=""
/>
<input type="hidden" name="proyecto-buscar" value="" data-ts-listbox-value="" />
<span class="ts combobox-spinner" data-ts-listbox-spinner="" hidden=""
><span class="ts spinner size-sm" role="status" aria-label="Loading…"></span
></span>
<button
type="button"
class="ts button size-xs variant-tertiary shape-square is-icon-only flex-shrink-0 me-quarter"
tabindex="-1"
aria-label="Show options"
data-ts-listbox-toggle=""
>
<span data-ts-spinner=""><span class="ts spinner size-sm" aria-hidden="true"></span></span>
<span data-ts-content="">
<svg
xmlns="http://www.w3.org/2000/svg"
width="16"
height="16"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
class="ts icon icon-16"
>
<path d="m7 15 5 5 5-5" />
<path d="m7 9 5-5 5 5" />
</svg>
</span>
</button>
</div>
<div
id="ts-combobox-s5-list"
role="listbox"
data-ts-listbox-panel=""
hidden=""
popover="manual"
class="ts combobox-dropdown placement-bottom is-anchored"
>
<div class="ts combobox-loading" data-ts-listbox-loading="" hidden="">
<span class="ts spinner size-sm" role="none" aria-label="" aria-hidden="true"></span>
<span>Loading…</span>
</div>
<button
type="button"
role="option"
data-ts-value="panel"
id="ts-combobox-s5-list-opt-0"
tabindex="-1"
class="ts combobox-option"
aria-selected="false"
>
Dashboard</button
><button
type="button"
role="option"
data-ts-value="api-pagos"
id="ts-combobox-s5-list-opt-1"
tabindex="-1"
class="ts combobox-option"
aria-selected="false"
>
Payments API</button
><button
type="button"
role="option"
data-ts-value="marketing"
id="ts-combobox-s5-list-opt-2"
tabindex="-1"
class="ts combobox-option"
aria-selected="false"
>
Marketing site
</button>
<div class="ts combobox-empty" data-ts-listbox-empty="" hidden="">No results</div>
</div>
</div>Options grouped by role
<div class="ts combobox" data-ts-listbox="combobox" data-ts-combobox="">
<label class="ts combobox-label" for="ts-combobox-s6">Owner</label>
<div class="ts combobox-control size-md variant-default">
<input
id="ts-combobox-s6"
data-ts-listbox-input=""
class="ts combobox-input"
role="combobox"
aria-autocomplete="list"
aria-expanded="false"
aria-controls="ts-combobox-s6-list"
autocomplete="off"
placeholder="Search for a person"
value=""
/>
<input type="hidden" name="responsable" value="" data-ts-listbox-value="" />
<span class="ts combobox-spinner" data-ts-listbox-spinner="" hidden=""
><span class="ts spinner size-sm" role="status" aria-label="Loading…"></span
></span>
<button
type="button"
class="ts button size-xs variant-tertiary shape-square is-icon-only flex-shrink-0 me-quarter"
tabindex="-1"
aria-label="Show options"
data-ts-listbox-toggle=""
>
<span data-ts-spinner=""><span class="ts spinner size-sm" aria-hidden="true"></span></span>
<span data-ts-content="">
<svg
xmlns="http://www.w3.org/2000/svg"
width="16"
height="16"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
class="ts icon icon-16"
>
<path d="m7 15 5 5 5-5" />
<path d="m7 9 5-5 5 5" />
</svg>
</span>
</button>
</div>
<div
id="ts-combobox-s6-list"
role="listbox"
data-ts-listbox-panel=""
hidden=""
popover="manual"
class="ts combobox-dropdown placement-bottom is-anchored"
>
<div class="ts combobox-loading" data-ts-listbox-loading="" hidden="">
<span class="ts spinner size-sm" role="none" aria-label="" aria-hidden="true"></span>
<span>Loading…</span>
</div>
<div role="group" aria-labelledby="ts-combobox-s6-list-grp-0">
<div class="ts combobox-group-label" id="ts-combobox-s6-list-grp-0">Admin</div>
<button
type="button"
role="option"
data-ts-value="ana"
id="ts-combobox-s6-list-opt-0"
tabindex="-1"
class="ts combobox-option"
aria-selected="false"
>
Ana Torres
</button>
</div>
<div role="group" aria-labelledby="ts-combobox-s6-list-grp-1">
<div class="ts combobox-group-label" id="ts-combobox-s6-list-grp-1">Editor</div>
<button
type="button"
role="option"
data-ts-value="bruno"
id="ts-combobox-s6-list-opt-1"
tabindex="-1"
class="ts combobox-option"
aria-selected="false"
>
Bruno Díaz</button
><button
type="button"
role="option"
data-ts-value="carla"
id="ts-combobox-s6-list-opt-2"
tabindex="-1"
class="ts combobox-option"
aria-selected="false"
>
Carla Ruiz
</button>
</div>
<div role="group" aria-labelledby="ts-combobox-s6-list-grp-2">
<div class="ts combobox-group-label" id="ts-combobox-s6-list-grp-2">Viewer</div>
<button
type="button"
role="option"
data-ts-value="diego"
id="ts-combobox-s6-list-opt-3"
tabindex="-1"
class="ts combobox-option"
aria-selected="false"
>
Diego Sosa
</button>
</div>
<div class="ts combobox-empty" data-ts-listbox-empty="" hidden="">No results</div>
</div>
</div>Server-side search, loading
<div class="ts combobox" data-ts-listbox="combobox" data-ts-combobox="" data-ts-async="">
<label class="ts combobox-label" for="ts-combobox-s7">Project on the server</label>
<div class="ts combobox-control size-md variant-default is-loading">
<input
id="ts-combobox-s7"
data-ts-listbox-input=""
class="ts combobox-input"
role="combobox"
aria-autocomplete="list"
aria-expanded="false"
aria-controls="ts-combobox-s7-list"
aria-busy="true"
autocomplete="off"
placeholder="Type to search"
value=""
/>
<input type="hidden" name="proyecto-remoto" value="" data-ts-listbox-value="" />
<span class="ts combobox-spinner" data-ts-listbox-spinner=""
><span class="ts spinner size-sm" role="status" aria-label="Loading…"></span
></span>
<button
type="button"
class="ts button size-xs variant-tertiary shape-square is-icon-only flex-shrink-0 me-quarter"
tabindex="-1"
aria-label="Show options"
data-ts-listbox-toggle=""
>
<span data-ts-spinner=""><span class="ts spinner size-sm" aria-hidden="true"></span></span>
<span data-ts-content="">
<svg
xmlns="http://www.w3.org/2000/svg"
width="16"
height="16"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
class="ts icon icon-16"
>
<path d="m7 15 5 5 5-5" />
<path d="m7 9 5-5 5 5" />
</svg>
</span>
</button>
</div>
<div
id="ts-combobox-s7-list"
role="listbox"
data-ts-listbox-panel=""
aria-busy="true"
hidden=""
popover="manual"
class="ts combobox-dropdown placement-bottom is-anchored"
>
<div class="ts combobox-loading" data-ts-listbox-loading="">
<span class="ts spinner size-sm" role="none" aria-label="" aria-hidden="true"></span>
<span>Loading…</span>
</div>
<button
type="button"
role="option"
data-ts-value="panel"
id="ts-combobox-s7-list-opt-0"
tabindex="-1"
class="ts combobox-option"
aria-selected="false"
>
Dashboard</button
><button
type="button"
role="option"
data-ts-value="api-pagos"
id="ts-combobox-s7-list-opt-1"
tabindex="-1"
class="ts combobox-option"
aria-selected="false"
>
Payments API
</button>
<div class="ts combobox-empty" data-ts-listbox-empty="" hidden="">No results</div>
</div>
</div>Inside a filters popover
<div class="ts popover-root">
<button
type="button"
class="ts button size-md variant-secondary"
popovertarget="ts-popover-s8"
aria-haspopup="dialog"
aria-expanded="false"
>
Filter deployments
</button>
<div
id="ts-popover-s8"
popover="auto"
class="ts popover placement-bottom-start is-anchored"
role="dialog"
aria-modal="false"
aria-label="Deployment filters"
tabindex="-1"
>
<div class="ts combobox" data-ts-listbox="combobox" data-ts-combobox="">
<label class="ts combobox-label" for="ts-combobox-s9">Project to filter</label>
<div class="ts combobox-control size-md variant-default">
<input
id="ts-combobox-s9"
data-ts-listbox-input=""
class="ts combobox-input"
role="combobox"
aria-autocomplete="list"
aria-expanded="false"
aria-controls="ts-combobox-s9-list"
autocomplete="off"
placeholder="Choose a project"
value=""
/>
<input type="hidden" name="filtro-proyecto" value="" data-ts-listbox-value="" />
<span class="ts combobox-spinner" data-ts-listbox-spinner="" hidden=""
><span class="ts spinner size-sm" role="status" aria-label="Loading…"></span
></span>
<button
type="button"
class="ts button size-xs variant-tertiary shape-square is-icon-only flex-shrink-0 me-quarter"
tabindex="-1"
aria-label="Show options"
data-ts-listbox-toggle=""
>
<span data-ts-spinner=""
><span class="ts spinner size-sm" aria-hidden="true"></span
></span>
<span data-ts-content="">
<svg
xmlns="http://www.w3.org/2000/svg"
width="16"
height="16"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
class="ts icon icon-16"
>
<path d="m7 15 5 5 5-5" />
<path d="m7 9 5-5 5 5" />
</svg>
</span>
</button>
</div>
<div
id="ts-combobox-s9-list"
role="listbox"
data-ts-listbox-panel=""
hidden=""
popover="manual"
class="ts combobox-dropdown placement-bottom is-anchored"
>
<div class="ts combobox-loading" data-ts-listbox-loading="" hidden="">
<span class="ts spinner size-sm" role="none" aria-label="" aria-hidden="true"></span>
<span>Loading…</span>
</div>
<button
type="button"
role="option"
data-ts-value="panel"
id="ts-combobox-s9-list-opt-0"
tabindex="-1"
class="ts combobox-option"
aria-selected="false"
>
Dashboard</button
><button
type="button"
role="option"
data-ts-value="api-pagos"
id="ts-combobox-s9-list-opt-1"
tabindex="-1"
class="ts combobox-option"
aria-selected="false"
>
Payments API</button
><button
type="button"
role="option"
data-ts-value="marketing"
id="ts-combobox-s9-list-opt-2"
tabindex="-1"
class="ts combobox-option"
aria-selected="false"
>
Marketing site
</button>
<div class="ts combobox-empty" data-ts-listbox-empty="" hidden="">No results</div>
</div>
</div>
</div>
</div>With hint, icon, and description
<div class="ts combobox" data-ts-listbox="combobox" data-ts-combobox="">
<label class="ts combobox-label" for="ts-combobox-s10">Plan</label>
<div class="ts combobox-control size-md variant-default">
<input
id="ts-combobox-s10"
data-ts-listbox-input=""
class="ts combobox-input"
role="combobox"
aria-autocomplete="list"
aria-expanded="false"
aria-controls="ts-combobox-s10-list"
aria-describedby="ts-combobox-s10-hint"
autocomplete="off"
placeholder="Search for a plan"
value=""
/>
<input type="hidden" name="plan" value="" data-ts-listbox-value="" />
<span class="ts combobox-spinner" data-ts-listbox-spinner="" hidden=""
><span class="ts spinner size-sm" role="status" aria-label="Loading…"></span
></span>
<button
type="button"
class="ts button size-xs variant-tertiary shape-square is-icon-only flex-shrink-0 me-quarter"
tabindex="-1"
aria-label="Show options"
data-ts-listbox-toggle=""
>
<span data-ts-spinner=""><span class="ts spinner size-sm" aria-hidden="true"></span></span>
<span data-ts-content="">
<svg
xmlns="http://www.w3.org/2000/svg"
width="16"
height="16"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
class="ts icon icon-16"
>
<path d="m7 15 5 5 5-5" />
<path d="m7 9 5-5 5 5" />
</svg>
</span>
</button>
</div>
<div
id="ts-combobox-s10-list"
role="listbox"
data-ts-listbox-panel=""
hidden=""
popover="manual"
class="ts combobox-dropdown placement-bottom is-anchored"
>
<div class="ts combobox-loading" data-ts-listbox-loading="" hidden="">
<span class="ts spinner size-sm" role="none" aria-label="" aria-hidden="true"></span>
<span>Loading…</span>
</div>
<button
type="button"
role="option"
data-ts-value="free"
id="ts-combobox-s10-list-opt-0"
tabindex="-1"
class="ts combobox-option"
aria-selected="false"
aria-labelledby="ts-combobox-s10-list-optlabel-0"
aria-describedby="ts-combobox-s10-list-optdesc-0"
>
<span data-select-option-icon="" aria-hidden="true"
><svg
xmlns="http://www.w3.org/2000/svg"
width="16"
height="16"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
class="ts icon icon-16"
>
<path
d="M14 9.536V7a4 4 0 0 1 4-4h1.5a.5.5 0 0 1 .5.5V5a4 4 0 0 1-4 4 4 4 0 0 0-4 4c0 2 1 3 1 5a5 5 0 0 1-1 3"
/>
<path d="M4 9a5 5 0 0 1 8 4 5 5 0 0 1-8-4" />
<path d="M5 21h14" /></svg
></span>
<span data-select-option-text=""
><span id="ts-combobox-s10-list-optlabel-0" data-select-option-label="">Free</span>
<span id="ts-combobox-s10-list-optdesc-0" data-select-option-description=""
>For trying out the workspace.</span
></span
></button
><button
type="button"
role="option"
data-ts-value="pro"
id="ts-combobox-s10-list-opt-1"
tabindex="-1"
class="ts combobox-option"
aria-selected="false"
aria-labelledby="ts-combobox-s10-list-optlabel-1"
aria-describedby="ts-combobox-s10-list-optdesc-1"
>
<span data-select-option-text=""
><span id="ts-combobox-s10-list-optlabel-1" data-select-option-label="">Pro</span>
<span id="ts-combobox-s10-list-optdesc-1" data-select-option-description=""
>Unlimited deployments for your team.</span
></span
>
</button>
<div class="ts combobox-empty" data-ts-listbox-empty="" hidden="">No results</div>
</div>
<div class="ts input-footer">
<div id="ts-combobox-s10-hint" class="ts input-hint variant-default">
<span>Sets the workspace limits.</span>
</div>
</div>
</div>Multiple owners
<div class="ts combobox" data-ts-listbox="combobox" data-ts-combobox="" data-ts-multiple="">
<label class="ts combobox-label" for="ts-combobox-s11">Project owners</label>
<div class="ts combobox-control size-md variant-default">
<div class="ts combobox-values" data-ts-listbox-tags="">
<span data-ts-value="ana" class="ts tag variant-default size-sm" data-ts-dismissible="">
<span class="ts truncate" data-tag-label="">Ana Torres</span>
<button
type="button"
class="ts button size-xs variant-ghost shape-square is-icon-only flex-shrink-0 is-color-inherit"
data-tag-close="true"
data-ts-dismiss=""
aria-label="Remove Ana Torres"
>
<span data-ts-spinner=""
><span class="ts spinner size-sm" aria-hidden="true"></span
></span>
<span data-ts-content="">
<svg
xmlns="http://www.w3.org/2000/svg"
width="10"
height="10"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
class="ts icon icon-10"
>
<path d="M18 6 6 18" />
<path d="m6 6 12 12" />
</svg>
</span></button></span
><span data-ts-value="carla" class="ts tag variant-default size-sm" data-ts-dismissible="">
<span class="ts truncate" data-tag-label="">Carla Ruiz</span>
<button
type="button"
class="ts button size-xs variant-ghost shape-square is-icon-only flex-shrink-0 is-color-inherit"
data-tag-close="true"
data-ts-dismiss=""
aria-label="Remove Carla Ruiz"
>
<span data-ts-spinner=""
><span class="ts spinner size-sm" aria-hidden="true"></span
></span>
<span data-ts-content="">
<svg
xmlns="http://www.w3.org/2000/svg"
width="10"
height="10"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
class="ts icon icon-10"
>
<path d="M18 6 6 18" />
<path d="m6 6 12 12" />
</svg>
</span></button
></span>
<input
id="ts-combobox-s11"
data-ts-placeholder="Search for people"
data-ts-listbox-input=""
class="ts combobox-input"
role="combobox"
aria-autocomplete="list"
aria-expanded="false"
aria-controls="ts-combobox-s11-list"
autocomplete="off"
value=""
/>
<template data-ts-listbox-tag-template=""
><span
data-ts-value="{nombre}"
class="ts tag variant-default size-sm"
data-ts-dismissible=""
>
<span class="ts truncate" data-tag-label="">{nombre}</span>
<button
type="button"
class="ts button size-xs variant-ghost shape-square is-icon-only flex-shrink-0 is-color-inherit"
data-tag-close="true"
data-ts-dismiss=""
aria-label="Remove {nombre}"
>
<span data-ts-spinner=""
><span class="ts spinner size-sm" aria-hidden="true"></span
></span>
<span data-ts-content="">
<svg
xmlns="http://www.w3.org/2000/svg"
width="10"
height="10"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
class="ts icon icon-10"
>
<path d="M18 6 6 18" />
<path d="m6 6 12 12" />
</svg>
</span></button></span
></template>
</div>
<input type="hidden" name="responsables" disabled="" data-ts-listbox-template="" />
<input type="hidden" name="responsables" value="ana" data-ts-listbox-value="" /><input
type="hidden"
name="responsables"
value="carla"
data-ts-listbox-value=""
/>
<span class="ts combobox-spinner" data-ts-listbox-spinner="" hidden=""
><span class="ts spinner size-sm" role="status" aria-label="Loading…"></span
></span>
<button
type="button"
class="ts button size-xs variant-tertiary shape-square is-icon-only flex-shrink-0"
aria-label="Clear field"
data-ts-clear=""
>
<span data-ts-spinner=""><span class="ts spinner size-sm" aria-hidden="true"></span></span>
<span data-ts-content="">
<svg
xmlns="http://www.w3.org/2000/svg"
width="14"
height="14"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
class="ts icon icon-14"
>
<path d="M18 6 6 18" />
<path d="m6 6 12 12" />
</svg>
</span>
</button>
<button
type="button"
class="ts button size-xs variant-tertiary shape-square is-icon-only flex-shrink-0 me-quarter"
tabindex="-1"
aria-label="Show options"
data-ts-listbox-toggle=""
>
<span data-ts-spinner=""><span class="ts spinner size-sm" aria-hidden="true"></span></span>
<span data-ts-content="">
<svg
xmlns="http://www.w3.org/2000/svg"
width="16"
height="16"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
class="ts icon icon-16"
>
<path d="m7 15 5 5 5-5" />
<path d="m7 9 5-5 5 5" />
</svg>
</span>
</button>
</div>
<div
id="ts-combobox-s11-list"
role="listbox"
data-ts-listbox-panel=""
aria-multiselectable="true"
hidden=""
popover="manual"
class="ts combobox-dropdown placement-bottom is-anchored"
>
<div class="ts combobox-loading" data-ts-listbox-loading="" hidden="">
<span class="ts spinner size-sm" role="none" aria-label="" aria-hidden="true"></span>
<span>Loading…</span>
</div>
<button
type="button"
role="option"
data-ts-value="ana"
id="ts-combobox-s11-list-opt-0"
tabindex="-1"
class="ts combobox-option is-selected"
aria-selected="true"
>
<span
aria-hidden="true"
class="ts checkbox size-sm variant-primary is-checked"
data-select-option-checkbox="true"
>
<span class="ts checkbox-box"
><svg
xmlns="http://www.w3.org/2000/svg"
width="10"
height="10"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="3.5"
stroke-linecap="round"
stroke-linejoin="round"
class="ts icon icon-10 checkbox-icon checkbox-icon-check"
>
<path d="M20 6 9 17l-5-5" />
</svg>
<svg
xmlns="http://www.w3.org/2000/svg"
width="10"
height="10"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="3.5"
stroke-linecap="round"
stroke-linejoin="round"
class="ts icon icon-10 checkbox-icon checkbox-icon-minus"
>
<path d="M5 12h14" /></svg
></span>
</span>
<span data-select-option-label="">Ana Torres</span></button
><button
type="button"
role="option"
data-ts-value="bruno"
id="ts-combobox-s11-list-opt-1"
tabindex="-1"
class="ts combobox-option"
aria-selected="false"
>
<span
aria-hidden="true"
class="ts checkbox size-sm variant-primary"
data-select-option-checkbox="true"
>
<span class="ts checkbox-box"
><svg
xmlns="http://www.w3.org/2000/svg"
width="10"
height="10"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="3.5"
stroke-linecap="round"
stroke-linejoin="round"
class="ts icon icon-10 checkbox-icon checkbox-icon-check"
>
<path d="M20 6 9 17l-5-5" />
</svg>
<svg
xmlns="http://www.w3.org/2000/svg"
width="10"
height="10"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="3.5"
stroke-linecap="round"
stroke-linejoin="round"
class="ts icon icon-10 checkbox-icon checkbox-icon-minus"
>
<path d="M5 12h14" /></svg
></span>
</span>
<span data-select-option-label="">Bruno Díaz</span></button
><button
type="button"
role="option"
data-ts-value="carla"
id="ts-combobox-s11-list-opt-2"
tabindex="-1"
class="ts combobox-option is-selected"
aria-selected="true"
>
<span
aria-hidden="true"
class="ts checkbox size-sm variant-primary is-checked"
data-select-option-checkbox="true"
>
<span class="ts checkbox-box"
><svg
xmlns="http://www.w3.org/2000/svg"
width="10"
height="10"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="3.5"
stroke-linecap="round"
stroke-linejoin="round"
class="ts icon icon-10 checkbox-icon checkbox-icon-check"
>
<path d="M20 6 9 17l-5-5" />
</svg>
<svg
xmlns="http://www.w3.org/2000/svg"
width="10"
height="10"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="3.5"
stroke-linecap="round"
stroke-linejoin="round"
class="ts icon icon-10 checkbox-icon checkbox-icon-minus"
>
<path d="M5 12h14" /></svg
></span>
</span>
<span data-select-option-label="">Carla Ruiz</span></button
><button
type="button"
role="option"
data-ts-value="diego"
id="ts-combobox-s11-list-opt-3"
tabindex="-1"
class="ts combobox-option"
aria-selected="false"
>
<span
aria-hidden="true"
class="ts checkbox size-sm variant-primary"
data-select-option-checkbox="true"
>
<span class="ts checkbox-box"
><svg
xmlns="http://www.w3.org/2000/svg"
width="10"
height="10"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="3.5"
stroke-linecap="round"
stroke-linejoin="round"
class="ts icon icon-10 checkbox-icon checkbox-icon-check"
>
<path d="M20 6 9 17l-5-5" />
</svg>
<svg
xmlns="http://www.w3.org/2000/svg"
width="10"
height="10"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="3.5"
stroke-linecap="round"
stroke-linejoin="round"
class="ts icon icon-10 checkbox-icon checkbox-icon-minus"
>
<path d="M5 12h14" /></svg
></span>
</span>
<span data-select-option-label="">Diego Sosa</span></button
><button
type="button"
role="option"
data-ts-value="elena"
id="ts-combobox-s11-list-opt-4"
tabindex="-1"
class="ts combobox-option"
aria-selected="false"
>
<span
aria-hidden="true"
class="ts checkbox size-sm variant-primary"
data-select-option-checkbox="true"
>
<span class="ts checkbox-box"
><svg
xmlns="http://www.w3.org/2000/svg"
width="10"
height="10"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="3.5"
stroke-linecap="round"
stroke-linejoin="round"
class="ts icon icon-10 checkbox-icon checkbox-icon-check"
>
<path d="M20 6 9 17l-5-5" />
</svg>
<svg
xmlns="http://www.w3.org/2000/svg"
width="10"
height="10"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="3.5"
stroke-linecap="round"
stroke-linejoin="round"
class="ts icon icon-10 checkbox-icon checkbox-icon-minus"
>
<path d="M5 12h14" /></svg
></span>
</span>
<span data-select-option-label="">Elena Vega</span>
</button>
<div class="ts combobox-empty" data-ts-listbox-empty="" hidden="">No results</div>
</div>
<span
class="ts sr-only"
aria-live="polite"
data-ts-listbox-live=""
data-ts-added-text="{nombre} added."
data-ts-removed-text="{nombre} removed."
data-ts-cleared-text="Selection cleared."
></span>
</div>Class reference
Every value of each modifier, with its HTML ready to copy.
Size
Field height: sm, md, or lg.
<div class="ts combobox" data-ts-listbox="combobox" data-ts-combobox="">
<div class="ts combobox-control size-sm variant-default">
<input
id="ts-combobox-v-s1"
data-ts-listbox-input=""
class="ts combobox-input"
role="combobox"
aria-autocomplete="list"
aria-expanded="false"
aria-controls="ts-combobox-v-s1-list"
autocomplete="off"
placeholder="Choose an environment"
value=""
/>
<span class="ts combobox-spinner" data-ts-listbox-spinner="" hidden="">
<span class="ts spinner size-sm" role="status" aria-label="Loading…"></span>
</span>
<button
type="button"
class="ts button size-xs variant-tertiary shape-square is-icon-only flex-shrink-0 me-quarter"
tabindex="-1"
aria-label="Show options"
data-ts-listbox-toggle=""
>
<svg
xmlns="http://www.w3.org/2000/svg"
width="14"
height="14"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
class="ts icon icon-14"
>
<path d="m7 15 5 5 5-5" />
<path d="m7 9 5-5 5 5" />
</svg>
</button>
</div>
<div
id="ts-combobox-v-s1-list"
role="listbox"
data-ts-listbox-panel=""
hidden=""
popover="manual"
class="ts combobox-dropdown placement-bottom is-anchored"
>
<div class="ts combobox-loading" data-ts-listbox-loading="" hidden="">
<span class="ts spinner size-sm" role="none" aria-label="" aria-hidden="true"></span>
<span>Loading…</span>
</div>
<button
type="button"
role="option"
data-ts-value="produccion"
id="ts-combobox-v-s1-list-opt-0"
tabindex="-1"
class="ts combobox-option"
aria-selected="false"
>
Production
</button>
<button
type="button"
role="option"
data-ts-value="staging"
id="ts-combobox-v-s1-list-opt-1"
tabindex="-1"
class="ts combobox-option"
aria-selected="false"
>
Staging
</button>
<button
type="button"
role="option"
data-ts-value="desarrollo"
id="ts-combobox-v-s1-list-opt-2"
tabindex="-1"
class="ts combobox-option"
aria-selected="false"
>
Development
</button>
<div class="ts combobox-empty" data-ts-listbox-empty="" hidden="">No results</div>
</div>
</div>
<div class="ts combobox" data-ts-listbox="combobox" data-ts-combobox="">
<div class="ts combobox-control size-md variant-default">
<input
id="ts-combobox-v-s2"
data-ts-listbox-input=""
class="ts combobox-input"
role="combobox"
aria-autocomplete="list"
aria-expanded="false"
aria-controls="ts-combobox-v-s2-list"
autocomplete="off"
placeholder="Choose an environment"
value=""
/>
<span class="ts combobox-spinner" data-ts-listbox-spinner="" hidden="">
<span class="ts spinner size-sm" role="status" aria-label="Loading…"></span>
</span>
<button
type="button"
class="ts button size-xs variant-tertiary shape-square is-icon-only flex-shrink-0 me-quarter"
tabindex="-1"
aria-label="Show options"
data-ts-listbox-toggle=""
>
<svg
xmlns="http://www.w3.org/2000/svg"
width="16"
height="16"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
class="ts icon icon-16"
>
<path d="m7 15 5 5 5-5" />
<path d="m7 9 5-5 5 5" />
</svg>
</button>
</div>
<div
id="ts-combobox-v-s2-list"
role="listbox"
data-ts-listbox-panel=""
hidden=""
popover="manual"
class="ts combobox-dropdown placement-bottom is-anchored"
>
<div class="ts combobox-loading" data-ts-listbox-loading="" hidden="">
<span class="ts spinner size-sm" role="none" aria-label="" aria-hidden="true"></span>
<span>Loading…</span>
</div>
<button
type="button"
role="option"
data-ts-value="produccion"
id="ts-combobox-v-s2-list-opt-0"
tabindex="-1"
class="ts combobox-option"
aria-selected="false"
>
Production
</button>
<button
type="button"
role="option"
data-ts-value="staging"
id="ts-combobox-v-s2-list-opt-1"
tabindex="-1"
class="ts combobox-option"
aria-selected="false"
>
Staging
</button>
<button
type="button"
role="option"
data-ts-value="desarrollo"
id="ts-combobox-v-s2-list-opt-2"
tabindex="-1"
class="ts combobox-option"
aria-selected="false"
>
Development
</button>
<div class="ts combobox-empty" data-ts-listbox-empty="" hidden="">No results</div>
</div>
</div>
<div class="ts combobox" data-ts-listbox="combobox" data-ts-combobox="">
<div class="ts combobox-control size-lg variant-default">
<input
id="ts-combobox-v-s3"
data-ts-listbox-input=""
class="ts combobox-input"
role="combobox"
aria-autocomplete="list"
aria-expanded="false"
aria-controls="ts-combobox-v-s3-list"
autocomplete="off"
placeholder="Choose an environment"
value=""
/>
<span class="ts combobox-spinner" data-ts-listbox-spinner="" hidden="">
<span class="ts spinner size-md" role="status" aria-label="Loading…"></span>
</span>
<button
type="button"
class="ts button size-xs variant-tertiary shape-square is-icon-only flex-shrink-0 me-quarter"
tabindex="-1"
aria-label="Show options"
data-ts-listbox-toggle=""
>
<svg
xmlns="http://www.w3.org/2000/svg"
width="18"
height="18"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
class="ts icon icon-18"
>
<path d="m7 15 5 5 5-5" />
<path d="m7 9 5-5 5 5" />
</svg>
</button>
</div>
<div
id="ts-combobox-v-s3-list"
role="listbox"
data-ts-listbox-panel=""
hidden=""
popover="manual"
class="ts combobox-dropdown placement-bottom is-anchored"
>
<div class="ts combobox-loading" data-ts-listbox-loading="" hidden="">
<span class="ts spinner size-sm" role="none" aria-label="" aria-hidden="true"></span>
<span>Loading…</span>
</div>
<button
type="button"
role="option"
data-ts-value="produccion"
id="ts-combobox-v-s3-list-opt-0"
tabindex="-1"
class="ts combobox-option"
aria-selected="false"
>
Production
</button>
<button
type="button"
role="option"
data-ts-value="staging"
id="ts-combobox-v-s3-list-opt-1"
tabindex="-1"
class="ts combobox-option"
aria-selected="false"
>
Staging
</button>
<button
type="button"
role="option"
data-ts-value="desarrollo"
id="ts-combobox-v-s3-list-opt-2"
tabindex="-1"
class="ts combobox-option"
aria-selected="false"
>
Development
</button>
<div class="ts combobox-empty" data-ts-listbox-empty="" hidden="">No results</div>
</div>
</div>Variant
The border color for validation: default, success, warning, info, or danger.
<div class="ts combobox" data-ts-listbox="combobox" data-ts-combobox="">
<div class="ts combobox-control size-md variant-default">
<input
id="ts-combobox-v-s4"
data-ts-listbox-input=""
class="ts combobox-input"
role="combobox"
aria-autocomplete="list"
aria-expanded="false"
aria-controls="ts-combobox-v-s4-list"
autocomplete="off"
placeholder="Choose an environment"
value=""
/>
<span class="ts combobox-spinner" data-ts-listbox-spinner="" hidden="">
<span class="ts spinner size-sm" role="status" aria-label="Loading…"></span>
</span>
<button
type="button"
class="ts button size-xs variant-tertiary shape-square is-icon-only flex-shrink-0 me-quarter"
tabindex="-1"
aria-label="Show options"
data-ts-listbox-toggle=""
>
<svg
xmlns="http://www.w3.org/2000/svg"
width="16"
height="16"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
class="ts icon icon-16"
>
<path d="m7 15 5 5 5-5" />
<path d="m7 9 5-5 5 5" />
</svg>
</button>
</div>
<div
id="ts-combobox-v-s4-list"
role="listbox"
data-ts-listbox-panel=""
hidden=""
popover="manual"
class="ts combobox-dropdown placement-bottom is-anchored"
>
<div class="ts combobox-loading" data-ts-listbox-loading="" hidden="">
<span class="ts spinner size-sm" role="none" aria-label="" aria-hidden="true"></span>
<span>Loading…</span>
</div>
<button
type="button"
role="option"
data-ts-value="produccion"
id="ts-combobox-v-s4-list-opt-0"
tabindex="-1"
class="ts combobox-option"
aria-selected="false"
>
Production
</button>
<button
type="button"
role="option"
data-ts-value="staging"
id="ts-combobox-v-s4-list-opt-1"
tabindex="-1"
class="ts combobox-option"
aria-selected="false"
>
Staging
</button>
<button
type="button"
role="option"
data-ts-value="desarrollo"
id="ts-combobox-v-s4-list-opt-2"
tabindex="-1"
class="ts combobox-option"
aria-selected="false"
>
Development
</button>
<div class="ts combobox-empty" data-ts-listbox-empty="" hidden="">No results</div>
</div>
</div>
<div class="ts combobox" data-ts-listbox="combobox" data-ts-combobox="">
<div class="ts combobox-control size-md variant-success">
<input
id="ts-combobox-v-s5"
data-ts-listbox-input=""
class="ts combobox-input"
role="combobox"
aria-autocomplete="list"
aria-expanded="false"
aria-controls="ts-combobox-v-s5-list"
autocomplete="off"
placeholder="Choose an environment"
value=""
/>
<span class="ts combobox-spinner" data-ts-listbox-spinner="" hidden="">
<span class="ts spinner size-sm" role="status" aria-label="Loading…"></span>
</span>
<button
type="button"
class="ts button size-xs variant-tertiary shape-square is-icon-only flex-shrink-0 me-quarter"
tabindex="-1"
aria-label="Show options"
data-ts-listbox-toggle=""
>
<svg
xmlns="http://www.w3.org/2000/svg"
width="16"
height="16"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
class="ts icon icon-16"
>
<path d="m7 15 5 5 5-5" />
<path d="m7 9 5-5 5 5" />
</svg>
</button>
</div>
<div
id="ts-combobox-v-s5-list"
role="listbox"
data-ts-listbox-panel=""
hidden=""
popover="manual"
class="ts combobox-dropdown placement-bottom is-anchored"
>
<div class="ts combobox-loading" data-ts-listbox-loading="" hidden="">
<span class="ts spinner size-sm" role="none" aria-label="" aria-hidden="true"></span>
<span>Loading…</span>
</div>
<button
type="button"
role="option"
data-ts-value="produccion"
id="ts-combobox-v-s5-list-opt-0"
tabindex="-1"
class="ts combobox-option"
aria-selected="false"
>
Production
</button>
<button
type="button"
role="option"
data-ts-value="staging"
id="ts-combobox-v-s5-list-opt-1"
tabindex="-1"
class="ts combobox-option"
aria-selected="false"
>
Staging
</button>
<button
type="button"
role="option"
data-ts-value="desarrollo"
id="ts-combobox-v-s5-list-opt-2"
tabindex="-1"
class="ts combobox-option"
aria-selected="false"
>
Development
</button>
<div class="ts combobox-empty" data-ts-listbox-empty="" hidden="">No results</div>
</div>
</div>
<div class="ts combobox" data-ts-listbox="combobox" data-ts-combobox="">
<div class="ts combobox-control size-md variant-warning">
<input
id="ts-combobox-v-s6"
data-ts-listbox-input=""
class="ts combobox-input"
role="combobox"
aria-autocomplete="list"
aria-expanded="false"
aria-controls="ts-combobox-v-s6-list"
autocomplete="off"
placeholder="Choose an environment"
value=""
/>
<span class="ts combobox-spinner" data-ts-listbox-spinner="" hidden="">
<span class="ts spinner size-sm" role="status" aria-label="Loading…"></span>
</span>
<button
type="button"
class="ts button size-xs variant-tertiary shape-square is-icon-only flex-shrink-0 me-quarter"
tabindex="-1"
aria-label="Show options"
data-ts-listbox-toggle=""
>
<svg
xmlns="http://www.w3.org/2000/svg"
width="16"
height="16"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
class="ts icon icon-16"
>
<path d="m7 15 5 5 5-5" />
<path d="m7 9 5-5 5 5" />
</svg>
</button>
</div>
<div
id="ts-combobox-v-s6-list"
role="listbox"
data-ts-listbox-panel=""
hidden=""
popover="manual"
class="ts combobox-dropdown placement-bottom is-anchored"
>
<div class="ts combobox-loading" data-ts-listbox-loading="" hidden="">
<span class="ts spinner size-sm" role="none" aria-label="" aria-hidden="true"></span>
<span>Loading…</span>
</div>
<button
type="button"
role="option"
data-ts-value="produccion"
id="ts-combobox-v-s6-list-opt-0"
tabindex="-1"
class="ts combobox-option"
aria-selected="false"
>
Production
</button>
<button
type="button"
role="option"
data-ts-value="staging"
id="ts-combobox-v-s6-list-opt-1"
tabindex="-1"
class="ts combobox-option"
aria-selected="false"
>
Staging
</button>
<button
type="button"
role="option"
data-ts-value="desarrollo"
id="ts-combobox-v-s6-list-opt-2"
tabindex="-1"
class="ts combobox-option"
aria-selected="false"
>
Development
</button>
<div class="ts combobox-empty" data-ts-listbox-empty="" hidden="">No results</div>
</div>
</div>
<div class="ts combobox" data-ts-listbox="combobox" data-ts-combobox="">
<div class="ts combobox-control size-md variant-info">
<input
id="ts-combobox-v-s7"
data-ts-listbox-input=""
class="ts combobox-input"
role="combobox"
aria-autocomplete="list"
aria-expanded="false"
aria-controls="ts-combobox-v-s7-list"
autocomplete="off"
placeholder="Choose an environment"
value=""
/>
<span class="ts combobox-spinner" data-ts-listbox-spinner="" hidden="">
<span class="ts spinner size-sm" role="status" aria-label="Loading…"></span>
</span>
<button
type="button"
class="ts button size-xs variant-tertiary shape-square is-icon-only flex-shrink-0 me-quarter"
tabindex="-1"
aria-label="Show options"
data-ts-listbox-toggle=""
>
<svg
xmlns="http://www.w3.org/2000/svg"
width="16"
height="16"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
class="ts icon icon-16"
>
<path d="m7 15 5 5 5-5" />
<path d="m7 9 5-5 5 5" />
</svg>
</button>
</div>
<div
id="ts-combobox-v-s7-list"
role="listbox"
data-ts-listbox-panel=""
hidden=""
popover="manual"
class="ts combobox-dropdown placement-bottom is-anchored"
>
<div class="ts combobox-loading" data-ts-listbox-loading="" hidden="">
<span class="ts spinner size-sm" role="none" aria-label="" aria-hidden="true"></span>
<span>Loading…</span>
</div>
<button
type="button"
role="option"
data-ts-value="produccion"
id="ts-combobox-v-s7-list-opt-0"
tabindex="-1"
class="ts combobox-option"
aria-selected="false"
>
Production
</button>
<button
type="button"
role="option"
data-ts-value="staging"
id="ts-combobox-v-s7-list-opt-1"
tabindex="-1"
class="ts combobox-option"
aria-selected="false"
>
Staging
</button>
<button
type="button"
role="option"
data-ts-value="desarrollo"
id="ts-combobox-v-s7-list-opt-2"
tabindex="-1"
class="ts combobox-option"
aria-selected="false"
>
Development
</button>
<div class="ts combobox-empty" data-ts-listbox-empty="" hidden="">No results</div>
</div>
</div>
<div class="ts combobox has-error" data-ts-listbox="combobox" data-ts-combobox="">
<div class="ts combobox-control size-md variant-danger">
<input
id="ts-combobox-v-s8"
data-ts-listbox-input=""
class="ts combobox-input"
role="combobox"
aria-autocomplete="list"
aria-expanded="false"
aria-controls="ts-combobox-v-s8-list"
aria-invalid="true"
autocomplete="off"
placeholder="Choose an environment"
value=""
/>
<span class="ts combobox-spinner" data-ts-listbox-spinner="" hidden="">
<span class="ts spinner size-sm" role="status" aria-label="Loading…"></span>
</span>
<button
type="button"
class="ts button size-xs variant-tertiary shape-square is-icon-only flex-shrink-0 me-quarter"
tabindex="-1"
aria-label="Show options"
data-ts-listbox-toggle=""
>
<svg
xmlns="http://www.w3.org/2000/svg"
width="16"
height="16"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
class="ts icon icon-16"
>
<path d="m7 15 5 5 5-5" />
<path d="m7 9 5-5 5 5" />
</svg>
</button>
</div>
<div
id="ts-combobox-v-s8-list"
role="listbox"
data-ts-listbox-panel=""
hidden=""
popover="manual"
class="ts combobox-dropdown placement-bottom is-anchored"
>
<div class="ts combobox-loading" data-ts-listbox-loading="" hidden="">
<span class="ts spinner size-sm" role="none" aria-label="" aria-hidden="true"></span>
<span>Loading…</span>
</div>
<button
type="button"
role="option"
data-ts-value="produccion"
id="ts-combobox-v-s8-list-opt-0"
tabindex="-1"
class="ts combobox-option"
aria-selected="false"
>
Production
</button>
<button
type="button"
role="option"
data-ts-value="staging"
id="ts-combobox-v-s8-list-opt-1"
tabindex="-1"
class="ts combobox-option"
aria-selected="false"
>
Staging
</button>
<button
type="button"
role="option"
data-ts-value="desarrollo"
id="ts-combobox-v-s8-list-opt-2"
tabindex="-1"
class="ts combobox-option"
aria-selected="false"
>
Development
</button>
<div class="ts combobox-empty" data-ts-listbox-empty="" hidden="">No results</div>
</div>
</div>Density
The field’s inner spacing: comfortable or compact.
<div class="ts combobox" data-ts-listbox="combobox" data-ts-combobox="">
<div class="ts combobox-control size-md variant-default density-comfortable">
<input
id="ts-combobox-v-s9"
data-ts-listbox-input=""
class="ts combobox-input"
role="combobox"
aria-autocomplete="list"
aria-expanded="false"
aria-controls="ts-combobox-v-s9-list"
autocomplete="off"
placeholder="Choose an environment"
value=""
/>
<span class="ts combobox-spinner" data-ts-listbox-spinner="" hidden="">
<span class="ts spinner size-sm" role="status" aria-label="Loading…"></span>
</span>
<button
type="button"
class="ts button size-xs variant-tertiary shape-square is-icon-only flex-shrink-0 me-quarter"
tabindex="-1"
aria-label="Show options"
data-ts-listbox-toggle=""
>
<svg
xmlns="http://www.w3.org/2000/svg"
width="16"
height="16"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
class="ts icon icon-16"
>
<path d="m7 15 5 5 5-5" />
<path d="m7 9 5-5 5 5" />
</svg>
</button>
</div>
<div
id="ts-combobox-v-s9-list"
role="listbox"
data-ts-listbox-panel=""
hidden=""
popover="manual"
class="ts combobox-dropdown placement-bottom is-anchored"
>
<div class="ts combobox-loading" data-ts-listbox-loading="" hidden="">
<span class="ts spinner size-sm" role="none" aria-label="" aria-hidden="true"></span>
<span>Loading…</span>
</div>
<button
type="button"
role="option"
data-ts-value="produccion"
id="ts-combobox-v-s9-list-opt-0"
tabindex="-1"
class="ts combobox-option"
aria-selected="false"
>
Production
</button>
<button
type="button"
role="option"
data-ts-value="staging"
id="ts-combobox-v-s9-list-opt-1"
tabindex="-1"
class="ts combobox-option"
aria-selected="false"
>
Staging
</button>
<button
type="button"
role="option"
data-ts-value="desarrollo"
id="ts-combobox-v-s9-list-opt-2"
tabindex="-1"
class="ts combobox-option"
aria-selected="false"
>
Development
</button>
<div class="ts combobox-empty" data-ts-listbox-empty="" hidden="">No results</div>
</div>
</div>
<div class="ts combobox" data-ts-listbox="combobox" data-ts-combobox="">
<div class="ts combobox-control size-md variant-default density-compact">
<input
id="ts-combobox-v-s10"
data-ts-listbox-input=""
class="ts combobox-input"
role="combobox"
aria-autocomplete="list"
aria-expanded="false"
aria-controls="ts-combobox-v-s10-list"
autocomplete="off"
placeholder="Choose an environment"
value=""
/>
<span class="ts combobox-spinner" data-ts-listbox-spinner="" hidden="">
<span class="ts spinner size-sm" role="status" aria-label="Loading…"></span>
</span>
<button
type="button"
class="ts button size-xs variant-tertiary shape-square is-icon-only flex-shrink-0 me-quarter"
tabindex="-1"
aria-label="Show options"
data-ts-listbox-toggle=""
>
<svg
xmlns="http://www.w3.org/2000/svg"
width="16"
height="16"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
class="ts icon icon-16"
>
<path d="m7 15 5 5 5-5" />
<path d="m7 9 5-5 5 5" />
</svg>
</button>
</div>
<div
id="ts-combobox-v-s10-list"
role="listbox"
data-ts-listbox-panel=""
hidden=""
popover="manual"
class="ts combobox-dropdown placement-bottom is-anchored"
>
<div class="ts combobox-loading" data-ts-listbox-loading="" hidden="">
<span class="ts spinner size-sm" role="none" aria-label="" aria-hidden="true"></span>
<span>Loading…</span>
</div>
<button
type="button"
role="option"
data-ts-value="produccion"
id="ts-combobox-v-s10-list-opt-0"
tabindex="-1"
class="ts combobox-option"
aria-selected="false"
>
Production
</button>
<button
type="button"
role="option"
data-ts-value="staging"
id="ts-combobox-v-s10-list-opt-1"
tabindex="-1"
class="ts combobox-option"
aria-selected="false"
>
Staging
</button>
<button
type="button"
role="option"
data-ts-value="desarrollo"
id="ts-combobox-v-s10-list-opt-2"
tabindex="-1"
class="ts combobox-option"
aria-selected="false"
>
Development
</button>
<div class="ts combobox-empty" data-ts-listbox-empty="" hidden="">No results</div>
</div>
</div>States
is-loading shows the Spinner in the field and the panel’s Loading… (aria-busy) without blocking editing. is-readonly prevents editing but keeps the field focusable.
<div class="ts combobox" data-ts-listbox="combobox" data-ts-combobox="">
<div class="ts combobox-control size-md variant-default is-loading">
<input
id="ts-combobox-v-s11"
data-ts-listbox-input=""
class="ts combobox-input"
role="combobox"
aria-autocomplete="list"
aria-expanded="false"
aria-controls="ts-combobox-v-s11-list"
aria-busy="true"
autocomplete="off"
placeholder="Choose an environment"
value=""
/>
<span class="ts combobox-spinner" data-ts-listbox-spinner="">
<span class="ts spinner size-sm" role="status" aria-label="Loading…"></span>
</span>
<button
type="button"
class="ts button size-xs variant-tertiary shape-square is-icon-only flex-shrink-0 me-quarter"
tabindex="-1"
aria-label="Show options"
data-ts-listbox-toggle=""
>
<svg
xmlns="http://www.w3.org/2000/svg"
width="16"
height="16"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
class="ts icon icon-16"
>
<path d="m7 15 5 5 5-5" />
<path d="m7 9 5-5 5 5" />
</svg>
</button>
</div>
<div
id="ts-combobox-v-s11-list"
role="listbox"
data-ts-listbox-panel=""
aria-busy="true"
hidden=""
popover="manual"
class="ts combobox-dropdown placement-bottom is-anchored"
>
<div class="ts combobox-loading" data-ts-listbox-loading="">
<span class="ts spinner size-sm" role="none" aria-label="" aria-hidden="true"></span>
<span>Loading…</span>
</div>
<button
type="button"
role="option"
data-ts-value="produccion"
id="ts-combobox-v-s11-list-opt-0"
tabindex="-1"
class="ts combobox-option"
aria-selected="false"
>
Production
</button>
<button
type="button"
role="option"
data-ts-value="staging"
id="ts-combobox-v-s11-list-opt-1"
tabindex="-1"
class="ts combobox-option"
aria-selected="false"
>
Staging
</button>
<button
type="button"
role="option"
data-ts-value="desarrollo"
id="ts-combobox-v-s11-list-opt-2"
tabindex="-1"
class="ts combobox-option"
aria-selected="false"
>
Development
</button>
<div class="ts combobox-empty" data-ts-listbox-empty="" hidden="">No results</div>
</div>
</div>
<div class="ts combobox" data-ts-listbox="combobox" data-ts-combobox="">
<div class="ts combobox-control size-md variant-default is-readonly">
<input
id="ts-combobox-v-s12"
readonly=""
data-ts-listbox-input=""
class="ts combobox-input"
role="combobox"
aria-autocomplete="list"
aria-expanded="false"
aria-controls="ts-combobox-v-s12-list"
autocomplete="off"
placeholder="Select an option…"
value="Production"
/>
<span class="ts combobox-spinner" data-ts-listbox-spinner="" hidden="">
<span class="ts spinner size-sm" role="status" aria-label="Loading…"></span>
</span>
<button
type="button"
class="ts button size-xs variant-tertiary shape-square is-icon-only flex-shrink-0 me-quarter"
tabindex="-1"
aria-label="Show options"
data-ts-listbox-toggle=""
hidden=""
>
<svg
xmlns="http://www.w3.org/2000/svg"
width="16"
height="16"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
class="ts icon icon-16"
>
<path d="m7 15 5 5 5-5" />
<path d="m7 9 5-5 5 5" />
</svg>
</button>
</div>
<div
id="ts-combobox-v-s12-list"
role="listbox"
data-ts-listbox-panel=""
hidden=""
popover="manual"
class="ts combobox-dropdown placement-bottom is-anchored"
>
<div class="ts combobox-loading" data-ts-listbox-loading="" hidden="">
<span class="ts spinner size-sm" role="none" aria-label="" aria-hidden="true"></span>
<span>Loading…</span>
</div>
<button
type="button"
role="option"
data-ts-value="produccion"
id="ts-combobox-v-s12-list-opt-0"
tabindex="-1"
class="ts combobox-option is-selected"
aria-selected="true"
>
Production
</button>
<button
type="button"
role="option"
data-ts-value="staging"
id="ts-combobox-v-s12-list-opt-1"
tabindex="-1"
class="ts combobox-option"
aria-selected="false"
>
Staging
</button>
<button
type="button"
role="option"
data-ts-value="desarrollo"
id="ts-combobox-v-s12-list-opt-2"
tabindex="-1"
class="ts combobox-option"
aria-selected="false"
>
Development
</button>
<div class="ts combobox-empty" data-ts-listbox-empty="" hidden="">No results</div>
</div>
</div>Combinations
Size and variant combined.
<div class="ts combobox has-error" data-ts-listbox="combobox" data-ts-combobox="">
<div class="ts combobox-control size-lg variant-danger">
<input
id="ts-combobox-v-s13"
data-ts-listbox-input=""
class="ts combobox-input"
role="combobox"
aria-autocomplete="list"
aria-expanded="false"
aria-controls="ts-combobox-v-s13-list"
aria-invalid="true"
autocomplete="off"
placeholder="Choose an environment"
value=""
/>
<span class="ts combobox-spinner" data-ts-listbox-spinner="" hidden="">
<span class="ts spinner size-md" role="status" aria-label="Loading…"></span>
</span>
<button
type="button"
class="ts button size-xs variant-tertiary shape-square is-icon-only flex-shrink-0 me-quarter"
tabindex="-1"
aria-label="Show options"
data-ts-listbox-toggle=""
>
<svg
xmlns="http://www.w3.org/2000/svg"
width="18"
height="18"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
class="ts icon icon-18"
>
<path d="m7 15 5 5 5-5" />
<path d="m7 9 5-5 5 5" />
</svg>
</button>
</div>
<div
id="ts-combobox-v-s13-list"
role="listbox"
data-ts-listbox-panel=""
hidden=""
popover="manual"
class="ts combobox-dropdown placement-bottom is-anchored"
>
<div class="ts combobox-loading" data-ts-listbox-loading="" hidden="">
<span class="ts spinner size-sm" role="none" aria-label="" aria-hidden="true"></span>
<span>Loading…</span>
</div>
<button
type="button"
role="option"
data-ts-value="produccion"
id="ts-combobox-v-s13-list-opt-0"
tabindex="-1"
class="ts combobox-option"
aria-selected="false"
>
Production
</button>
<button
type="button"
role="option"
data-ts-value="staging"
id="ts-combobox-v-s13-list-opt-1"
tabindex="-1"
class="ts combobox-option"
aria-selected="false"
>
Staging
</button>
<button
type="button"
role="option"
data-ts-value="desarrollo"
id="ts-combobox-v-s13-list-opt-2"
tabindex="-1"
class="ts combobox-option"
aria-selected="false"
>
Development
</button>
<div class="ts combobox-empty" data-ts-listbox-empty="" hidden="">No results</div>
</div>
</div>
<div class="ts combobox" data-ts-listbox="combobox" data-ts-combobox="">
<div class="ts combobox-control size-sm variant-success">
<input
id="ts-combobox-v-s14"
data-ts-listbox-input=""
class="ts combobox-input"
role="combobox"
aria-autocomplete="list"
aria-expanded="false"
aria-controls="ts-combobox-v-s14-list"
autocomplete="off"
placeholder="Choose an environment"
value=""
/>
<span class="ts combobox-spinner" data-ts-listbox-spinner="" hidden="">
<span class="ts spinner size-sm" role="status" aria-label="Loading…"></span>
</span>
<button
type="button"
class="ts button size-xs variant-tertiary shape-square is-icon-only flex-shrink-0 me-quarter"
tabindex="-1"
aria-label="Show options"
data-ts-listbox-toggle=""
>
<svg
xmlns="http://www.w3.org/2000/svg"
width="14"
height="14"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
stroke-width="2"
stroke-linecap="round"
stroke-linejoin="round"
class="ts icon icon-14"
>
<path d="m7 15 5 5 5-5" />
<path d="m7 9 5-5 5 5" />
</svg>
</button>
</div>
<div
id="ts-combobox-v-s14-list"
role="listbox"
data-ts-listbox-panel=""
hidden=""
popover="manual"
class="ts combobox-dropdown placement-bottom is-anchored"
>
<div class="ts combobox-loading" data-ts-listbox-loading="" hidden="">
<span class="ts spinner size-sm" role="none" aria-label="" aria-hidden="true"></span>
<span>Loading…</span>
</div>
<button
type="button"
role="option"
data-ts-value="produccion"
id="ts-combobox-v-s14-list-opt-0"
tabindex="-1"
class="ts combobox-option"
aria-selected="false"
>
Production
</button>
<button
type="button"
role="option"
data-ts-value="staging"
id="ts-combobox-v-s14-list-opt-1"
tabindex="-1"
class="ts combobox-option"
aria-selected="false"
>
Staging
</button>
<button
type="button"
role="option"
data-ts-value="desarrollo"
id="ts-combobox-v-s14-list-opt-2"
tabindex="-1"
class="ts combobox-option"
aria-selected="false"
>
Development
</button>
<div class="ts combobox-empty" data-ts-listbox-empty="" hidden="">No results</div>
</div>
</div>When to use
- The list is long, and typing to filter is the natural way to reach an option.
- The user might need a value that isn’t in the list (
data-ts-allow-custom). - Autocompleting as they type saves more than opening a panel and scanning it.
- You need to assign several values from a long or server-backed list, and it helps to see them in the field (
data-ts-multiple).
When not to use
- The list is short and known, so opening it and picking is enough →
select. - You want a search box inside the panel, or to summarize several options as a count →
select. - You’re not capturing a value but running app-wide commands →
command-palette.
Do
- Show a clear empty state when the filter finds nothing.
- If you allow free-form values, make it obvious how to confirm a new one.
Don’t
- Don’t use it for four options. For so few, the input adds more friction than a Select.
- Don’t hide important options behind the filter without a visible default.
Related
TaishoDS Core
Needs Core’s JS, which handles focus, keyboard, and state.
It’s a free-text field with live filtering and a list of options.
Core hooks into it through these attributes. They go in the markup, and there’s nothing to initialize.
data-ts-asyncdata-ts-cleardata-ts-comboboxdata-ts-dismissdata-ts-dismissibledata-ts-listboxdata-ts-listbox-emptydata-ts-listbox-inputdata-ts-listbox-livedata-ts-listbox-loadingdata-ts-listbox-paneldata-ts-listbox-spinnerdata-ts-listbox-tag-templatedata-ts-listbox-tagsdata-ts-listbox-templatedata-ts-listbox-toggledata-ts-listbox-valuedata-ts-multipledata-ts-placeholderdata-ts-value
What it does: The APG combobox pattern on top of Select’s list, plus filtering as you type. Esc with the panel open doesn’t propagate to a Popover that contains it, and hovering an option makes it active. Groups (role="group" with aria-labelledby) are filtered by hiding the heading of any group left empty.
| Attribute | What it does |
|---|---|
data-ts-allow-custom | On the root. Accepts text that isn’t in the list as the value. |
data-ts-listbox-toggle | The chevron as a button. |
data-ts-clear | The clear button. |
readonly | On the input, as in any field. |
density-compact, ts combobox-prefix-block | Compact density and prefix: markup and CSS. |
data-select-option-icon, data-select-option-description | Options with an icon and a description are static markup. The field shows only the label. |
setComboboxLoading(root, true | false) | Sets is-loading, aria-busy, the Spinner, and the “Loading…” message. |
data-ts-async | On the root. Core doesn’t filter on the client (the server already did). Your app listens to ts:change and reads query. |
form.reset() | Returns to the initial value. |
From the CDN, without a build, load taisho.combobox.css along with taisho.base.css. Also load:
taisho.button.csstaisho.checkbox.csstaisho.icon.csstaisho.spinner.csstaisho.tag.csstaisho.visually-hidden.css
For how Core works in general, see Behavior.
Accessibility
Implements the Combobox pattern from the WAI-ARIA APG.
- The input is
role="combobox"witharia-autocomplete="list",aria-expanded, andaria-controlspointing to the listbox. - Navigation: arrow keys to move through the options, Enter to select the focused one (or confirm the text), and Esc to revert and close.
aria-activedescendantpoints to the highlighted option, which the screen reader announces without moving focus out of the input. Hovering an option highlights it (and makes it the active one).- Options with a description are named by their label (
aria-labelledby) and described witharia-describedby. The icon is decorative (aria-hidden). The field shows only the label. - The chevron is a
<button tabindex="-1" aria-label="Show options">(data-ts-listbox-togglein Core). It opens or closes with the mouse or touch and stays out of the Tab order, because the keyboard already has the input and the arrow keys. The mouse doesn’t take focus away from the input. - The clear button (
data-ts-clear) comes right after the input in the Tab order, has its ownaria-label, and only shows with a value, withoutdisabled, and withoutreadonly. Activating it empties the value, and focus stays on the input. readonlydoesn’t open the panel with the mouse or the arrow keys. The input stays focusable and selectable, without the chevron or the clear button.- With the panel open, Esc closes it and doesn’t propagate to a Popover or Modal that contains the Combobox. With the panel closed, Esc reaches the container.
form.reset()restores the initial value without firing the change event. - Options with a
groupgo inside arole="group"named by its heading (aria-labelledby). The arrow keys move through the options in visual order, jumping from one group to the next. Headings aren’t options and don’t receive focus. When filtering, a group left with no options disappears along with its heading. - For async mode, call
setComboboxLoading(root, true|false). It setsis-loadingandaria-busy="true"on the input and the panel, plus arole="status"Spinner in the field. That’s the only announcement, so “Loading” isn’t repeated twice. In the panel, “Loading…” is visible text next to a decorative Spinner, because a listbox doesn’t allow children withrole="status". While loading, “No results” isn’t shown, because it would be false. It doesn’t disable the input, so you can keep typing. - The prefix is decorative (an icon or avatar) and stays out of the Tab order. The input’s accessible name is still its label. Density (
density-compactordensity-comfortable) only changes the size. It doesn’t touch any ARIA attribute. - With
multiple(data-ts-multiplein Core), the listbox carriesaria-multiselectable="true"and each option itsaria-selected. The checkbox is decorative (aria-hidden). Additions and removals are announced through anaria-live="polite"region, because focus doesn’t move when you pick. Each tag’s button is named after the value it removes. When you remove a tag with the keyboard, focus moves to the neighboring tag or, if none are left, to the input.requiredblocks submission only while there are no values.form.reset()restores the initial selection.
Keyboard
On top of what the browser already does (Tab moves focus, Enter activates a button).
| Key | What it does |
|---|---|
| ↑↓ | Move through the filtered options. |
| Enter | Selects the focused option, or confirms the typed text. |
| Esc | Reverts to the previous value and closes. |
| Enter(multiple) | Adds or removes the focused option without closing the panel. With no focused option, adds the typed text if it matches an option or free-form values are allowed. |
| Backspace(multiple) | With an empty field, removes the last tag. With text, deletes text. |
| Tab(multiple) | Moves through each tag’s remove button before reaching the field. |
Verification
What was actually tested. Anything that wasn’t tested says so—we’d rather say “not verified” than claim too much.
- axe WCAG 2.2 A + AA in a real browser, in light and dark mode, before every release.
- keyboard Key map documented above, checked against the component.
- screen reader Not verified with a screen reader. Test it in your own combination of components, not just here, where each one appears alone and on its happy path.