Skip to content

DialogHost

function DialogHost(__namedParameters): Element;

Host component for dialogs. Place this at the root of your app. Provides the useDialog hook to children.

ParameterType
__namedParametersDialogHostProps

Element

function App() {
return (
<DialogHost>
<MyApp />
</DialogHost>
);
}

PropertyType
children?ReactNode

PropertyTypeDescription
backdropStyle?StyleStyle for the backdrop overlay
buttonStyle?StyleBase style for buttons
focusedButtonStyle?StyleStyle for focused button state (merged with button styles)
okButtonStyle?StyleStyle for the OK button (merged with buttonStyle)
okText?stringText for the OK button (default: “OK”)
style?StyleStyle for the dialog box

PropertyTypeDescriptionInherited from
backdropStyle?StyleStyle for the backdrop overlayAlertOptions.backdropStyle
buttonStyle?StyleBase style for buttonsAlertOptions.buttonStyle
cancelButtonStyle?StyleStyle for the Cancel button (merged with buttonStyle)-
cancelText?stringText for the Cancel button (default: “Cancel”)-
focusedButtonStyle?StyleStyle for focused button state (merged with button styles)AlertOptions.focusedButtonStyle
okButtonStyle?StyleStyle for the OK button (merged with buttonStyle)AlertOptions.okButtonStyle
okText?stringText for the OK button (default: “OK”)AlertOptions.okText
style?StyleStyle for the dialog boxAlertOptions.style

PropertyTypeDescription
alert(content, options?) => Promise<void>Show an alert dialog. Returns a promise that resolves when dismissed.
confirm(content, options?) => Promise<boolean>Show a confirm dialog. Returns a promise that resolves to true (OK) or false (Cancel).