Skip to content

useImperativeDialog

@astryxdesign/core v0.7.1 · useImperativeDialog

Parameters ​

NameTypeDefaultDescription
defaultOptionsImperativeDialogOptions{}Options used by every show() call: the same as Dialog props minus isOpen. A call can pass its own options, which are merged over these.

Returns ​

NameTypeDescription
show(content: () => VNodeChild, options?: ImperativeDialogOptions) => voidShow the dialog with the given content. Options are the same as Dialog props minus isOpen and the content.
hide() => voidHide the dialog.
isOpenReadonly<Ref<boolean>>Whether the dialog is currently open.
HostComponentThe dialog element. Render it once in your template: <component :is="dialog.Host" />.

Options ​

NameTypeDefaultDescription
widthnumber | string—Preferred width. Numbers are pixels, strings are used as-is. The fullscreen variant ignores it.
maxHeightnumber | string—Maximum height. Numbers are pixels, strings are used as-is. The fullscreen variant ignores it.
positionDialogPositioncenteredStatic position. Inline edges use start and end, which mirror under RTL.
variant'standard' | 'fullscreen''standard'A standard dialog is sized by width and maxHeight; a fullscreen one fills the viewport.
purpose'info' | 'form' | 'required''info'How the dialog closes. required disables Escape and the backdrop; form keeps Escape and disables the backdrop; info allows both.
paddingDialogPaddingtheme defaultPadding step, matching the --astryx-spacing-* tokens.