Ugrás a tartalomhoz

Komponensek

Mező

Egy vezérlőt a címkéjével, leírásával és hibaüzenetével együtt jelenít meg.

Használat

Alap

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>

Érvénytelen állapot

Ha érvénytelennek jelöli a mezőt, a vezérlőelem színe megváltozik, és alatta megjelenik az üzenet.

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>

Kötelező

A súgószövegben szerepelnek a követelmények, így a címke rövid maradhat.

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>

Letiltva

Tiltsa le a mezőt és a benne lévő vezérlőelemet, hogy az egész sor zároltnak tűnjön.

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>

Választómező

A mező ugyanúgy csoportosíthatja a vezérlőelemeket, ahogy egyetlen beviteli mezőt is magában foglal.

Pick a target before deploying.
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>

Felépítés

Mező az alábbi blokkokból áll. Mindegyik külön blokk, amely csak a szülőjén belül jelenik meg.

  • bsui/field
  • bsui/field-description
  • bsui/field-error
  • bsui/field-label

Attribútumok

AttribútumTípusAlapértelmezett
name text —
invalid toggle false
disabled toggle false

bsui/field-description

AttribútumTípusAlapértelmezett
text richtext —

bsui/field-error

AttribútumTípusAlapértelmezett
text richtext —

bsui/field-label

AttribútumTípusAlapértelmezett
text richtext —