docs(www): document Switch - #314
Conversation
Add the Switch component docs page (Preview-based MDX) covering size, controlled/uncontrolled toggling, disabled, and the label / aria naming, with the API reference written by hand from source. Switch hardcodes a light-surface label color, so each demo is shown on a light card (matching the Radio docs). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. 🗂️ Base branches to auto review (2)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. 🚀 New features to boost your workflow:
|
3o14
left a comment
There was a problem hiding this comment.
Nit) 코드블록 프리뷰 배경을 라이트로 표시하는 이유가 있나요?
|
@3o14 다크계열에서는 preview가 잘 안보이는 이슈가 있습니다 ㅠㅡㅠ |

Changes
Switch를 문서로 추가합니다. 컴포넌트 변경 없이 문서만 추가하는 PR입니다. 이로써 폼 컨트롤 패밀리(checkbox / radio / input / switch)가 완성됩니다.
switch.mdxSwitch는<label>이 hidden<input type="checkbox" role="switch">를 감싸는 단일 컴포넌트.size(sm/md/lg) ·checked/defaultChecked/onChange(controlled/uncontrolled) ·disabled·label·aria-label/aria-labelledby(우선순위: aria-label → aria-labelledby → label)를 문서화.<Preview code={...}>예제 코드는 실제 렌더 결과와 일치.gray900)해서 다크 stage에서 안 보입니다. 따라서 각 데모를 라이트 카드로 감쌌습니다(머지된 Radio 문서와 동일한LightStage패턴). 트랙/썸은 다크에서도 정상.code문자열엔 wrapper 미포함.Visuals
Checklist