Radios allow the user to select a single option from a group.
<wa-radio>
component!
<label><input type="radio" name="radio" value="1"> Option 1</label> <label><input type="radio" name="radio" value="2"> Option 2</label>
To set the initial value and checked state, use the checked
attribute on the corresponding radio.
<label><input type="radio" name="radio" value="1"> Option 1</label> <label><input type="radio" name="radio" value="2"> Option 2</label> <label><input type="radio" name="radio" value="3" checked> Option 3</label>
Use the disabled
attribute to disable a radio.
<label><input type="radio" name="radio" value="1"> Option 1</label> <label><input type="radio" name="radio" value="2" disabled> Option 2</label> <label><input type="radio" name="radio" value="3"> Option 3</label>
Use the size utilities to change the radios' size.
<fieldset class="wa-size-s"> <legend>Small</legend> <label><input type="radio" name="radio" value="1"> Option 1</label> <label><input type="radio" name="radio" value="2"> Option 2</label> <label><input type="radio" name="radio" value="3"> Option 3</label> </fieldset> <br /> <fieldset class="wa-size-m"> <legend>Medium</legend> <label><input type="radio" name="radio" value="1"> Option 1</label> <label><input type="radio" name="radio" value="2"> Option 2</label> <label><input type="radio" name="radio" value="3"> Option 3</label> </fieldset> <br /> <fieldset class="wa-size-l"> <legend>Large</legend> <label><input type="radio" name="radio" value="1"> Option 1</label> <label><input type="radio" name="radio" value="2"> Option 2</label> <label><input type="radio" name="radio" value="3"> Option 3</label> </fieldset>