Radio
One selectable item, normally declared inside a RadioGroup.
Loading interactive demo…
let radio = Radio::new(selected);
radio
.root().flex_row().gap(8.0).on_click(select)
.child(radio.indicator_with(div().size(16.0, 16.0).rounded(8.0)))
.child(text("Option A"))#Import
Import Radio from quickgui.
use quickgui::*;#Usage
let radio = Radio::new(selected);
radio
.root().flex_row().gap(8.0).on_click(select)
.child(radio.indicator_with(div().size(16.0, 16.0).rounded(8.0)))
.child(text("Option A"))#Anatomy
Radio::rootRadio::indicator
#API reference
Expand an entry for its description and complete signature. A dash means no declaration default is documented.
Radio
View sourcepub const fn new(selected: bool) -> Selfread_onlypub const fn read_only(mut self, read_only: bool) -> Self—
Show a value the user may read but not change, Base UI's `readOnly`. A read-only radio stays focusable and keeps taking part in arrow navigation; only the selection it would make is refused.
pub const fn read_only(mut self, read_only: bool) -> SelfView sourceis_selectedpub const fn is_selected(self) -> bool—
is_read_onlypub const fn is_read_only(self) -> bool—
accepts_selectionpub const fn accepts_selection(self) -> bool—
Radio::root_with
View sourcepub fn root_with(self, root: Element) -> ElementDecorate an application-owned root without adding layout or appearance.
Radio::root
View sourcepub fn root(self) -> ElementCreate the unstyled root part. Use [`Self::root_with`] to supply an existing element.
Radio::indicator_with
View sourcepub fn indicator_with(self, indicator: Element) -> ElementHide an application-owned visual indicator from the accessible name.
Radio::indicator
View sourcepub fn indicator(self) -> ElementCreate the unstyled indicator part. Use [`Self::indicator_with`] to supply an existing element.
radio
View sourcepub fn radio(selected: bool) -> ElementCreate an unstyled controlled radio root. This shorthand is equivalent to `Radio::new(selected).root_with(div())`.
