-
Notifications
You must be signed in to change notification settings - Fork 281
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow boolean type on radio button values #1430
Conversation
@3ximus is attempting to deploy a commit to the Themesberg Team on Vercel. A member of the Team first needs to authorize it. |
WalkthroughThe changes involve updating the Changes
Poem
Recent review detailsConfiguration used: CodeRabbit UI Files selected for processing (2)
Additional comments not posted (6)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Radio buttons are used for selecting one option from multiple choices, which is typically represented by strings or numbers. Booleans are more commonly used with checkboxes. |
I agree with you that on most cases a Toggle would be more appropriate. I have a use-case though where the underlying value is a boolean but presenting a switch it's less clear to the user as to what happens on each boolean value. You can say it should not be a boolean in the first place too, but I feel like it is unnecessary to constraint the value type. If you don't think so and this goes against the design principles feel free to close the PR. Cheers |
I think your case is very rare. I suggest to create your own component to suit your situation. I close the PR for now. Thank you for your contribution. |
📑 Description
This PR just adds the boolean type to a radio button. It should be possible to have a 2 options radio button group that saves the true false.
It seems like it would be possible anyway but the lsp typechecker throws some errors.
Status
✅ Checks
Summary by CodeRabbit
New Features
RadioButton
component to accept boolean values for thegroup
andvalue
properties, increasing flexibility in usage.Documentation
RadioButton
component, ensuring users are informed about the expanded property types.