Skip to content

AisRadio ​

AisRadio is a branded radio button component that ensures a label is attached to the element.

Basic usage ​

Use the value and v-model props to define the value for a radio button and capture it when the element is selected. Radio buttons bound to the same v-model will naturally form a group. However, radio buttons that share a v-model, should also share a name. Traditional form submission is the main case where name is required but there are other behaviors like browser validation that expect the name as well.

Selection: Two

Props ​

icon ​

AisRadio accepts an icon prop to display an icon alongside the radio button. icon will accept either a FontAwesome icon definition or a string for one of our standard icons.

size ​

Radio buttons accept a size property with the standard values of sm, md, and lg. Medium (md) is the default.

name ​

The name prop will set the name attribute on the input element. Radio buttons that share a name are linked together. When using v-for to create radio buttons for a list of values, it is important to specify a name. v-model will handle most of the functionality, but there are details like browser validation that expect name to be set.

disabled ​

Radio buttons accept a boolean disabled property. A disabled radio button is not clickable and is not submitted with its form.

required ​

The required prop marks the radio button as required and activates browser validation. If the radio button is required and part of a conceptual group, make sure each input in the group shares a name attribute. In a required, same-name group, one of the radio buttons must be selected. Validation behavior may vary by browser. In Firefox, the form submission event (in Vue) is blocked until a value is selected.