Componentes
Campo
Agrupa un control con su etiqueta, descripción y error.
Uso
Básica
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>Estado no válido
Al marcar el campo como no válido, el control cambia de color y el mensaje aparece debajo.
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>Obligatorio
El texto de ayuda explica el requisito, así que la etiqueta puede ser breve.
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>Desactivado
Desactiva el campo y el control que contiene para que toda la fila parezca bloqueada.
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>Campo de opciones
Un campo agrupa controles del mismo modo que agrupa una sola entrada.
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>Estructura
Campo se compone de los bloques siguientes. Cada uno es un bloque independiente que solo se representa dentro de su elemento principal.
bsui/fieldbsui/field-descriptionbsui/field-errorbsui/field-label
Atributos
| Atributo | Tipo | Predeterminado |
|---|---|---|
name | text | — |
invalid | toggle | false |
disabled | toggle | false |
bsui/field-description
| Atributo | Tipo | Predeterminado |
|---|---|---|
text | richtext | — |
bsui/field-error
| Atributo | Tipo | Predeterminado |
|---|---|---|
text | richtext | — |
bsui/field-label
| Atributo | Tipo | Predeterminado |
|---|---|---|
text | richtext | — |