Skip to main content

Dialog

Function Dialog 

Source
pub fn Dialog(_: DialogProps) -> Element
Expand description

A native <dialog>, controlled by open.

Modal by default: when open turns true it is shown with showModal() after mount, so the platform supplies the top layer, inert background, focus, and Escape. Escape and the close button call onclose; the owner sets open to false. Hosts without showModal render it open in place instead. With modal: false it is always the in-place, non-modal form.

§Props

For details, see the props struct definition.

  • open : bool
  • onclose : EventHandler<()>
  • title : Element
  • heading : HeadingLevel
  • description : Option<Element>
  • size : DialogSize
  • placement : DialogPlacement
  • modal : bool
  • close_label : Option<AccessibleName>

    Names the close button; “Close” when omitted.

  • footer : Option<Element>
  • handle : bool

    The drag handle drawn on a bottom sheet. Decorative.

  • scrollable : bool

    Make a body that may scroll reachable by keyboard.

  • fc_id : Option<Id>

    The runtime id for data-fc-id; it also marks the dialog data-fc-kind="dialog".

  • class : Option<String>
  • attributes : Vec<Attribute>
  • children : Element