AlertDialog

A modal dialog that interrupts the user with important content and expects a response.

  • Name@spark-ui/alert-dialog
    Version0.2.28
    LicenseMIT
    npmgithubReported IssuesReport a bug
  • AlertDialog#

    Contains all the parts of an alert dialog.

    AttributeTypeDescriptionDefault
    openboolean-null
    defaultOpenboolean-null
    onOpenChange(open: boolean) => void-null

    AlertDialog.Trigger#

    A button that opens the dialog.

    AttributeTypeDescriptionDefault
    asChildboolean-null

    AlertDialog.Portal#

    When used, portals your overlay and content parts into the body.

    AttributeTypeDescriptionDefault
    forceMounttrueUsed to force mounting when more control is needed. Useful when controlling animation with React animation libraries.null
    containerHTMLElement-null

    AlertDialog.Overlay#

    A layer that covers the inert portion of the view when the dialog is open.

    AttributeTypeDescriptionDefault
    forceMounttrueUsed to force mounting when more control is needed. Useful when controlling animation with React animation libraries.null
    asChildboolean-null

    AlertDialog.Content#

    Contains content to be rendered when the dialog is open.

    AttributeTypeDescriptionDefault
    asChildboolean-null
    size"sm" | "md" | "lg" | "fullscreen"-null
    onEscapeKeyDown(event: KeyboardEvent) => voidEvent handler called when the escape key is down. Can be prevented.null
    onFocusOutside(event: FocusOutsideEvent) => voidEvent handler called when the focus moves outside of the `DismissableLayer`. Can be prevented.null
    onOpenAutoFocus(event: Event) => voidEvent handler called when auto-focusing on open. Can be prevented.null
    onCloseAutoFocus(event: Event) => voidEvent handler called when auto-focusing on close. Can be prevented.null
    forceMounttrueUsed to force mounting when more control is needed. Useful when controlling animation with React animation libraries.null

    AlertDialog.Header#

    To use inside of AlertDialog.Content. Sticky header inside the dialog.

    AttributeTypeDescriptionDefault
    classNamestring-null

    AlertDialog.Body#

    To use inside of AlertDialog.Content. Main content of the dialog. Becomes scrollable when content is overflowing the screen.

    AttributeTypeDescriptionDefault
    classNamestring-null

    AlertDialog.Footer#

    To use inside of AlertDialog.Content. Sticky footer to be rendered in the open dialog. Use it to render CTAs and make them accessible in every condition.

    AttributeTypeDescriptionDefault
    classNamestring-null

    AlertDialog.Title#

    An accessible name to be announced when the dialog is opened.

    AttributeTypeDescriptionDefault
    asChildboolean-null

    AlertDialog.Description#

    An accessible description to be announced when the dialog is opened.

    AttributeTypeDescriptionDefault
    asChildboolean-null

    AlertDialog.Cancel#

    A button that closes the dialog. This button should be distinguished visually from AlertDialog.Action buttons.

    AttributeTypeDescriptionDefault
    asChildboolean-null

    AlertDialog.Action#

    A button that closes the dialog. These buttons should be distinguished visually from the AlertDialog.Cancel button.

    AttributeTypeDescriptionDefault
    asChildboolean-null