gluestack-ui logo
Get Updates
Prompt to React Native UI
Home
Components
Hooks
Apps
MCP Server
Guides
Home
Overview
IntroductionQuick Start
Getting Started
InstallationTooling SetupVS Code ExtensionsFigma UI KitCLIgluestack-ui-nativewind-utils
Core Concepts
AccessibilityUniversal
Performance
Benchmarks
Theme Configuration
Default TokensCustomizing ThemeDark Mode
Components
All Components
Typography
HeadingrscTextrsc
Layout
BoxrscCenterrscDividerHStackrscVStackrscGridalpha, rsc
Feedback
AlertProgressSpinnerToast
Data Display
BadgeCardrscTablealpha
Forms
ButtonCheckboxFormControlInputLinkPressableRadioSelectSliderSwitchTextarea
Overlay
AlertDialogDrawerMenuModalPopoverPortalTooltip
Disclosure
ActionsheetAccordionBottomSheetalpha
Media And Icons
AvatarImageIconrsc
Others
FabSkeletonalpha, rsc
Hooks
useBreakPointValue
useMediaQuery
Apps
Dashboard App
Kitchensink App
Todo App
Starter Kit
MCP Server
MCP Server
Guides
Recipes
LinearGradient
Tutorials
Building Ecommerce App
More
Upgrade to v2Upgrade to v3FAQsReleasesRoadmapTroubleshootingDiscord FAQs

Drawer

Implement a responsive Drawer component in React & React Native for navigation and content display. Learn how to install, customize, and integrate it into your project. This is an illustration of Drawer component.
size
anchor

Installation

Run the following command:

npx gluestack-ui add drawer

API Reference

To use this component in your project, include the following import statement in your file.
import {
  Drawer,
  DrawerBackdrop,
  DrawerContent,
  DrawerHeader,
  DrawerCloseButton,
  DrawerBody,
  DrawerFooter,
} from '@/components/ui/drawer';
anatomy-imageanatomy-image
export default () => (
  <Drawer>
    <DrawerBackdrop />
    <DrawerContent>
      <DrawerHeader>
        <DrawerCloseButton></DrawerCloseButton>
      </DrawerHeader>
      <DrawerBody />
      <DrawerFooter />
    </DrawerContent>
  </Drawer>
);

Component Props

This section provides a comprehensive reference list for the component props, detailing descriptions, properties, types, and default behavior for easy project integration.

Drawer

Contains all View related layout style props and actions. It inherits all the properties of React Native's
View
component.
PropTypeDefaultDescription
isOpen
boolean-If true, the drawer will open. Useful for controllable state behavior.
onClose
() => any-Callback invoked when the drawer is closed.
defaultIsOpen
boolean-Specifies the default open state of the Drawer
initialFocusRef
React.RefObject<any>-The ref of element to receive focus when the drawer opens.
finalFocusRef
React.RefObject<any>-The ref of element to receive focus when the drawer closes
avoidKeyboard
boolean-If true, the Drawer will avoid the keyboard.
closeOnOverlayClick
boolean-If true, the Drawer will close when the overlay is clicked.
isKeyboardDismissable
boolean-If true, the keyboard can dismiss the Drawer
children
any-The content to display inside the Drawer

DrawerBackdrop

It is React Native's
Pressable
component, created using
@legendapp/motion's
createMotionAnimatedComponent
function to add animation to the component. You can use any declarative animation library you prefer.

DrawerContent

It is
@legendapp/motion's
Motion.View
component. You can use any declarative animation library you prefer.
PropTypeDefaultDescription
focusable
booleanfalseIf true, Drawer Content will be focusable.

DrawerHeader

It inherits all the properties of React Native's
View
component.

DrawerCloseButton

It inherits all the properties of React Native's
View
component.

DrawerBody

It inherits all the properties of React Native's
View
component

DrawerFooter

It inherits all the properties of React Native's
View
component.

Props

Modal component is created using View component from react-native. It extends all the props supported by
React Native View
,
utility props
and the props mentioned below.

Modal

NameValueDefault
size
xs | sm | md | lg | fullsm
anchor
left | right | top | bottomleft

Examples

The Examples section provides visual representations of the different variants of the component, allowing you to quickly and easily determine which one best fits your needs. Simply copy the code and integrate it into your project.

Filter

Sidebar Menu

Edit this page on GitHub
Go backAlertDialog
Up nextMenu
Go backAlertDialog
Up nextMenu