Leave Yamada UI a star

Star
Yamada UIYamada UIv1.5.1

Drawer

Drawer is a component for a panel that appears from the edge of the screen.

Source@yamada-ui/modal

Props

DrawerProps

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.

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"

blankForDragProps

Description

Props for the blank area when closeOnDrag is true.

Type

CSSUIObject

blockScrollOnMount

Description

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

Type

boolean

Default

true

closeOnDrag

Description

If true, then the drawer will close on drag.

Type

boolean

Default

false

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">

dragConstraints

Description

Applies constraints on the permitted draggable area.

Type

number

Default

0

dragElastic

Description

The degree of movement allowed outside constraints. 0 = no movement, 1 = full movement.

Type

number

Default

0.1

dragOffset

Description

Offset from being dragged to closing.

Type

number

Default

80

dragVelocity

Description

Velocity of the drag that triggers close.

Type

number

Default

100

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>

initialFocusRef

Description

ref of the element to receive focus initially.

Type

RefObject<FocusableElement>

isFullHeight

Description

If true and drawer's placement is top or bottom, the drawer will occupy the viewport height (100dvh).

Type

boolean

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

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

onOverlayClick

Description

Callback fired when the overlay is clicked.

Type

() => void

placement

Description

The placement of the drawer.

Type

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

Default

'right'

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

size

Description

The size of the Drawer.

Type

"xs" | "sm" | "md" | "lg" | "xl" | "full"

Default

md

variant

Description

The variant of the Drawer.

Type

string

withCloseButton

Description

If true, display the modal close button.

Type

boolean

Default

true

withDragBar

Description

If true, display the drag bar when closeOnDrag is true.

Type

boolean

Default

true

withOverlay

Description

If true, display the modal overlay.

Type

boolean

Default

true

DrawerHeaderProps

DrawerBodyProps

DrawerFooterProps

DrawerOverlayProps

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"

DrawerCloseButtonProps

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

PreviousDialogNextMenu