pub struct DialogProps<'__a> {
pub open: Expr<bool>,
pub attrs: Attributes,
pub child: Child<'__a>,
}Expand description
A panel displayed over the page.
Pass a boolean to open for a fixed state, or a runtime expression to control it in
the browser. The overlay blocks clicks on the page behind it. Focus trapping and
Escape dismissal require application scripting.
Pass a dialog_content panel as child content. attrs are forwarded to the
<dialog>, with extra classes added to its classes.
Give the dialog an accessible name with aria-label, or use aria-labelledby
to reference its title’s ID.
ⓘ
view! {
dialog(
open: confirming,
dialog_content(
dialog_header(
dialog_title("Delete workspace")
dialog_description("This cannot be undone.")
)
dialog_footer(
// Closing the dialog is navigating to a page that
// renders it closed.
<a
href="/workspace"
class=(button_variants(ButtonVariant::Ghost, ButtonSize::Md))
>
"Cancel"
</a>
button(variant: ButtonVariant::Destructive, "Delete")
)
)
)
}Fields§
§open: Expr<bool>Whether the dialog shows.
attrs: AttributesExtra attributes for the <dialog> element.
child: Child<'__a>The dialog’s content.
Implementations§
Source§impl<'__a> DialogProps<'__a>
impl<'__a> DialogProps<'__a>
Sourcepub fn builder() -> DialogPropsBuilder<'__a, open>
pub fn builder() -> DialogPropsBuilder<'__a, open>
Returns a DialogPropsBuilder with no properties set.
Trait Implementations§
Auto Trait Implementations§
impl<'__a> !RefUnwindSafe for DialogProps<'__a>
impl<'__a> !Sync for DialogProps<'__a>
impl<'__a> !UnwindSafe for DialogProps<'__a>
impl<'__a> Freeze for DialogProps<'__a>
impl<'__a> Send for DialogProps<'__a>
impl<'__a> Unpin for DialogProps<'__a>
impl<'__a> UnsafeUnpin for DialogProps<'__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