본문으로 건너뛰기

구성 요소

라디오 그룹

정확히 하나의 옵션을 선택할 수 있는 옵션 집합입니다.

사용법

기본

HTML
<bs:bsui-radio-group defaultValue="pro">
  <bs:bsui-radio value="free" label="Free" />
  <bs:bsui-radio value="pro" label="Pro" />
  <bs:bsui-radio value="enterprise" label="Enterprise" />
</bs:bsui-radio-group>

가로

Orientation을 설정하면 짧은 옵션 목록을 한 줄로 배치합니다.

HTML
<bs:bsui-radio-group name="priority" defaultValue="normal" orientation="horizontal">
  <bs:bsui-radio value="low" label="Low" />
  <bs:bsui-radio value="normal" label="Normal" />
  <bs:bsui-radio value="urgent" label="Urgent" />
</bs:bsui-radio-group>

사용할 수 없는 옵션

그룹의 나머지 옵션은 계속 사용할 수 있는 상태로 두고 옵션 하나만 비활성화할 수 있습니다.

HTML
<bs:bsui-radio-group name="plan" defaultValue="pro">
  <bs:bsui-radio value="free" label="Free" />
  <bs:bsui-radio value="pro" label="Pro" />
  <bs:bsui-radio value="enterprise" label="Enterprise, contact sales" disabled="true" />
</bs:bsui-radio-group>

필드 안

라벨, 도움말 텍스트, 오류 메시지는 특정 옵션이 아니라 그룹 전체를 감쌉니다.

This cannot be changed after the first backup runs. Pick a region to enable backups.
HTML
<bs:bsui-field invalid="true">
  <bs:bsui-field-label text="Where should backups live?" />
  <bs:bsui-radio-group name="backups">
    <bs:bsui-radio value="eu" label="Europe" />
    <bs:bsui-radio value="us" label="United States" />
  </bs:bsui-radio-group>
  <bs:bsui-field-description text="This cannot be changed after the first backup runs." />
  <bs:bsui-field-error text="Pick a region to enable backups." />
</bs:bsui-field>

구조

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

  • bsui/radio-group
  • bsui/radio

속성

속성유형기본값
defaultValue text —
name text —
disabled toggle false
orientation vertical horizontal vertical
nameAlt text —
onChange text —
value text —

bsui/radio

속성유형기본값
value text —
label richtext —
disabled toggle false
bindText text —