Checkbox

확인란을 통해 사용자는 세트에서 하나 이상의 항목을 선택할 수 있습니다. 옵션을 켜거나 끄는 데 사용할 수 있습니다.

사용 시기

  • 여러 옵션에서 여러 값을 선택하는 데 사용됩니다.
  • 하나의 확인란만 사용하는 경우 스위치를 사용하여 두 상태 사이를 전환하는 것과 같습니다. 차이점은 스위치가 상태 변경을 직접 트리거하지만 확인란은 상태가 변경된 것으로 표시할 뿐이며 이를 제출해야 한다는 것입니다.

사용 예시

확인란의 기본 사용법.

비활성화됨

비활성화된 확인란.

상태

확인란에는 오류 상태 및 비활성화 상태가 있을 수 있습니다.

슬롯을 사용한 사용자 정의 라벨 및 오류

슬롯을 사용하여 링크와 같은 HTML 요소로 라벨 및 오류 메시지를 사용자 정의할 수 있습니다.

속성
설명
타입
기본값

id

Unique identifier for the input element. An auto-generated string is used if not provided. string auto-generated

label

The label text to display next to the checkbox. string

variant

Controls the visual variant of the checkbox. When the 'error' prop/slot is used, this defaults to 'error'. 'default' | 'error' 'default'

checked

Determines if the checkbox is checked by default. boolean false

class

Additional CSS classes to apply to the root element. string ''

error

Indicates an error state or displays an error message string | boolean

success

Indicates a success state or displays a success message string | boolean

disabled

Disables the component boolean false