useImperativeDialog
@astryxdesign/core v0.7.1 · useImperativeDialog
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
defaultOptions | ImperativeDialogOptions | {} | 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
| Name | Type | Description |
|---|---|---|
show | (content: () => VNodeChild, options?: ImperativeDialogOptions) => void | Show the dialog with the given content. Options are the same as Dialog props minus isOpen and the content. |
hide | () => void | Hide the dialog. |
isOpen | Readonly<Ref<boolean>> | Whether the dialog is currently open. |
Host | Component | The dialog element. Render it once in your template: <component :is="dialog.Host" />. |
Options
| Name | Type | Default | Description |
|---|---|---|---|
width | number | string | — | Preferred width. Numbers are pixels, strings are used as-is. The fullscreen variant ignores it. |
maxHeight | number | string | — | Maximum height. Numbers are pixels, strings are used as-is. The fullscreen variant ignores it. |
position | DialogPosition | centered | Static 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. |
padding | DialogPadding | theme default | Padding step, matching the --astryx-spacing-* tokens. |