ToggleGroup
Coordinates single or multiple pressed values with roving keyboard focus.
Loading interactive demo…
let group = ToggleGroup::new("align", &state, &items);
group.root().flex_row()#Import
Import ToggleGroup from quickgui.
use quickgui::*;#Usage
let group = ToggleGroup::new("align", &state, &items);
group.root().flex_row()#Anatomy
ToggleGroup::rootToggleGroup::item
#API reference
Expand an entry for its description and complete signature. A dash means no declaration default is documented.
ToggleGroup
View sourcepub fn new( root_id: impl Into<ElementId>, state: &'a ToggleGroupState, items: &'a [ToggleGroupItem], ) -> SelfCreate a toggle group over the caller's ordered items. # Panics Panics with more than [`MAX_TOGGLE_GROUP_ITEMS`] items or duplicate item values.
verticalpub const fn vertical(mut self) -> Self—
loop_focuspub const fn loop_focus(mut self, loop_focus: bool) -> Self—
Configures loop focus for this part.
pub const fn loop_focus(mut self, loop_focus: bool) -> SelfView sourceroot_idpub const fn root_id(self) -> ElementId—
itemspub const fn items(self) -> &'a [ToggleGroupItem]—
item_idpub fn item_id(self, value: impl Into<ElementId>) -> ElementId—
Configures item id for this part.
pub fn item_id(self, value: impl Into<ElementId>) -> ElementIdView sourceroving_valuepub fn roving_value(self) -> Option<ElementId>—
The item that currently owns the group's single Tab stop. The controlled active value wins, then the first pressed enabled item, then the first enabled item.
pub fn roving_value(self) -> Option<ElementId>View sourceitempub fn item(self, value: impl Into<ElementId>) -> Option<ToggleGroupEntry<'a>>—
Describe one declared item.
pub fn item(self, value: impl Into<ElementId>) -> Option<ToggleGroupEntry<'a>>View sourceToggleGroup::root_with
View sourcepub fn root_with(self, root: Element) -> ElementDecorate an application-owned group root without adding layout or appearance.
ToggleGroup::root
View sourcepub fn root(self) -> ElementCreate the unstyled root part. Use [`Self::root_with`] to supply an existing element.
