Do radio groups need an option selected by default? #4093
-
Hi Paste team, Do radio groups need to have an option pre-selected by default, or can we leave all the radio options unchecked until the user makes an initial selection? (Is this the same thing as having a Controlled vs. uncontrolled radio group?) |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Disclaimer: This is a very experimental bot using OpenAI's GPT-4. The answers may not be correct, a human will review the answer and update it if necessary. By default, the Radio Group component doesn't apply a pre-selected value. You can leave all the radio options unchecked until the user makes an initial selection. This approach is related to whether the Radio Group is controlled or uncontrolled. For an uncontrolled radio group, you do not pass the Therefore, not having a pre-selected option by default can be part of both controlled and uncontrolled radio groups, depending on how you manage the state and props of the component. For more information, you can visit the Radio Group component documentation: https://paste.twilio.design/components/radio-group/#paste-docs-content-area I also did a search, and I managed to find these other Discussions that might be similar or related to your question. Give them a read to see if they answer your question. If they do, head back here and update this discussion and mark it as answered, pointing others to the related discussion:
|
Beta Was this translation helpful? Give feedback.
-
Hey @jess-watson - PasteBot is correct. Radio Group doesn't need a pre-selected value. We have some more info about when to use a pre-selected value and the risks associated with that decision, as well as a Nielsen Norman article with additional context, on the Radio Group docs page. Pre-selecting one of the Radio options is possible with both controlled and uncontrolled Radio Groups. The decision of whether to use controlled or uncontrolled will come down to the eng and their requirements (will pretty much always be controlled). Using a controlled Radio Group means there's an external state controlling the selected value rather than the component itself. |
Beta Was this translation helpful? Give feedback.
Hey @jess-watson - PasteBot is correct. Radio Group doesn't need a pre-selected value. We have some more info about when to use a pre-selected value and the risks associated with that decision, as well as a Nielsen Norman article with additional context, on the Radio Group docs page.
Pre-selecting one of the Radio options is possible with both controlled and uncontrolled Radio Groups. The decision of whether to use controlled or uncontrolled will come down to the eng and their requirements (will pretty much always be controlled). Using a controlled Radio Group means there's an external state controlling the selected value rather than the component itself.