Radio group component translated from shadcn/ui (new-york-v4).
Two function-components:
radio_group/1— a presentational container (role="radiogroup",data-slot="radio-group") that lays out the items in a grid. It is NOT field-aware; it just renders itsinner_block.radio_group_item/1— a field-aware native<input type="radio">. Each item shares the field'sname(so the browser groups them) but renders a uniqueid, and ischeckedwhen the field's current value matches the item'svalue. The selected dot is drawn with CSS only (abefore:pseudo-element shown via thechecked:variant), no JavaScript.
Radios are grouped, so an individual item does not render its own error
message; surface validation alongside the group/label as appropriate. Each
item still reflects the field's invalid state via aria-invalid so screen
readers and the destructive styling pick it up.
Summary
Functions
Attributes
class(:string) - Defaults tonil.- Global attributes are accepted.
Slots
inner_block(required)
Attributes
field(Phoenix.HTML.FormField) (required)value(:string) (required)class(:string) - Defaults tonil.- Global attributes are accepted. Supports all globals plus:
["disabled", "required"].