LVRS Document Viewer
components/control/RadioButton.svx
Path: components/control/RadioButton.svx
RadioButton
Location: qml/components/control/check/RadioButton.qml
RadioButton is a compact radio selector with compatibility aliases for legacy API names.
Current default color mapping is aligned to Figma node 44:630.
Purpose
- Provide deterministic circular indicator + optional text.
- Keep backward compatibility through
state/availablealiases.
API
Primary state API:
checkedenabledtext
Compatibility aliases:
state<->checkedavailable<->enabled
Visual API:
indicatorSize,dotSizeonColor,offColoronColorDisabled,offColorDisableddotColor,dotColorDisabled
Usage
import LVRS 1.0 as LV
LV.RadioButton {
text: "Choice A"
checked: true
}
How It Works
- Alias synchronization handlers keep
stateandcheckedmirrored. - Effective colors are computed from
enabled + checkedcombination. - Default state color matrix:
checked + enabled:Theme.accent+ dotTheme.textPrimarychecked + disabled:Theme.panelBackground12+ dotTheme.textSeptenaryunchecked + enabled:Theme.textPrimaryunchecked + disabled:Theme.panelBackground12
- Background visuals remain transparent to avoid button-like surface styling.
Advanced Example: Legacy Alias Interop
import LVRS 1.0 as LV
LV.RadioButton {
text: "Legacy Option"
state: true
available: true
}
Both alias and canonical properties stay synchronized by internal change handlers.
Grouping Recommendation
Use ButtonGroup for mutually exclusive option sets.
Without grouping, multiple radio buttons can be checked simultaneously if state logic is not wired externally.