pub struct AlertDialogRoot { /* private fields */ }Expand description
A Radix-shaped AlertDialog root configuration surface.
Upstream AlertDialog is a constrained Dialog variant: always modal, and prefers focusing the cancel action by default. This root helper standardizes:
- controlled/uncontrolled open modeling (
open/defaultOpen) - initial focus preference (
PreferCancelby default)
Implementations§
Source§impl AlertDialogRoot
impl AlertDialogRoot
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).
pub fn initial_focus(self, initial_focus: AlertDialogInitialFocus) -> Self
pub fn options(&self) -> AlertDialogOptions
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.
pub fn open_model<H: UiHost>( &self, cx: &mut ElementContext<'_, H>, ) -> Model<bool>
pub fn open_id<H: UiHost>(&self, cx: &mut ElementContext<'_, H>) -> ModelId
pub fn is_open<H: UiHost>(&self, cx: &mut ElementContext<'_, H>) -> bool
pub fn dialog_options<H: UiHost>( &self, cx: &mut ElementContext<'_, H>, ) -> DialogOptions
pub fn modal_request<H: UiHost, I, T>(
&self,
cx: &mut ElementContext<'_, H>,
id: GlobalElementId,
trigger: GlobalElementId,
presence: OverlayPresence,
children: I,
) -> OverlayRequestwhere
I: IntoIterator<Item = T>,
T: IntoUiElement<H>,
Trait Implementations§
Source§impl Clone for AlertDialogRoot
impl Clone for AlertDialogRoot
Source§fn clone(&self) -> AlertDialogRoot
fn clone(&self) -> AlertDialogRoot
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 AlertDialogRoot
impl Debug for AlertDialogRoot
Source§impl Default for AlertDialogRoot
impl Default for AlertDialogRoot
Source§fn default() -> AlertDialogRoot
fn default() -> AlertDialogRoot
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for AlertDialogRoot
impl !RefUnwindSafe for AlertDialogRoot
impl !Send for AlertDialogRoot
impl !Sync for AlertDialogRoot
impl Unpin for AlertDialogRoot
impl UnsafeUnpin for AlertDialogRoot
impl !UnwindSafe for AlertDialogRoot
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