Radio

Interactive UI Explorer

아래에서 각 컴포넌트의 다양한 Variants States를 문서화된 형태로 테스트해볼 수 있습니다.

Radio

애니메이션이 적용된 커스텀 라디오 버튼 컴포넌트입니다.
실제 input은 숨기고 시각적 요소로 선택 상태를 표현하며, 선택 시 부드러운 애니메이션이 적용됩니다.

기본 라디오 버튼

같은 name을 가진 라디오 버튼 그룹

Free Plan
<Radio label="무료 플랜" name="plan" value="free" checked={plan === "free"} onChange={...} />
Live Preview
Pro Plan
<Radio label="프로 플랜" name="plan" value="pro" checked={plan === "pro"} onChange={...} />
Live Preview
Enterprise
<Radio label="엔터프라이즈" name="plan" value="enterprise" checked={plan === "enterprise"} onChange={...} />
Live Preview

States

라디오 버튼의 다양한 상태 (disabled, error, helper text)

Disabled
<Radio label="비활성화" name="group" disabled />
Live Preview
Checked Disabled
<Radio label="체크 비활성" name="group" checked disabled />
Live Preview
Error
<Radio label="에러 상태" name="group" error="..." />

필수 선택 항목입니다.

Live Preview
Helper Text
<Radio label="도움말 포함" name="group" helperText="..." />

이 옵션을 선택하면 추가 설정이 필요합니다.

Live Preview

실제 사용 예시

설정 폼에서의 라디오 버튼 사용 예시

Source Code
const [notification, setNotification] = useState('email');
const [theme, setTheme] = useState('');

<div className="space-y-6">
  <div>
    <h4 className="text-sm font-semibold mb-3">알림 수신 방법</h4>
    <div className="space-y-2">
      <Radio 
        label="이메일" 
        name="notification"
        value="email"
        checked={notification === 'email'}
        onChange={(e) => setNotification(e.target.value)}
        helperText="이메일로 알림을 받습니다."
      />
      <Radio 
        label="SMS" 
        name="notification"
        value="sms"
        checked={notification === 'sms'}
        onChange={(e) => setNotification(e.target.value)}
        helperText="문자 메시지로 알림을 받습니다."
      />
      <Radio 
        label="푸시 알림" 
        name="notification"
        value="push"
        checked={notification === 'push'}
        onChange={(e) => setNotification(e.target.value)}
        helperText="앱 푸시 알림으로 받습니다."
      />
    </div>
  </div>

  <div>
    <h4 className="text-sm font-semibold mb-3">테마 선택 (필수)</h4>
    <div className="space-y-2">
      <Radio 
        label="라이트 모드" 
        name="theme"
        value="light"
        checked={theme === 'light'}
        onChange={(e) => setTheme(e.target.value)}
        error={!theme ? "테마를 선택해주세요." : undefined}
      />
      <Radio 
        label="다크 모드" 
        name="theme"
        value="dark"
        checked={theme === 'dark'}
        onChange={(e) => setTheme(e.target.value)}
        error={!theme ? "테마를 선택해주세요." : undefined}
      />
    </div>
  </div>
</div>
        

알림 수신 방법

이메일로 알림을 받습니다.

문자 메시지로 알림을 받습니다.

앱 푸시 알림으로 받습니다.

테마 선택 (필수)

테마를 선택해주세요.

테마를 선택해주세요.

Live Preview