Skip to content

feat(radio): add size variants, orientation prop, and fix CSS issues#739

Open
rohanchkrabrty wants to merge 1 commit intomainfrom
feat/630-radio-size-orientation-css
Open

feat(radio): add size variants, orientation prop, and fix CSS issues#739
rohanchkrabrty wants to merge 1 commit intomainfrom
feat/630-radio-size-orientation-css

Conversation

@rohanchkrabrty
Copy link
Copy Markdown
Contributor

Summary

  • Size variants: Add size prop (small | large) to Radio using CVA, following the same pattern as the Switch component. Default is large (preserving current 16px size). Small variant uses --rs-space-4 (12px).
  • Orientation prop: Add orientation prop (vertical | horizontal) to Radio.Group for controlling layout direction. Default is vertical. Implemented as a custom Apsara feature since Base UI's RadioGroup does not natively support orientation.
  • Fix indicator token: Replace --rs-radius-3 (a border-radius token) with --rs-space-2 (a spacing token) for the indicator dot width/height, fixing semantic token misuse.
  • CSS audit: Rename .radio to .group, add clarifying CSS comments for the display property usage on .group (flex for layout) and .radioitem (inline-flex for centering indicator), and remove fixed dimensions from .radioitem base class (moved to size variants).
  • Proportional indicator scaling: The indicator dot scales down for the small size variant using --rs-space-1.

Closes #630

Test plan

  • All 22 radio tests pass (including 7 new tests for sizes and orientation)
  • Full test suite passes (1626 tests across 70 files)
  • No new type errors introduced (verified with tsc --noEmit)
  • Visually verify radio indicator dot renders correctly at both sizes
  • Verify horizontal/vertical orientation layout in Storybook

🤖 Generated with Claude Code

#630)

- Add size prop (small | large) using CVA, matching Switch component pattern
- Add orientation prop (vertical | horizontal) to Radio.Group for layout control
- Fix indicator dot using --rs-radius-3 (border-radius token) for width/height,
  replaced with --rs-space-2 (spacing token) for correct semantic usage
- Add CSS comments clarifying display property intent on .group and .radioitem
- Scale indicator dot proportionally for each size variant
- Add tests for size variants and orientation

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel bot commented Apr 14, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
apsara Ready Ready Preview, Comment Apr 14, 2026 8:30pm

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 14, 2026

Warning

Rate limit exceeded

@rohanchkrabrty has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 50 minutes and 22 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 50 minutes and 22 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: fbada03a-7416-4972-a233-737ddd91457f

📥 Commits

Reviewing files that changed from the base of the PR and between 26e02f6 and 3ea51f3.

📒 Files selected for processing (3)
  • packages/raystack/components/radio/__tests__/radio.test.tsx
  • packages/raystack/components/radio/radio.module.css
  • packages/raystack/components/radio/radio.tsx

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 and usage tips.

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.

[Radio] Add size variants, orientation prop, and fix CSS issues

1 participant