Skip to content

docs(www): document Switch - #314

Merged
Yeom-JinHo merged 1 commit into
devfrom
docs/switch-docs-jinho
Jul 27, 2026
Merged

docs(www): document Switch#314
Yeom-JinHo merged 1 commit into
devfrom
docs/switch-docs-jinho

Conversation

@Yeom-JinHo

Copy link
Copy Markdown
Member

Changes

Switch를 문서로 추가합니다. 컴포넌트 변경 없이 문서만 추가하는 PR입니다. 이로써 폼 컨트롤 패밀리(checkbox / radio / input / switch)가 완성됩니다.

switch.mdx

  • Installation / Usage / Examples / API Reference / Accessibility / Known limitations. API 표는 소스를 직접 읽고 수동 작성.
  • Switch<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)를 문서화.
  • 예제: Usage / Uncontrolled / Controlled(useState 래퍼, SSR-safe) / Sizes / Disabled. 각 <Preview code={...}> 예제 코드는 실제 렌더 결과와 일치.
  • 다크 사이트 대응: Switch는 label 텍스트색을 라이트 표면 기준으로 하드코딩(gray900)해서 다크 stage에서 안 보입니다. 따라서 각 데모를 라이트 카드로 감쌌습니다(머지된 Radio 문서와 동일한 LightStage 패턴). 트랙/썸은 다크에서도 정상. code 문자열엔 wrapper 미포함.

Visuals

스크린샷 2026-07-27 오후 11 24 57

Checklist

  • Have you written the functional specifications? — 문서 자체가 명세
  • Have you written the test code? — 문서 전용 PR이라 유닛 테스트 없음. 프로덕션 빌드로 검증

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>
@changeset-bot

changeset-bot Bot commented Jul 27, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 618aebf

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai

coderabbitai Bot commented Jul 27, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

🗂️ Base branches to auto review (2)
  • main
  • release/v1

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 284c9f80-659a-48ed-a927-5465bc171c41

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/switch-docs-jinho

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@codecov

codecov Bot commented Jul 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
see 2 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@3o14 3o14 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit) 코드블록 프리뷰 배경을 라이트로 표시하는 이유가 있나요?

@Yeom-JinHo

Copy link
Copy Markdown
Member Author

@3o14
애석하게도 Switch/Radio/Chip은 텍스트가 다크계열로 색상이 먹여져있어
image

다크계열에서는 preview가 잘 안보이는 이슈가 있습니다 ㅠㅡㅠ

@Yeom-JinHo
Yeom-JinHo merged commit 77d18f2 into dev Jul 27, 2026
6 checks passed
@Yeom-JinHo
Yeom-JinHo deleted the docs/switch-docs-jinho branch July 27, 2026 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants