본문으로 건너뛰기

구성 요소

필드

컨트롤 하나에 레이블, 설명, 오류 메시지를 연결합니다.

사용법

기본

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>

선택 필드

필드는 단일 입력란을 감싸는 것과 같은 방식으로 그룹화된 컨트롤을 감쌉니다.

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>

구조

필드의 구성 블록은 아래와 같습니다. 각 블록은 별도의 블록이며 부모 블록 안에서만 렌더링됩니다.

  • bsui/field
  • bsui/field-description
  • bsui/field-error
  • bsui/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 —