Компоненти
Поле
Обгръща един контрол с етикет, описание и съобщение за грешка.
Употреба
Основен
We only use this for receipts.
HTML
<bs:bsui-field>
<bs:bsui-field-label text="Email address" />
<bs:bsui-input type="email" placeholder="you@example.com" />
<bs:bsui-field-description text="We only use this for receipts." />
</bs:bsui-field>Невалидно състояние
Маркирането на полето като невалидно променя цвета на контролата и показва съобщението под нея.
Enter an address with a domain, like ada@example.com.
HTML
<bs:bsui-field invalid="true">
<bs:bsui-field-label text="Work email" />
<bs:bsui-input type="email" defaultValue="ada@example" />
<bs:bsui-field-error text="Enter an address with a domain, like ada@example.com." />
</bs:bsui-field>Задължително
В помощния текст е описано изискването, затова етикетът остава кратък.
Required. This name appears on every invoice.
HTML
<bs:bsui-field>
<bs:bsui-field-label text="Workspace name" />
<bs:bsui-input placeholder="Acme Production" required="true" />
<bs:bsui-field-description text="Required. This name appears on every invoice." />
</bs:bsui-field>Деактивирано
Деактивирайте полето и контролата в него, така че целият ред да изглежда заключен.
The URL is fixed once the workspace is created.
HTML
<bs:bsui-field disabled="true">
<bs:bsui-field-label text="Workspace URL" />
<bs:bsui-input defaultValue="acme.blockstudio.dev" disabled="true" />
<bs:bsui-field-description text="The URL is fixed once the workspace is created." />
</bs:bsui-field>Поле за избор
Полето обгръща групирани контроли по същия начин, както обгръща едно поле за въвеждане.
HTML
<bs:bsui-field invalid="true">
<bs:bsui-field-label text="Deploy target" />
<bs:bsui-radio-group orientation="horizontal">
<bs:bsui-radio value="staging" label="Staging" />
<bs:bsui-radio value="production" label="Production" />
</bs:bsui-radio-group>
<bs:bsui-field-error text="Pick a target before deploying." />
</bs:bsui-field>Структура
Поле е съставен от блоковете по-долу. Всеки от тях е отделен блок, който се визуализира само в родителския си блок.
bsui/fieldbsui/field-descriptionbsui/field-errorbsui/field-label
Атрибути
| Атрибут | Тип | По подразбиране |
|---|---|---|
name | text | — |
invalid | toggle | false |
disabled | toggle | false |
bsui/field-description
| Атрибут | Тип | По подразбиране |
|---|---|---|
text | richtext | — |
bsui/field-error
| Атрибут | Тип | По подразбиране |
|---|---|---|
text | richtext | — |
bsui/field-label
| Атрибут | Тип | По подразбиране |
|---|---|---|
text | richtext | — |