Selected Value: ""
<FormRadio
name="my-radio-input"
@label="Yes"
@value={{true}}
@checked={{this.value}}
@onChange={{this.setValue}}
/>
<FormRadio
name="my-radio-input"
@label="No"
@value={{false}}
@checked={{this.value}}
@onChange={{this.setValue}}
/>
<p class="mt-4">Selected Value: "{{this.value}}"</p>
Arg | Type | Description | Required | Default |
---|---|---|---|---|
checked
|
unknown
|
The current checked value. This will be used to compare against the `value` argument, if equal, the radio will me marked as checked. | Yes | - |
onChange
|
(value: unknown, event: Event) => void
|
Callback when onchange is triggered | Yes | - |
value
|
unknown
|
The value to be used in the radio button. You must also pass `onChange` to update its value. | Yes | - |
containerClass
|
string
|
CSS classes to be added in the container element | - | - |
hint
|
string
|
A help text to be displayed | - | - |
label
|
string
|
The input field label | - | - |
name
|
string
|
The name of the checkbox | - | - |
size
|
'sm' | 'lg'
|
The size | - | - |