Drawer
The Drawer component is a panel that slides out from the edge of the screen with supplementary content.
Import
Importimport { Drawer } from '@backyard-ui/core';
Usage
UsagePlacement
PlacementUse the placement
prop to change where the Drawer will appears.
Size
SizeUse the size
prop to increase the visual size.
Close on Overlay Click
Close on Overlay ClickBy default, the Drawer closes when you click its overlay. You can set closeOnOverlayClick to false
if you want the Drawer to stay visible.
Controlled
ControlledBy default, the Drawer
are uncontrolled
but you can make it controlled
API Reference
API ReferenceRoot
Root- sizeDescription The `max-width` css propertyType
"xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "full"
Defaultmd - isOpenDescription If `true` the Dialog will be initially openedType
boolean
Defaultfalse - placementDescription The drawer positionType
"top" | "right" | "bottom" | "left"
Defaultright - closeOnOverlayClickDescription If `false` the Dialog will be close when clicked on overlayType
boolean
Defaultfalse
Trigger
TriggerContent
Content- asChildDescriptionType
boolean
Cancel
CancelTitle
Title- asChildDescriptionType
boolean
Description
Description- asChildDescriptionType
boolean