Radio
選択可能な 1 項目です。通常は RadioGroup 内で宣言します。
デモを読み込み中…
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"))#インポート
quickgui から Radio をインポートします。
use quickgui::*;#使い方
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"))#構成
Radio::rootRadio::indicator
#API リファレンス
項目を展開すると説明と完全なシグネチャが表示されます。ダッシュは宣言に既定値が記載されていないことを示します。
Radio
ソースを見るpub 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) -> Selfソースを見るis_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
ソースを見るpub fn root_with(self, root: Element) -> ElementDecorate an application-owned root without adding layout or appearance.
Radio::root
ソースを見るpub fn root(self) -> ElementCreate the unstyled root part. Use [`Self::root_with`] to supply an existing element.
Radio::indicator_with
ソースを見るpub fn indicator_with(self, indicator: Element) -> ElementHide an application-owned visual indicator from the accessible name.
Radio::indicator
ソースを見るpub fn indicator(self) -> ElementCreate the unstyled indicator part. Use [`Self::indicator_with`] to supply an existing element.
radio
ソースを見るpub fn radio(selected: bool) -> ElementCreate an unstyled controlled radio root. This shorthand is equivalent to `Radio::new(selected).root_with(div())`.
