Dialog API

API documentation for Dialog component

Dialog#

Props#

Defines valid properties in Dialog component.

nametypedefaultdescription
refRef<unknown>
null
The reference to the component instance.
pIfboolean
true
Whether the component should be rendered.
styleCSSProperties | ((instance?: DialogInstance) => CSSProperties)
null
The style to apply to the component.
classNamestring | ((instance?: DialogInstance) => string)
null
The class name to apply to the component.
asstring | number | bigint | boolean | ComponentClass<any, any> | FunctionComponent<any> | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode, any, any> | ReactPortal | Promise<AwaitedReactNode>
null
The component type to render.
asChildboolean
false
Whether the component should be rendered as a child component.
ptSafeRecord<DialogPassThrough>
null
The pass-through props to pass to the component
ptOptionsPassThroughOptions
null
The pass-through options to pass to the component
unstyledboolean
null
Whether the component should be rendered without classes.
dtunknown
null
The design token to use for the component.
stylesStylesOptions<ComponentInstance>
null
The styles to use for the component.
childrenReactNode | ((instance: DialogInstance) => ReactNode)
null
The children to render.
position"center" | "top" | "bottom" | "left" | "right" | "topleft" | "topright" | "bottomleft" | "bottomright"
center
Position of the dialog.
onOpenChange(event: DialogChangeEvent) => void
null
Callback function that is called when the trigger is clicked.
openboolean
false
Specifies the visibility of the dialog.
defaultOpenboolean
false
Specifies the default visibility of the dialog.
draggableboolean
true
Enables dragging to change the position using header.
keepInViewportboolean
true
Keeps dialog in the viewport.
minXnumber
0
Minimum value for the left coordinate of dialog in dragging.
minYnumber
0
Minimum value for the top coordinate of dialog in dragging.
modalboolean
undefined
Defines if background should be blocked when dialog is displayed.
dismissableMaskboolean
false
Specifies if clicking the modal background should hide the dialog.
closeOnEscapeboolean
true
Specifies if pressing escape key should hide the dialog.
blockScrollboolean
false
Whether background scroll should be blocked when dialog is visible.
baseZIndexnumber
0
Base zIndex value to use in layering.
autoZIndexboolean
true
Whether to automatically manage layering.
appendToHTMLElement | "body" | "self"
body
A valid query selector or an HTMLElement to specify where the dialog gets attached.
[key: string]any
null
pt-{optionName}-*-
null
Pass through attributes for customizing component. For more info, see Pass Through tab.

State#

Defines valid state in Dialog component.

nametypedefaultdescription
openedboolean
null
Whether the dialog is currently opened.
maximizedboolean
null
Whether the dialog is currently maximized.
maskVisibleboolean
null
Whether the mask is currently visible.

Exposes#

Defines the methods and properties exposed by Dialog component.

nametypedefaultdescription
stateuseDialogState
null
Current state of the dialog.
maskRefRefObject<HTMLDivElement>
null
Reference to the mask element.
motionRefRefObject<{ elementRef: RefObject<HTMLDivElement> }>
null
Reference to the close button element.
closeButtonRefRefObject<{ elementRef: RefObject<HTMLButtonElement> }>
null
Reference to the close button element.
maximizableButtonRefRefObject<{ elementRef: RefObject<HTMLButtonElement> }>
null
Reference to the maximizable button element.
onOpenStateChange() => void
null
Method to change the open state of the dialog.
close() => void
null
Method to close the dialog.
toggleMaximized() => void
null
Method to toggle maximized state.
onMaskMouseDown(event: MouseEvent) => void
null
Handler for mask mouse down events.
onMaskMouseUp() => void
null
Handler for mask mouse up events.
onDragStart(event: MouseEvent) => void
null
Handler for drag start events.
onMotionEnter() => void
null
Handler for motion enter events.
onMotionAfterEnter() => void
null
Handler for motion after enter events.
onMotionBeforeLeave() => void
null
Handler for motion before leave events.
onMotionLeave() => void
null
Handler for motion leave events.
onMotionAfterLeave() => void
null
Handler for motion after leave events.

Interfaces#

Defines passthrough(pt) options of Dialog component.

nametypedefaultdescription
rootDialogPassThroughType<HTMLAttributes<HTMLDivElement>>
null
Used to pass attributes to the root's DOM element.
maskDialogPassThroughType<HTMLAttributes<HTMLDivElement>>
null
Used to pass attributes to the mask's DOM element.
triggerDialogPassThroughType<HTMLAttributes<HTMLButtonElement>>
null
Used to pass attributes to the trigger's DOM element.
triggerIconDialogPassThroughType<HTMLAttributes<HTMLElement>>
null
Used to pass attributes to the trigger icon's DOM element.
portalDialogPassThroughType<HTMLAttributes<HTMLDivElement>>
null
Used to pass attributes to the portal's DOM element.
headerDialogPassThroughType<HTMLAttributes<HTMLDivElement>>
null
Used to pass attributes to the header's DOM element.
titleDialogPassThroughType<HTMLAttributes<HTMLDivElement>>
null
Used to pass attributes to the title's DOM element.
headerActionsDialogPassThroughType<HTMLAttributes<HTMLDivElement>>
null
Used to pass attributes to the headerActions's DOM element.
maximizableDialogPassThroughType<HTMLAttributes<HTMLButtonElement>>
null
Used to pass attributes to the maximizable's DOM element.
maximizableIconDialogPassThroughType<HTMLAttributes<HTMLElement>>
null
Used to pass attributes to the maximizable icon's DOM element.
closeDialogPassThroughType<HTMLAttributes<HTMLButtonElement>>
null
Used to pass attributes to the close's DOM element.
closeIconDialogPassThroughType<HTMLAttributes<HTMLElement>>
null
Used to pass attributes to the close icon's DOM element.
contentDialogPassThroughType<HTMLAttributes<HTMLDivElement>>
null
Used to pass attributes to the content's DOM element.
footerDialogPassThroughType<HTMLAttributes<HTMLDivElement>>
null
Used to pass attributes to the footer's DOM element.

Types#

Instance of Dialog component.

values
ComponentInstance<DialogProps, DialogState, DialogExposes>

DialogTrigger#

Props#

Defines valid properties in DialogTrigger component.

nametypedefaultdescription
refRef<unknown>
null
The reference to the component instance.
pIfboolean
true
Whether the component should be rendered.
styleCSSProperties | ((instance?: DialogTriggerInstance) => CSSProperties)
null
The style to apply to the component.
classNamestring | ((instance?: DialogTriggerInstance) => string)
null
The class name to apply to the component.
asstring | number | bigint | boolean | ComponentClass<any, any> | FunctionComponent<any> | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode, any, any> | ReactPortal | Promise<AwaitedReactNode>
null
The component type to render.
asChildboolean
false
Whether the component should be rendered as a child component.
ptSafeRecord<DialogTriggerPassThrough>
null
The pass-through props to pass to the component
ptOptionsPassThroughOptions
null
The pass-through options to pass to the component
unstyledboolean
null
Whether the component should be rendered without classes.
dtunknown
null
The design token to use for the component.
stylesStylesOptions<ComponentInstance>
null
The styles to use for the component.
childrenReactNode | ((instance: DialogTriggerInstance) => ReactNode)
null
The children to render.
[key: string]any
null
pt-{optionName}-*-
null
Pass through attributes for customizing component. For more info, see Pass Through tab.

Exposes#

Defines the methods and properties exposed by DialogTrigger component.

nametypedefaultdescription
dialogDialogInstance
null
Instance of the Dialog component.

Interfaces#

Defines passthrough(pt) options of DialogTrigger component.

nametypedefaultdescription
rootDialogTriggerPassThroughType<HTMLAttributes<HTMLButtonElement>>
null
Used to pass attributes to the root's DOM element.

Types#

Instance of DialogTrigger component.

values
ComponentInstance<DialogTriggerProps, DialogTriggerState, DialogTriggerExposes>

DialogPortal#

Props#

Defines valid properties in DialogPortal component.

nametypedefaultdescription
refRef<unknown>
null
The reference to the component instance.
pIfboolean
true
Whether the component should be rendered.
styleCSSProperties | ((instance?: DialogPortalInstance) => CSSProperties)
null
The style to apply to the component.
classNamestring | ((instance?: DialogPortalInstance) => string)
null
The class name to apply to the component.
asstring | number | bigint | boolean | ComponentClass<any, any> | FunctionComponent<any> | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode, any, any> | ReactPortal | Promise<AwaitedReactNode>
null
The component type to render.
asChildboolean
false
Whether the component should be rendered as a child component.
ptSafeRecord<DialogPortalPassThrough>
null
The pass-through props to pass to the component
ptOptionsPassThroughOptions
null
The pass-through options to pass to the component
unstyledboolean
null
Whether the component should be rendered without classes.
dtunknown
null
The design token to use for the component.
stylesStylesOptions<ComponentInstance>
null
The styles to use for the component.
childrenReactNode | ((instance: DialogPortalInstance) => ReactNode)
null
The children to render.
[key: string]any
null
pt-{optionName}-*-
null
Pass through attributes for customizing component. For more info, see Pass Through tab.

Exposes#

Defines the methods and properties exposed by DialogPortal component.

nametypedefaultdescription
dialogDialogInstance
null
Instance of the Dialog component.

Interfaces#

Defines passthrough(pt) options of DialogPortal component.

nametypedefaultdescription
rootDialogPortalPassThroughType<HTMLAttributes<HTMLButtonElement>>
null
Used to pass attributes to the root's DOM element.

Types#

Instance of DialogPortal component.

values
ComponentInstance<DialogPortalProps, DialogPortalState, DialogPortalExposes>

DialogHeader#

Props#

Defines valid properties in DialogHeader component.

nametypedefaultdescription
refRef<unknown>
null
The reference to the component instance.
pIfboolean
true
Whether the component should be rendered.
styleCSSProperties | ((instance?: DialogHeaderInstance) => CSSProperties)
null
The style to apply to the component.
classNamestring | ((instance?: DialogHeaderInstance) => string)
null
The class name to apply to the component.
asstring | number | bigint | boolean | ComponentClass<any, any> | FunctionComponent<any> | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode, any, any> | ReactPortal | Promise<AwaitedReactNode>
null
The component type to render.
asChildboolean
false
Whether the component should be rendered as a child component.
ptSafeRecord<DialogHeaderPassThrough>
null
The pass-through props to pass to the component
ptOptionsPassThroughOptions
null
The pass-through options to pass to the component
unstyledboolean
null
Whether the component should be rendered without classes.
dtunknown
null
The design token to use for the component.
stylesStylesOptions<ComponentInstance>
null
The styles to use for the component.
childrenReactNode | ((instance: DialogHeaderInstance) => ReactNode)
null
The children to render.
[key: string]any
null
pt-{optionName}-*-
null
Pass through attributes for customizing component. For more info, see Pass Through tab.

Exposes#

Defines the methods and properties exposed by DialogHeader component.

nametypedefaultdescription
dialogDialogInstance
null
The Dialog component instance.

Interfaces#

Defines passthrough(pt) options of DialogHeader component.

nametypedefaultdescription
rootDialogHeaderPassThroughType<HTMLAttributes<HTMLDivElement>>
null
Used to pass attributes to the root's DOM element.

Types#

Instance of DialogHeader component.

values
ComponentInstance<DialogHeaderProps, DialogHeaderState, DialogHeaderExposes>

DialogTitle#

Props#

Defines valid properties in DialogTitle component.

nametypedefaultdescription
refRef<unknown>
null
The reference to the component instance.
pIfboolean
true
Whether the component should be rendered.
styleCSSProperties | ((instance?: DialogTitleInstance) => CSSProperties)
null
The style to apply to the component.
classNamestring | ((instance?: DialogTitleInstance) => string)
null
The class name to apply to the component.
asstring | number | bigint | boolean | ComponentClass<any, any> | FunctionComponent<any> | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode, any, any> | ReactPortal | Promise<AwaitedReactNode>
null
The component type to render.
asChildboolean
false
Whether the component should be rendered as a child component.
ptSafeRecord<DialogTitlePassThrough>
null
The pass-through props to pass to the component
ptOptionsPassThroughOptions
null
The pass-through options to pass to the component
unstyledboolean
null
Whether the component should be rendered without classes.
dtunknown
null
The design token to use for the component.
stylesStylesOptions<ComponentInstance>
null
The styles to use for the component.
childrenReactNode | ((instance: DialogTitleInstance) => ReactNode)
null
The children to render.
[key: string]any
null
pt-{optionName}-*-
null
Pass through attributes for customizing component. For more info, see Pass Through tab.

Exposes#

Defines the methods and properties exposed by DialogTitle component.

nametypedefaultdescription
dialogDialogInstance
null
The Dialog component instance.

Interfaces#

Defines passthrough(pt) options of DialogTitle component.

nametypedefaultdescription
rootDialogTitlePassThroughType<HTMLAttributes<HTMLDivElement>>
null
Used to pass attributes to the root's DOM element.

Types#

Instance of DialogTitle component.

values
ComponentInstance<DialogTitleProps, DialogTitleState, DialogTitleExposes>

DialogHeaderActions#

Props#

Defines valid properties in DialogHeaderActions component.

nametypedefaultdescription
refRef<unknown>
null
The reference to the component instance.
pIfboolean
true
Whether the component should be rendered.
styleCSSProperties | ((instance?: DialogHeaderActionsInstance) => CSSProperties)
null
The style to apply to the component.
classNamestring | ((instance?: DialogHeaderActionsInstance) => string)
null
The class name to apply to the component.
asstring | number | bigint | boolean | ComponentClass<any, any> | FunctionComponent<any> | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode, any, any> | ReactPortal | Promise<AwaitedReactNode>
null
The component type to render.
asChildboolean
false
Whether the component should be rendered as a child component.
ptSafeRecord<DialogHeaderActionsPassThrough>
null
The pass-through props to pass to the component
ptOptionsPassThroughOptions
null
The pass-through options to pass to the component
unstyledboolean
null
Whether the component should be rendered without classes.
dtunknown
null
The design token to use for the component.
stylesStylesOptions<ComponentInstance>
null
The styles to use for the component.
childrenReactNode | ((instance: DialogHeaderActionsInstance) => ReactNode)
null
The children to render.
[key: string]any
null
pt-{optionName}-*-
null
Pass through attributes for customizing component. For more info, see Pass Through tab.

Exposes#

Defines the methods and properties exposed by DialogHeaderActions component.

nametypedefaultdescription
dialogDialogInstance
null
The dialog instance that the header actions belong to.

Interfaces#

Defines passthrough(pt) options of DialogHeaderActions component.

nametypedefaultdescription
rootDialogHeaderActionsPassThroughType<HTMLAttributes<HTMLDivElement>>
null
Used to pass attributes to the root's DOM element.

Types#

Instance of DialogHeaderActions component.

values
ComponentInstance<DialogHeaderActionsProps, DialogHeaderActionsState, DialogHeaderActionsExposes>

DialogMaximizable#

Props#

Defines valid properties in DialogMaximizable component.

nametypedefaultdescription
refRef<unknown>
null
The reference to the component instance.
pIfboolean
true
Whether the component should be rendered.
styleCSSProperties | ((instance?: DialogMaximizableInstance) => CSSProperties)
null
The style to apply to the component.
classNamestring | ((instance?: DialogMaximizableInstance) => string)
null
The class name to apply to the component.
asstring | number | bigint | boolean | ComponentClass<any, any> | FunctionComponent<any> | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode, any, any> | ReactPortal | Promise<AwaitedReactNode>
null
The component type to render.
asChildboolean
false
Whether the component should be rendered as a child component.
ptSafeRecord<DialogMaximizablePassThrough>
null
The pass-through props to pass to the component
ptOptionsPassThroughOptions
null
The pass-through options to pass to the component
unstyledboolean
null
Whether the component should be rendered without classes.
dtunknown
null
The design token to use for the component.
stylesStylesOptions<ComponentInstance>
null
The styles to use for the component.
childrenReactNode | ((instance: DialogMaximizableInstance) => ReactNode)
null
The children to render.
iconOnlyboolean
true
Whether to show the DialogMaximizable with a borderless style.
severitystring & {} | "secondary" | "info" | "success" | "warn" | "danger" | "contrast" | "help"
'secondary'
Severity type of the DialogMaximizable.
variant"link" | "text" | "outlined"
'text'
Variant of the DialogMaximizable.
roundedboolean
true
Whether to show the DialogMaximizable with a rounded style.
[key: string]any
null
pt-{optionName}-*-
null
Pass through attributes for customizing component. For more info, see Pass Through tab.

Exposes#

Defines the methods and properties exposed by DialogMaximizable component.

nametypedefaultdescription
dialogDialogInstance
null
Instance of the Dialog component.

Interfaces#

Defines passthrough(pt) options of DialogMaximizable component.

nametypedefaultdescription
rootDialogMaximizablePassThroughType<HTMLAttributes<HTMLButtonElement>>
null
Used to pass attributes to the root's DOM element.

Types#

Instance of DialogMaximizable component.

values
ComponentInstance<DialogMaximizableProps, DialogMaximizableState, DialogMaximizableExposes>

DialogClose#

Props#

Defines valid properties in DialogClose component.

nametypedefaultdescription
refRef<unknown>
null
The reference to the component instance.
pIfboolean
true
Whether the component should be rendered.
styleCSSProperties | ((instance?: DialogCloseInstance) => CSSProperties)
null
The style to apply to the component.
classNamestring | ((instance?: DialogCloseInstance) => string)
null
The class name to apply to the component.
asstring | number | bigint | boolean | ComponentClass<any, any> | FunctionComponent<any> | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode, any, any> | ReactPortal | Promise<AwaitedReactNode>
null
The component type to render.
asChildboolean
false
Whether the component should be rendered as a child component.
ptSafeRecord<DialogClosePassThrough>
null
The pass-through props to pass to the component
ptOptionsPassThroughOptions
null
The pass-through options to pass to the component
unstyledboolean
null
Whether the component should be rendered without classes.
dtunknown
null
The design token to use for the component.
stylesStylesOptions<ComponentInstance>
null
The styles to use for the component.
childrenReactNode | ((instance: DialogCloseInstance) => ReactNode)
null
The children to render.
iconOnlyboolean
true
Whether to show the DialogClose with a borderless style.
severitystring & {} | "secondary" | "info" | "success" | "warn" | "danger" | "contrast" | "help"
'secondary'
Severity type of the DialogClose.
variant"link" | "text" | "outlined"
'text'
Variant of the DialogClose.
roundedboolean
true
Whether to show the DialogClose with a rounded style.
[key: string]any
null
pt-{optionName}-*-
null
Pass through attributes for customizing component. For more info, see Pass Through tab.

Exposes#

Defines the methods and properties exposed by DialogClose component.

nametypedefaultdescription
dialogDialogInstance
null
Instance of the Dialog component.

Interfaces#

Defines passthrough(pt) options of DialogClose component.

nametypedefaultdescription
rootDialogClosePassThroughType<HTMLAttributes<HTMLButtonElement>>
null
Used to pass attributes to the root's DOM element.

Types#

Instance of DialogClose component.

values
ComponentInstance<DialogCloseProps, DialogCloseState, DialogCloseExposes>

DialogContent#

Props#

Defines valid properties in DialogContent component.

nametypedefaultdescription
refRef<unknown>
null
The reference to the component instance.
pIfboolean
true
Whether the component should be rendered.
styleCSSProperties | ((instance?: DialogContentInstance) => CSSProperties)
null
The style to apply to the component.
classNamestring | ((instance?: DialogContentInstance) => string)
null
The class name to apply to the component.
asstring | number | bigint | boolean | ComponentClass<any, any> | FunctionComponent<any> | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode, any, any> | ReactPortal | Promise<AwaitedReactNode>
null
The component type to render.
asChildboolean
false
Whether the component should be rendered as a child component.
ptSafeRecord<DialogContentPassThrough>
null
The pass-through props to pass to the component
ptOptionsPassThroughOptions
null
The pass-through options to pass to the component
unstyledboolean
null
Whether the component should be rendered without classes.
dtunknown
null
The design token to use for the component.
stylesStylesOptions<ComponentInstance>
null
The styles to use for the component.
childrenReactNode | ((instance: DialogContentInstance) => ReactNode)
null
The children to render.
[key: string]any
null
pt-{optionName}-*-
null
Pass through attributes for customizing component. For more info, see Pass Through tab.

Exposes#

Defines the methods and properties exposed by DialogContent component.

nametypedefaultdescription
dialogDialogInstance
null
The Dialog component instance.

Interfaces#

Defines passthrough(pt) options of DialogContent component.

nametypedefaultdescription
rootDialogContentPassThroughType<HTMLAttributes<HTMLDivElement>>
null
Used to pass attributes to the root's DOM element.

Types#

Instance of DialogContent component.

values
ComponentInstance<DialogContentProps, DialogContentState, DialogContentExposes>

DialogFooter#

Props#

Defines valid properties in DialogFooter component.

nametypedefaultdescription
refRef<unknown>
null
The reference to the component instance.
pIfboolean
true
Whether the component should be rendered.
styleCSSProperties | ((instance?: DialogFooterInstance) => CSSProperties)
null
The style to apply to the component.
classNamestring | ((instance?: DialogFooterInstance) => string)
null
The class name to apply to the component.
asstring | number | bigint | boolean | ComponentClass<any, any> | FunctionComponent<any> | ReactElement<unknown, string | JSXElementConstructor<any>> | Iterable<ReactNode, any, any> | ReactPortal | Promise<AwaitedReactNode>
null
The component type to render.
asChildboolean
false
Whether the component should be rendered as a child component.
ptSafeRecord<DialogFooterPassThrough>
null
The pass-through props to pass to the component
ptOptionsPassThroughOptions
null
The pass-through options to pass to the component
unstyledboolean
null
Whether the component should be rendered without classes.
dtunknown
null
The design token to use for the component.
stylesStylesOptions<ComponentInstance>
null
The styles to use for the component.
childrenReactNode | ((instance: DialogFooterInstance) => ReactNode)
null
The children to render.
[key: string]any
null
pt-{optionName}-*-
null
Pass through attributes for customizing component. For more info, see Pass Through tab.

Exposes#

Defines the methods and properties exposed by DialogFooter component.

nametypedefaultdescription
dialogDialogInstance
null
The Dialog component instance.

Interfaces#

Defines passthrough(pt) options of DialogFooter component.

nametypedefaultdescription
rootDialogFooterPassThroughType<HTMLAttributes<HTMLDivElement>>
null
Used to pass attributes to the root's DOM element.

Types#

Instance of DialogFooter component.

values
ComponentInstance<DialogFooterProps, DialogFooterState, DialogFooterExposes>

useDialog#

Props#

Defines valid properties in useDialog.

nametypedefaultdescription
openboolean
false
Specifies the visibility of the dialog.
defaultOpenboolean
false
Specifies the default visibility of the dialog.
draggableboolean
true
Enables dragging to change the position using header.
keepInViewportboolean
true
Keeps dialog in the viewport.
minXnumber
0
Minimum value for the left coordinate of dialog in dragging.
minYnumber
0
Minimum value for the top coordinate of dialog in dragging.
modalboolean
undefined
Defines if background should be blocked when dialog is displayed.
dismissableMaskboolean
false
Specifies if clicking the modal background should hide the dialog.
closeOnEscapeboolean
true
Specifies if pressing escape key should hide the dialog.
blockScrollboolean
false
Whether background scroll should be blocked when dialog is visible.
baseZIndexnumber
0
Base zIndex value to use in layering.
autoZIndexboolean
true
Whether to automatically manage layering.
appendToHTMLElement | "body" | "self"
body
A valid query selector or an HTMLElement to specify where the dialog gets attached.
onOpenChange(event: useDialogChangeEvent) => void
null
Callback function that is called when the trigger is clicked.

State#

Defines valid state in useDialog.

nametypedefaultdescription
openedboolean
null
Whether the dialog is currently opened.
maximizedboolean
null
Whether the dialog is currently maximized.
maskVisibleboolean
null
Whether the mask is currently visible.

Exposes#

Defines the methods and properties exposed by useDialog.

nametypedefaultdescription
stateuseDialogState
null
Current state of the dialog.
maskRefRefObject<HTMLDivElement>
null
Reference to the mask element.
motionRefRefObject<{ elementRef: RefObject<HTMLDivElement> }>
null
Reference to the close button element.
closeButtonRefRefObject<{ elementRef: RefObject<HTMLButtonElement> }>
null
Reference to the close button element.
maximizableButtonRefRefObject<{ elementRef: RefObject<HTMLButtonElement> }>
null
Reference to the maximizable button element.
onOpenStateChange() => void
null
Method to change the open state of the dialog.
close() => void
null
Method to close the dialog.
toggleMaximized() => void
null
Method to toggle maximized state.
onMaskMouseDown(event: MouseEvent) => void
null
Handler for mask mouse down events.
onMaskMouseUp() => void
null
Handler for mask mouse up events.
onDragStart(event: MouseEvent) => void
null
Handler for drag start events.
onMotionEnter() => void
null
Handler for motion enter events.
onMotionAfterEnter() => void
null
Handler for motion after enter events.
onMotionBeforeLeave() => void
null
Handler for motion before leave events.
onMotionLeave() => void
null
Handler for motion leave events.
onMotionAfterLeave() => void
null
Handler for motion after leave events.

Events#

Event fired when the dialog's open state changes.

nametypedescription
valuebooleanThe value of the dialog.

Types#

Instance of useDialog headless.

values
HeadlessInstance<useDialogProps, useDialogState, useDialogExposes>