Skip to content

Radio Button #251

Open
Open

Description

@leolopes

Just opening this issue to tell I'm going to start research work for the "radio" component.
This is the link for the document draft: https://docs.google.com/document/d/1-TyGOSOcyV4VOqNyUDjEQLjrtssI8cd2-BVld9cJtlo/edit?usp=sharing

Any contributions are welcome :)

Activity

  1. changed the title [-]Radio[/-] [+]Radio Button[/+] on Jan 19, 2021
  2. leolopes commented on Jan 20, 2021

    @leolopes
    ContributorAuthor

    Today I started the document by making a list of references to all the concepts that remind of radio buttons in many design systems.

    After that I started a spreadsheet inventory to list all the concepts related to each of the components.

    The main points that are still not clear to me and maybe should be better defined in this beginning are:

    • whether we should work with the concept of Radio Buttons or Radio Groups (or both separately). In my document you can see that design systems are not consistent with this naming convention, in a variety of ways.
    • whether I should list every property that every design system declares as "concepts", or maybe only list concepts that seem more relevant.

    If you look at the spredsheet, even though I have for now listed Ant Design's concepts alone, the list of concepts is already big and has the added complexity of being divided by "radio buttons" and "radio button groups".

    I would like any suggestion you might have for how I should handle it further.

  3. gregwhitworth commented on Jan 20, 2021

    @gregwhitworth
    Member

    @leolopes moving the discussion around radio from discord to here:

    I would appreciate your input, because though radios look similar to checkboxes, it seems they are a bit more complex

    Can you expound? I would expect there to be an additional section for how radio groups are tied together via the name attribute but most of the additional behaviors should be very similar outside of potentially a containing element to hold the group (assuming this is consistent across UAs/OSes/Design Systems). I have opinions on having the containing element for the group but that should be in a different issue.

  4. chrisdholt commented on Jan 20, 2021

    @chrisdholt
    Collaborator

    @leolopes moving the discussion around radio from discord to here:

    I would appreciate your input, because though radios look similar to checkboxes, it seems they are a bit more complex

    Can you expound? I would expect there to be an additional section for how radio groups are tied together via the name attribute but most of the additional behaviors should be very similar outside of potentially a containing element to hold the group (assuming this is consistent across UAs/OSes/Design Systems). I have opinions on having the containing element for the group but that should be in a different issue.

    There is a bit of nuance here I think depending how this is implemented, specifically as it relates to accessibility and behavior depending on how these are built. While the browser ties inputs with a type of radio together using the name attribute, per the spec, ARIA radios behave different and are tied together by being a child of a radiogroup. Depending on how this is built I would expect a bit of difference between the implementation.

  5. leolopes commented on Jan 20, 2021

    @leolopes
    ContributorAuthor

    I think the radio button is more complex than the checkbox because the checkbox is "standalone", while the radio button represents an option amongst other options.

    I see the radio button much like a "single choice select". They could almost be the same component with different appearances. In this sense, I mostly see the radio button as being part of a host component (the radio button group).

    By @chrisdholt 's answer, it's also evident that even well defined specifications differ in how they implement the component, let alone the different ways the other design systems do.

    If I personally were to define the specs for radio buttons, I would work from one level up, and consider the radio button group as the actual component, comprised of two or more radio buttons.

    If I'm not mistaken, the W3C specs for the radio buttons allow for standalone radio buttons, but I simply see no purpose in that. Perhaps you do?

  6. leolopes commented on Jan 21, 2021

    @leolopes
    ContributorAuthor

    I updated the preliminary inventory with three other design systems: https://docs.google.com/spreadsheets/d/1addPff5gfeAIRvCeVTnT0GUD1IesCQYO8JmFzlum2Ug/edit?usp=sharing

    You can see there I divided the concepts between radio buttons and radio button groups.
    You can see by my comments that I have many doubts on where I should list each property, or whether I should list some of them at all.

    I'll keep doing this, however. Maybe when I have inventoried several design systems, I can have a clearer picture, and then I'll be able to triage concepts and come to a simpler list, like the one that is provided for the checkbox.

  7. leolopes commented on Jan 24, 2021

    @leolopes
    ContributorAuthor

    As I keep listing the design systems' options for Radio/RadioGroups, I only strenghten my belief that we should treat Radio Button Groups as the actual component, instead of Radio Buttons (with maybe a host Radio Group Component).

    The two main reasons are:

    • a very weak use case for a single, standalone, radio button;
    • and the fact that most of the time the radio buttons inherit properties from the group, like name, style, onChange behavior, etc.

    One could argue that if a single button inside a group has a disabled state, while the others don't, we could treat buttons as components, with their own properties. However, this would make the select's option tag as much of a candidate to be a standalone component, which I don't think is the case.

  8. gregwhitworth commented on Jan 26, 2021

    @gregwhitworth
    Member

    I agree overall, I think that there could be a starting anatomy here even if you simply scope it to the control and the indicator. To be somewhat selfish - I would like that scoped anatomy sooner than later as I'm putting together a proposal for an indicator pseudo element and that specific aspect of the indicator part and label are the same across checkbox and radio from what I can see.

  9. leolopes commented on Jan 27, 2021

    @leolopes
    ContributorAuthor

    the control and the indicator

    Hello @gregwhitworth, do you mean the actual radio input (the circle) and the label?

    I would like that scoped anatomy

    What do you mean exactly by the "anatomy"? Do you mean the same thing as the anatomy referenced here? https://open-ui.org/components/checkbox.research#anatomy

    If so, it's fairly simple. I would basically propose the following:

    • Radio Button Group (the actual component)
      • Radio Button (at least two required)
        • Checked Indicator (input)
        • Label (optional)
      • Radio Button
        • ...
      • ...

    Either way, I'll keep looking into the design systems list all possible properties before doing a triage.

  10. leolopes commented on Jan 30, 2021

    @leolopes
    ContributorAuthor

    Let me rectify: a label for the whole group seems very important, thus:

    • Radio Button Group (the actual component)
      • Group Label
      • Radio Button (at least two required)
        • Checked Indicator (input)
        • Label (optional)
      • Radio Button
        • ...
      • ...
  11. leolopes commented on Jan 30, 2021

    @leolopes
    ContributorAuthor

    I have finished the analisys of all the design systems' properties, and now I'm going to use both the WAI-ARIA specs and the recurrence of properties among the design systems to propose a more to the point specification.

  12. gregwhitworth commented on Jan 31, 2021

    @gregwhitworth
    Member

    Thanks for this - looking forward to it. And btw - with regards to the scoped anatomy I'm referring to this part:

    • Radio Button
      • Checked Indicator (input)
      • Label (optional)

    This was the aspect that I was referring to being similar to checkbox. And thus the proposal I'm making being the same. For sure all of the behaviors given that they need to be tied together, etc will impact the overall anatomy so thank you for the time spent on this.

  13. leolopes commented on Feb 3, 2021

    @leolopes
    ContributorAuthor

    Because of the need of tying the radio buttons together, I think the "Group Label" should be included in the basic anatomy, specially when we have more than one option.

    In case the final proposal allows groups with a single option, the group label could be optional.

  14. chrisdholt commented on Feb 3, 2021

    @chrisdholt
    Collaborator

    Because of the need of tying the radio buttons together, I think the "Group Label" should be included in the basic anatomy, specially when we have more than one option.

    In case the final proposal allows groups with a single option, the group label could be optional.

    In the case of the Group Label being included in the anatomy, I think we'll want to ensure we articulate that a visual label is not technically required. The label for the group could be visible or it could be applied via an aria-label (5th bullet). A label of some sort is required, but its not always required as part of the anatomy.

  15. leolopes commented on Mar 8, 2021

    @leolopes
    ContributorAuthor

    Coming back after a while, I've been reading a bit further and found this:

    A document must not contain an input element whose radio button group contains only that element.
    W3 HTML Specs

    I think we can safely assume the requirement of more than one radio input in each group, relegating single option inputs to the checkbox type.

    I'll be finishing the research untill wednesday and include a preliminary proposal. Then I'll ask for some feedback on Discord.

  16. 20 remaining items

  17. leolopes commented on Jun 20, 2021

    @leolopes
    ContributorAuthor

    On june 3th we had a Telecon to address the possible ways to handle the radio buttons.
    The telecon's minute is here: https://www.w3.org/2021/06/03-openui-minutes.html

    The key points I took from it are:

    • We should make two proposals: a rigid one, based on an hierarchy similat to select, and a more flexible one, with inputs and labelling being bound by attributes.
    • @chrisdholt told us that the ARIA impementation requires the radio buttons to be direct children of a radiogroup , which affects mainly the flexible proposal, making it less flexible, in a sense.
    • @una and @gregwhitworth would still like to see the flexible proposal bound by attributes / tags, and have accessibility be thought around it, because it's so important to have it built in the Open UI components.
    • @gregwhitworth would like the name attribute to be the standard way to bind things (even though "binding" might mean different things depending on context.
    • Even having both proposals, probably the rigid one would be the most used by devs, because it is the more frequent use case and will be easier for them to implement.
    • @bkardell mentioned that we should also have to worry about keybord navigation, order of focus, etc.

    @gregwhitworth at a point mentioned that maybe we could make the semantic scale layout work with the rigid proposal (because CSS would be able to layout it very freely), but still, I think if we want to account for other kinds of really "disjointed" layouts, we should have a flexible proposal so as to not demand a tag hierarchy.

    Based on that all, and on my current knowledge, I'll be making both HTML proposals and PR to the repository. I will probably, however, end it on the HTML and have the other discussions (AT, ARIA, A11Y) be made after we have something more concrete to analyze.

  18. leolopes commented on Jun 20, 2021

    @leolopes
    ContributorAuthor

    I created a PR for the proposal. I would like the community to validate the basic idea before going further.
    If no one makes any remarks before it's merged, I'll still leave it as a draft on the website for a while, open to criticism, before creating the full proposal.

  19. korenevskiy commented on Jun 21, 2021

    @korenevskiy

    In the draft, you need to place short examples of sentences and a brief description of these examples. So that participants do not have to run through the links.
    Thank you for your active participation.

  20. leolopes commented on Jun 21, 2021

    @leolopes
    ContributorAuthor

    Hi @korenevskiy , what sentences do you mean exactly?
    Thanks

  21. korenevskiy commented on Jun 21, 2021

    @korenevskiy

    Examples of HTML code with the display of new attributes and properties.

  22. leolopes commented on Jun 28, 2021

    @leolopes
    ContributorAuthor

    @korenevskiy Oh, those are on the Pull Request

  23. korenevskiy commented on Jun 30, 2021

    @korenevskiy

    @korenevskiy Oh, those are on the Pull Request

    I was once on a forum where they ask questions to solve problems. They told me there.
    If you (me) want your question to be solved? Then lay out your attempts to solve the problem. So that people can see that your problem is important to you, so that people can see the code in which they can solve errors. So that the help of knowledgeable people requires a minimum of effort to help me.
    .
    After such a remark to me, I made conclusions. In order for the social cause to move, it is necessary not only to identify the problem. This is not enough.
    But it is also necessary to show a solution that will make life better. Because for many, this problem is not a problem and they are not able to see the best opportunities.
    .
    That is why I wrote above possible solutions.
    That is, it is necessary not to show the problem as a critic. And it is necessary to conduct a professional sale, with the promotion of ideas.
    I'm just not indifferent to the problem of radio buttons. Therefore, it seems to me that actions without ready-made examples are generally ineffective. And I want a result from the community in this matter.

  24. leolopes commented on Jun 30, 2021

    @leolopes
    ContributorAuthor

    @korenevskiy , yes, I agree with you, that's why those proposals were studied, created, and put on the Pull Request, so that the community can see, comment and contribute.

  25. korenevskiy commented on Oct 1, 2021

    @korenevskiy

    @leolopes
    I want to ask you for your advice.
    Do you think this is something worthwhile or not an interesting idea at all.
    Here ... Manage GRID cell as FLEX.

  26. leolopes commented on Oct 14, 2021

    @leolopes
    ContributorAuthor

    Hi @korenevskiy , I'm going to take a look and let you know if I have any idea ;)

  27. github-actions commented on Apr 13, 2022

    @github-actions
    Contributor

    There hasn't been any discussion on this issue for a while, so we're marking it as stale. If you choose to kick off the discussion again, we'll remove the 'stale' label.

  28. github-actions commented on Aug 15, 2025

    @github-actions
    Contributor

    There hasn't been any discussion on this issue for a while, so we're marking it as stale. If you choose to kick off the discussion again, we'll remove the 'stale' label.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedneeds-triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions