# Radio (fw-radio)
fw-radio displays a radio button on the user interface and enables assigning a state (selected or deselected) to it. In the selected state, the button displayed is highlighted. fw-radio provides child elements for fw-radio-group, to populate the Radio Group component’s list.
# Demo
Show Code
# Usage
# Properties
Property | Attribute | Description | Type | Default |
---|---|---|---|---|
checked | checked | Sets the state to selected. If the attribute’s value is undefined, the value is set to false. | boolean | false |
description | description | Description to be displayed for the checkbox. | string | '' |
disabled | disabled | Disables the component on the interface. If the attribute’s value is undefined, the value is set to false. | boolean | false |
label | label | [DEPRECATED] Use description instead. Label displayed on the interface, for the check box. | string | '' |
name | name | Name of the component, saved as part of form data. | string | '' |
state | state | Theme based on which the radio button is styled. | "error" \| "normal" | 'normal' |
value | value | Identifier corresponding to the component, that is saved when the form data is saved. | string | '' |
# Events
Event | Description | Type |
---|---|---|
fwBlur | Triggered when the radio button loses focus. | CustomEvent<any> |
fwChange | Triggered when the radio button is toggled. | CustomEvent<any> |
fwDeselect | Triggered when the radio button in focus is cleared. | CustomEvent<any> |
fwFocus | Triggered when the radio button comes into focus. | CustomEvent<void> |
fwSelect | /** Triggered when the radio button in focus is selected. | CustomEvent<any> |
# Methods
# setFocus() => Promise<void>
Sets focus on a specific fw-radio
.
# Returns
Type: Promise<void>
# Dependencies
# Used by
# Graph
graph TD;
fw-form-control --> fw-radio
style fw-radio fill:#f9f,stroke:#333,stroke-width:4px
Built with ❤ at Freshworks