Komponenten
Combobox
Ein Texteingabefeld, das während der Eingabe eine Optionsliste filtert.
Verwendung
Einfach
WordPress
Astro
Laravel
HTML
<bs:bsui-combobox placeholder="Pick a framework">
<bs:bsui-combobox-input />
<bs:bsui-combobox-popup>
<bs:bsui-combobox-option value="wordpress" label="WordPress" />
<bs:bsui-combobox-option value="astro" label="Astro" />
<bs:bsui-combobox-option value="laravel" label="Laravel" />
</bs:bsui-combobox-popup>
</bs:bsui-combobox>Lange Liste
Durch die Eingabe werden die Optionen gefiltert – das bietet eine Combobox zusätzlich zu einem Auswahlfeld.
Lisbon
London
Berlin
Helsinki
Istanbul
Dubai
Singapore
Tokyo
Sydney
HTML
<bs:bsui-combobox name="timezone" placeholder="Search time zones">
<bs:bsui-combobox-input />
<bs:bsui-combobox-popup>
<bs:bsui-combobox-option value="lisbon" label="Lisbon" />
<bs:bsui-combobox-option value="london" label="London" />
<bs:bsui-combobox-option value="berlin" label="Berlin" />
<bs:bsui-combobox-option value="helsinki" label="Helsinki" />
<bs:bsui-combobox-option value="istanbul" label="Istanbul" />
<bs:bsui-combobox-option value="dubai" label="Dubai" />
<bs:bsui-combobox-option value="singapore" label="Singapore" />
<bs:bsui-combobox-option value="tokyo" label="Tokyo" />
<bs:bsui-combobox-option value="sydney" label="Sydney" />
</bs:bsui-combobox-popup>
</bs:bsui-combobox>In einem Feld
Ein name-Attribut übermittelt den gewählten Wert, während der sichtbare Text die Beschriftung bleibt.
Ada Lovelace
Grace Hopper
Alan Turing
HTML
<bs:bsui-field>
<bs:bsui-field-label text="Assignee" />
<bs:bsui-combobox name="assignee" placeholder="Search teammates">
<bs:bsui-combobox-input />
<bs:bsui-combobox-popup>
<bs:bsui-combobox-option value="ada" label="Ada Lovelace" />
<bs:bsui-combobox-option value="grace" label="Grace Hopper" />
<bs:bsui-combobox-option value="alan" label="Alan Turing" />
</bs:bsui-combobox-popup>
</bs:bsui-combobox>
<bs:bsui-field-description text="Only people with access to this project are listed." />
</bs:bsui-field>Aufbau
Combobox besteht aus den folgenden Blöcken. Jeder davon ist ein eigener Block, der nur innerhalb seines übergeordneten Blocks gerendert wird.
bsui/comboboxbsui/combobox-inputbsui/combobox-popupbsui/combobox-option
Attribute
| Attribut | Typ | Standard |
|---|---|---|
placeholder | text | Search... |
name | text | — |
bsui/combobox-input
Dieser Block nimmt keine Attribute entgegen.
bsui/combobox-popup
Dieser Block nimmt keine Attribute entgegen.
bsui/combobox-option
| Attribut | Typ | Standard |
|---|---|---|
value | text | — |
label | text | — |