pub struct AccordionItem<A = ()> { /* private fields */ }Expand description
One identified accordion header and its retained content view.
IDs should be unique. They drive open-state comparison and retained view keys; duplicates are not rejected and can produce duplicate content/keys.
§Examples
use ailloli_ui_widgets::controls::AccordionItem;
use ailloli_ui_widgets::text::Text;
let item = AccordionItem::<()>::new("general", "General").child(Text::new("Settings"));
let _ = item;Implementations§
Source§impl<A: 'static> AccordionItem<A>
impl<A: 'static> AccordionItem<A>
Sourcepub fn new(id: impl Into<String>, title: impl Into<String>) -> Self
pub fn new(id: impl Into<String>, title: impl Into<String>) -> Self
Creates an enabled item with empty content.
Empty IDs and titles are accepted; callers should still use unique, stable IDs for correct retained identity.
§Examples
use ailloli_ui_widgets::controls::AccordionItem;
let item: AccordionItem<()> = AccordionItem::new("advanced", "Advanced");
let _ = item;Sourcepub fn disabled(self, disabled: impl Into<Binding<bool>>) -> Self
pub fn disabled(self, disabled: impl Into<Binding<bool>>) -> Self
Sets static or reactive disabled state for the header.
Disabled headers ignore events and leave focus traversal. Existing open content remains mounted; disabling does not close the item.
§Examples
use ailloli_ui_widgets::controls::AccordionItem;
let item: AccordionItem<()> = AccordionItem::new("locked", "Locked").disabled(true);
let _ = item;Sourcepub fn child(self, child: impl IntoView<A>) -> Self
pub fn child(self, child: impl IntoView<A>) -> Self
Replaces the item’s sole retained content view.
Content is mounted only while the item ID appears in sanitized open state.
§Examples
use ailloli_ui_widgets::controls::AccordionItem;
use ailloli_ui_widgets::text::Text;
let item = AccordionItem::<()>::new("about", "About").child(Text::new("Ailloli"));
let _ = item;Trait Implementations§
Source§impl<A: Clone> Clone for AccordionItem<A>
impl<A: Clone> Clone for AccordionItem<A>
Source§fn clone(&self) -> AccordionItem<A>
fn clone(&self) -> AccordionItem<A>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<A> Freeze for AccordionItem<A>
impl<A = ()> !RefUnwindSafe for AccordionItem<A>
impl<A = ()> !Send for AccordionItem<A>
impl<A = ()> !Sync for AccordionItem<A>
impl<A> Unpin for AccordionItem<A>
impl<A = ()> !UnwindSafe for AccordionItem<A>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<A> IntoClickAction<A> for Awhere
A: Clone + 'static,
impl<A> IntoClickAction<A> for Awhere
A: Clone + 'static,
§fn into_click_action(self) -> ClickAction<A>
fn into_click_action(self) -> ClickAction<A>
Implements the into_click_action helper used by this module.