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

Theming

The Drawer is a multi part component.

export const Drawer: ComponentMultiStyle<"Drawer"> = mergeMultiStyle(Modal, {
baseStyle: {
container: ({ isFullHeight, placement }) => ({
...(isFullHeight ? { height: "100dvh", rounded: 0 } : {}),
[`rounded${toCamelCase(placement)}`]: 0,
}),
inner: {},
body: {
overflow: "auto",
},
dragBar: ({ placement }) => ({
[`margin${toCamelCase(antonym(placement))}`]: "md",
...(placement === "top" || placement === "bottom"
? { mx: "auto", w: "3xs", minH: "2" }
: { my: "auto", minW: "2", h: "3xs" }),
bg: ["blackAlpha.100", "whiteAlpha.100"],
rounded: "full",
}),
},
sizes: {
xs: { container: { maxW: "xs" } },
sm: { container: { maxW: "md" } },
md: { container: { maxW: "lg" } },
lg: { container: { maxW: "2xl" } },
xl: { container: { maxW: "4xl" } },
full: {
container: { minW: "100vw", minH: "100dvh", rounded: 0 },
},
},
defaultProps: {
size: "md",
},
})({ omit: ["sizes"] })
Copied!

Edit this page on GitHub

PreviousDialogNextMenu