Components/Switch

Switch

켜기/끄기 토글 스위치 컴포넌트입니다. Radix UI Switch 기반.

Installation

bash
npx axis-cli add switch

Usage

tsx
import { Label, Switch } from '@axis-ds/ui-react'

export function Example() {
  return (
    <div className="flex items-center space-x-2">
      <Switch id="airplane-mode" />
      <Label htmlFor="airplane-mode">비행기 모드</Label>
    </div>
  )
}

Props

checked
Type:boolean
Default:-

활성화 상태 (controlled)

defaultChecked
Type:boolean
Default:-

기본 활성화 상태

onCheckedChange
Type:(checked: boolean) => void
Default:-

상태 변경 콜백

disabled
Type:boolean
Default:false

비활성화 여부

required
Type:boolean
Default:false

필수 입력 여부

name
Type:string
Default:-

폼 필드 이름

value
Type:string
Default:"on"

폼 제출 값