Skip to content
hightouchUI

Design system

v42.1.0

Drawer

Drawer offers a way to show some information without creating a dedicated page for it. Usually used for showing information related to each row in a table, while staying on the same page.

Import

The drawer may be composed of the following four components.

  • Drawer: The outer drawer section.
  • DrawerHeader: The drawer's header.
  • DrawerBody: The drawer's body.
  • DrawerFooter: The drawer's footer.

Example

Guidelines

When to use

  • To display information that doesn't have a dedicated page where it's displayed.

When not to use

  • When creating a resource. Use the WizardDrawer to create a resource in a drawer.

Drawer props

NameDefaultDescription
blockBackgroundInteractiontruebooleanShow an overlay and block app interaction.
closeOnOverlayClicktruebooleanClose drawer on overlay click.
contentWrapperStyles

Omit< | ChakraBoxProps, | "direction" | keyof ColorProps | keyof BackgroundProps | keyof BorderProps | > & | ColorProps & | BackgroundProps & | BorderProps & { | surface?: Surface; | }Drawer content
isOpenfalsebooleanDetermines if drawer is open.
children

ReactNodeDrawer content. The common pattern is DrawerHeader, DrawerBody, and DrawerFooter.
closeOnEsctruebooleanClose drawer on escape key press.
initialFocusRef

RefObject<HTMLElement>Ref to the element that should receive focus when the drawer opens.
placement

ChakraDrawerProps["placement"]The drawer's placement.
size"lg""xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "full"Drawer size.
trapFocusfalsebooleanTrap focus within drawer.
showOverlayfalsebooleanRender overlay.
onClose

() => voidCallback invoked to close the modal.