Radio group
Radio group is used to render a short list of mutually exclusive options.
On this page
RadioButtonGroup
component is part of the Primer forms framework. If you're building a form, please consider using the framework instead of this standalone component.Description
A group of mutually exclusive radio buttons.
Arguments
Name | Type | Default | Description |
---|---|---|---|
name | String | N/A | Value for the HTML name attribute. |
label | String | N/A | Label text displayed above the input. |
hidden | Boolean | N/A | When set to |
caption | String | N/A | A string describing the field and what sorts of input it expects. Displayed below the group. |
invalid | Boolean | N/A | If set to |
validation_message | String | N/A | A string displayed between the caption and the input indicating the input's contents are invalid. This option is, by default, set to the first Rails validation message for the input (assuming the form is associated with a model object). Use |
label_arguments | Hash | N/A | Attributes that will be passed to Rails' |
Examples
Methods
radio_button(system_arguments: Hash, block: Proc)
Adds a radio button to the group.
Parameters
Name | Type | Default | Description |
---|---|---|---|
system_arguments | Hash | N/A | The arguments accepted by RadioButton. |
block | Proc | N/A | The block accepted by RadioButton. |