pub struct TabsRoot { /* private fields */ }Expand description
A composable, Radix-shaped tabs configuration surface (TabsRoot / TabsList / TabsTrigger /
TabsContent).
Unlike Radix React, Fret does not use context objects; the “composition” surface is expressed as small Rust builders that thread the shared models and option values through closures.
Implementations§
Source§impl TabsRoot
impl TabsRoot
pub fn new(model: Model<Option<Arc<str>>>) -> Self
pub fn model(&self) -> Model<Option<Arc<str>>>
Sourcepub fn new_controllable<H: UiHost>(
cx: &mut ElementContext<'_, H>,
controlled: Option<Model<Option<Arc<str>>>>,
default_value: impl FnOnce() -> Option<Arc<str>>,
) -> Self
pub fn new_controllable<H: UiHost>( cx: &mut ElementContext<'_, H>, controlled: Option<Model<Option<Arc<str>>>>, default_value: impl FnOnce() -> Option<Arc<str>>, ) -> Self
Creates a tabs root with a controlled/uncontrolled selection model (Radix value /
defaultValue).
Notes:
- The internal model (uncontrolled mode) is stored in element state at the call site.
- Call this from a stable subtree (key the root node if you need state to survive reordering).
pub fn disabled(self, disabled: bool) -> Self
pub fn orientation(self, orientation: TabsOrientation) -> Self
pub fn activation_mode(self, activation_mode: TabsActivationMode) -> Self
pub fn list(self, values: Arc<[Arc<str>]>, disabled: Arc<[bool]>) -> TabsList
pub fn trigger(&self, value: impl Into<Arc<str>>) -> TabsTrigger
pub fn content(&self, value: impl Into<Arc<str>>) -> TabsContent
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TabsRoot
impl !RefUnwindSafe for TabsRoot
impl !Send for TabsRoot
impl !Sync for TabsRoot
impl Unpin for TabsRoot
impl UnsafeUnpin for TabsRoot
impl !UnwindSafe for TabsRoot
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