pub struct CollapsibleRoot { /* private fields */ }Expand description
A Radix-shaped Collapsible root configuration surface.
Upstream supports a controlled/uncontrolled open state (open + defaultOpen). In Fret this
maps to either:
- a caller-provided
Model<bool>(controlled), or - an internal
Model<bool>stored in element state (uncontrolled).
Implementations§
Source§impl CollapsibleRoot
impl CollapsibleRoot
pub fn new() -> Self
Sourcepub fn open(self, open: Option<Model<bool>>) -> Self
pub fn open(self, open: Option<Model<bool>>) -> Self
Sets the controlled open model (Some) or selects uncontrolled mode (None).
Sourcepub fn default_open(self, default_open: bool) -> Self
pub fn default_open(self, default_open: bool) -> Self
Sets the uncontrolled initial open value (Radix defaultOpen).
Sourcepub fn use_open_model<H: UiHost>(
&self,
cx: &mut ElementContext<'_, H>,
) -> ControllableModel<bool>
pub fn use_open_model<H: UiHost>( &self, cx: &mut ElementContext<'_, H>, ) -> ControllableModel<bool>
Returns a Model<bool> that behaves like Radix useControllableState for open.
Sourcepub fn is_open<H: UiHost>(&self, cx: &mut ElementContext<'_, H>) -> bool
pub fn is_open<H: UiHost>(&self, cx: &mut ElementContext<'_, H>) -> bool
Reads the current open value from the derived open model.
Trait Implementations§
Source§impl Clone for CollapsibleRoot
impl Clone for CollapsibleRoot
Source§fn clone(&self) -> CollapsibleRoot
fn clone(&self) -> CollapsibleRoot
Returns a duplicate 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 moreSource§impl Debug for CollapsibleRoot
impl Debug for CollapsibleRoot
Source§impl Default for CollapsibleRoot
impl Default for CollapsibleRoot
Source§fn default() -> CollapsibleRoot
fn default() -> CollapsibleRoot
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for CollapsibleRoot
impl !RefUnwindSafe for CollapsibleRoot
impl !Send for CollapsibleRoot
impl !Sync for CollapsibleRoot
impl Unpin for CollapsibleRoot
impl UnsafeUnpin for CollapsibleRoot
impl !UnwindSafe for CollapsibleRoot
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