Leave Yamada UI a star

Star
Yamada UIYamada UIv1.5.1

Dialog

Dialog is a component used to confirm or interrupt user actions.

Source@yamada-ui/modal

Props

DialogProps

isOpen

Required

Description

If true, the open will be opened.

Type

boolean

allowPinchZoom

Description

Handle zoom or pinch gestures on iOS devices when scroll locking is enabled.

Type

boolean

Default

false.

animation

Description

The animation of the tooltip.

Type

"bottom" | "left" | "right" | "scale" | "top" | "none"

Default

'scale'

as

Type

"symbol" | "object" | "clipPath" | "filter" | "mask" | "marker" | "text" | "g" | "p" | "big" | "link" | "small" | "sub" | "sup" | "style" | "animate" | "section" | "a" | "abbr" | "address" | ... 148 more ... | "textPath"

blockScrollOnMount

Description

If true, scrolling will be disabled on the body when the modal opens.

Type

boolean

Default

true

cancel

Description

The dialog cancel to use.

Type

type ONLY_FOR_FORMAT = | string | number | boolean | ReactElement<any, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal | ButtonProps

closeOnEsc

Description

If true, the modal will close when the Esc key is pressed.

Type

boolean

Default

true

closeOnOverlay

Description

If true, the modal will close when the overlay is clicked.

Type

boolean

Default

true

colorScheme

Description

The visual color appearance of the component.

Type

"whiteAlpha" | "blackAlpha" | "gray" | "neutral" | "red" | "danger" | "rose" | "pink" | "flashy" | "orange" | "warning" | "amber" | "yellow" | "lime" | "green" | "success" | "emerald" | "teal" | "cyan" | "sky" | "blue" | "primary" | "info" | "link" | "indigo" | "violet" | "secondary" | "purple" | "fuchsia"

containerProps

Description

Props for modal container element.

Type

HTMLUIProps<"div">

duration

Description

The animation duration.

Type

number | Partial<Record<"exit" | "enter", number>>

finalFocusRef

Description

ref of the element to return focus to when FocusLock unmounts.

Type

RefObject<FocusableElement>

header

Description

The dialog header to use.

Type

type ONLY_FOR_FORMAT = | string | number | boolean | ReactElement<any, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal

initialFocusRef

Description

ref of the element to receive focus initially.

Type

RefObject<FocusableElement>

lockFocusAcrossFrames

Description

Enables aggressive focus capturing within iframes. - If true: keep focus in the lock, no matter where lock is active. - If false: allows focus to move outside of iframe.

Type

boolean

Default

false

onCancel

Description

The callback invoked when cancel button clicked.

Type

(onClose: (() => void) | undefined) => void

onClose

Description

Callback invoked to close the modal.

Type

() => void

onCloseComplete

Description

Callback function to run side effects after the modal has closed.

Type

() => void

onEsc

Description

Callback fired when the escape key is pressed and focus is within modal.

Type

() => void

onOther

Description

The callback invoked when other button clicked.

Type

(onClose: (() => void) | undefined) => void

onOverlayClick

Description

Callback fired when the overlay is clicked.

Type

() => void

onSuccess

Description

The callback invoked when success button clicked.

Type

(onClose: (() => void) | undefined) => void

other

Description

The dialog other to use.

Type

type ONLY_FOR_FORMAT = | string | number | boolean | ReactElement<any, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal | ButtonProps

outside

Description

The CSS padding property.

Type

UIValue<number | (string & {}) | "px" | "initial" | "inherit" | "sm" | "md" | "lg" | "xl" | "2xl" | "-moz-initial" | "revert" | "revert-layer" | "unset" | "1" | "-1" | "2" | "-2" | "3" | ... 96 more ... | "-4xl">

placement

Description

The placement of the modal.

Type

UIValue<| "bottom" | "left" | "right" | "top" | "center" | "top-left" | "top-right" | "bottom-left" | "bottom-right">

Default

'center'

portalProps

Description

Props to be forwarded to the portal component.

Type

Omit<PortalProps, "children">

restoreFocus

Description

If true, focus will be restored to the element that triggered the FocusLock once it unmounts.

Type

boolean

Default

false

scrollBehavior

Description

Where scroll behavior should originate. - inside: scroll only occurs within the ModalBody. - outside: the entire ModalContent will scroll within the viewport.

Type

"outside" | "inside"

Default

'inside'

size

Description

The size of the Dialog.

Type

"xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | "6xl" | "full"

Default

md

success

Description

The dialog success to use.

Type

type ONLY_FOR_FORMAT = | string | number | boolean | ReactElement<any, string | JSXElementConstructor<any>> | Iterable<ReactNode> | ReactPortal | ButtonProps

variant

Description

The variant of the Dialog.

Type

string

withCloseButton

Description

If true, display the modal close button.

Type

boolean

Default

true

withOverlay

Description

If true, display the modal overlay.

Type

boolean

Default

true

DialogHeaderProps

DialogBodyProps

DialogFooterProps

DialogOverlayProps

as

Type

"symbol" | "object" | "clipPath" | "filter" | "mask" | "marker" | "text" | "g" | "p" | "big" | "link" | "small" | "sub" | "sup" | "style" | "animate" | "section" | "a" | "abbr" | "address" | ... 148 more ... | "textPath"

DialogCloseButtonProps

disableRipple

Description

If true, disable ripple effects when pressing a element.

Type

boolean

Default

false

isDisabled

Description

If true, the button is disabled.

Type

boolean

Default

false

isRounded

Description

If true, the button is full rounded.

Type

boolean

Default

false

Edit this page on GitHub

PreviousModalNextDrawer