Компоненти
Изберете
Падащ списък за избор от набор с опции.
Употреба
Основен
Europe
United States
Asia Pacific
HTML
<bs:bsui-select placeholder="Pick a region">
<bs:bsui-select-trigger />
<bs:bsui-select-popup>
<bs:bsui-select-option value="eu" label="Europe" />
<bs:bsui-select-option value="us" label="United States" />
<bs:bsui-select-option value="ap" label="Asia Pacific" />
</bs:bsui-select-popup>
</bs:bsui-select>Множество
Няколко стойности наведнъж, показани в спусъка при избиране.
WordPress
Laravel
Astro
Rails
HTML
<bs:bsui-select multiple="true" name="stack" placeholder="Pick your stack">
<bs:bsui-select-trigger />
<bs:bsui-select-popup>
<bs:bsui-select-option value="wordpress" label="WordPress" />
<bs:bsui-select-option value="laravel" label="Laravel" />
<bs:bsui-select-option value="astro" label="Astro" />
<bs:bsui-select-option value="rails" label="Rails" />
</bs:bsui-select-popup>
</bs:bsui-select>Недостъпна опция
Групата изпраща pro, докато някой не я промени, а enterprise се вижда, но не може да бъде избрана.
Free
Pro
Enterprise, contact sales
HTML
<bs:bsui-select name="plan" defaultValue="pro" placeholder="Pick a plan">
<bs:bsui-select-trigger />
<bs:bsui-select-popup>
<bs:bsui-select-option value="free" label="Free" />
<bs:bsui-select-option value="pro" label="Pro" />
<bs:bsui-select-option value="enterprise" label="Enterprise, contact sales" disabled="true" />
</bs:bsui-select-popup>
</bs:bsui-select>В поле
Съобщението за грешка е прикрепено към полето, така че самото поле за избор остава непроменено.
Europe
United States
HTML
<bs:bsui-field invalid="true">
<bs:bsui-field-label text="Region" />
<bs:bsui-select name="region" placeholder="Pick a region">
<bs:bsui-select-trigger />
<bs:bsui-select-popup>
<bs:bsui-select-option value="eu" label="Europe" />
<bs:bsui-select-option value="us" label="United States" />
</bs:bsui-select-popup>
</bs:bsui-select>
<bs:bsui-field-error text="Pick the region your data has to stay in." />
</bs:bsui-field>Структура
Изберете е съставен от блоковете по-долу. Всеки от тях е отделен блок, който се визуализира само в родителския си блок.
bsui/selectbsui/select-popupbsui/select-optionbsui/select-trigger
Атрибути
| Атрибут | Тип | По подразбиране |
|---|---|---|
defaultValue | text | — |
multiple | toggle | false |
name | text | — |
placeholder | text | Select... |
nameAlt | text | — |
onChange | text | — |
value | text | — |
options | text | — |
bsui/select-popup
Този блок не приема атрибути.
bsui/select-option
| Атрибут | Тип | По подразбиране |
|---|---|---|
value | text | — |
label | text | — |
disabled | toggle | false |
bsui/select-trigger
Този блок не приема атрибути.