RadioButton
RadioButton
component is part of the Primer ViewComponents forms framework. If you are building a form, please consider using the framework instead of this standalone component.Description
Radio buttons represent one of a set of options and are rendered as <input type="radio">
in HTML.
NOTE: You probably want to use the Primer::Alpha::RadioButtonGroup
component instead, as it allows rendering a group of options.
Arguments
Name | Required | Description |
---|---|---|
name | String Value for the HTML name attribute. | |
id | String Value for the HTML id attribute. | |
class | String CSS classes to include in the input's HTML | |
classes | Array CSS classes to include in the input's HTML | |
caption | String A string describing the field and what sorts of input it expects. Displayed below the input. | |
label | String Label text displayed above the input. | |
visually_hide_label | Boolean When set to | |
disabled | Boolean When set to | |
hidden | Boolean When set to | |
invalid | Boolean If set to | |
validation_message | String 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 Attributes that will be passed to Rails' | |
scope_name_to_model | Boolean Default | |
scope_id_to_model | Boolean Default | |
required | Boolean Default | |
aria | Hash Key/value pairs that represent Aria attributes and their values. Eg. | |
data | Hash Key/value pairs that represent data attributes and their values. Eg. | |
system_arguments | Hash A hash of attributes passed to the underlying Rails builder methods. These options may mean something special depending on the type of input, otherwise they are emitted as HTML attributes. See the Rails documentation for more information. In addition, the usual Primer utility arguments are accepted in system arguments. For example, passing |