-
Notifications
You must be signed in to change notification settings - Fork 16
Description
New feature motivation
It is a common web element that is used in forms and similiar scenarios.
It just makes sense to have it
Plus we want it in the dynamic checklist addon
New feature description
(updated 07-aug-2025 after discussions in the comments below)
True that Lime Elements lacks a radio button component. However, making an independent radio button component may be
The reason is that a single radio button is never useful in a UI. Looking at https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input/radio
we can conclude that these are the requirements for a good radio button component:
- radio buttons can NEVER be 1, and they should be in a list with at least 2 radios.
- radio buttons should have a name tag, which should be shared between them all (unlike checkboxes, or switches),
and just like the id, the name should also be auto-generated for the consumer to do less work - it should be easy for consumers to send an array of labels and the list of radio buttons get generated for them (and they shouldn't care about putting one radio per row for instance, or adding
s after each button)
So, with all that said, it feels we already have this feature π and that's the limel-list with radio buttons!
However, this is undiscoverable for the consumers who come to our documentations page. They'd be looking for radio buttons, not lists.
Therefore, we need to make a wrapper component called limel-radio-button which accepts an array of items, and passes it to a limel-list with type="radio".
All accessibility, keyboard navigation, and so on, must be handled by limel-list instead.
Note
Note that we already have a RadioButtonTemplate which is only used to visually render a radio button for now. This template is inside the folder of limel-list. src/components/list/radio-button . We can move it out from there, when we make the new component.
Naming of the component
limel-radio-button-group seems like a much more descriptive and accurate name for this component, than limel-radio-button. It clearly communicates that this is a group of radio buttons, not a single radio button, which aligns perfectly with the earlier point that a single radio button is never useful in a UI.
This naming convention is also more consistent with common UI library patterns where grouped controls are explicitly named as such (like button-group, checkbox-group, etc.).
π Now the question is whether we need a limel-checkbox-group too or not π€ π
Metadata
Metadata
Labels
Type
Projects
Status