ReactJS Blueprint Drawer Component Last Updated : 08 Apr, 2022 Comments Improve Suggest changes Like Article Like Report BlueprintJS is a React-based UI toolkit for the web. This library is very optimized and popular for building interfaces that are complex data-dense for desktop applications. The Drawer component is a panel that slides in from the edge of the screen. It overlay content over existing parts of the UI. We can use the following approach in ReactJS to use the ReactJS Blueprint Drawer Component. Drawer Props: autoFocus: It is used to indicate whether the overlay should acquire application focus when it first opens.backdropClassName: It is used to denote the CSS class names to apply to the backdrop element.backdropProps: It is used to denote the HTML props for the backdrop element.canEscapeKeyClose: It is used to indicate whether pressing the esc key should invoke onClose or not.canOutsideClickClose: It is used to indicate whether clicking outside the overlay element should invoke onClose or not.className: It is used to denote the space-delimited list of class names to pass along to a child element.enforceFocus: It is used to indicate whether the overlay should prevent focus from leaving itself or not.hasBackdrop: It is used to indicate whether a container-spanning backdrop element should be rendered behind the contents or not.icon: It is used to denote the name of an icon or an icon element to render in the drawer's header.isCloseButtonShown: It is used to indicate whether to show the close button in the dialog's header or not.isOpen: It is used to denote the visibility of the overlay and its children.lazy: It is used to denote the portal containing the children is created and attached to the DOM when the overlay is opened for the first time if this is set to true and usePortal={true}.onClose: It is used to denote a callback function that is triggered when user interaction causes the overlay to close, such as clicking on the overlay or pressing the esc key.onClosed: It is used to denote the lifecycle method invoked just after the CSS close transition ends but before the child has been removed from the DOM.onClosing: It is used to denote the lifecycle method invoked just before the CSS close transition begins on a child. Receives the DOM element of the child being closed.onOpened: It is used to denote the lifecycle method invoked just after the CSS open transition ends.onOpening: It is used to denote the lifecycle method invoked just after mounting the child in the DOM but just before the CSS open transition begins.portalClassName: It is used to denote the space-delimited string of class names applied to the Portal element if usePortal={true}.portalContainer: It is used to denote the container element into which the overlay renders its contents when usePortal is true.position: It is used for the Position of a drawer.shouldReturnFocusOnClose: It is used to indicate whether the application should return focus to the last active element in the document after this drawer closes.size: It is used to denote the CSS size of the drawer.style: It is used to denote the CSS styles to apply to the dialog.title: It is used to denote the title of the dialog.transitionDuration: It is used to indicate how long the overlay's enter/leave transition takes in milliseconds.transitionName: It is used to denote the name of the transition for internal CSSTransition.usePortal: It is used to indicate whether the overlay should be wrapped in a Portal.vertical: It is used to indicate whether the drawer should appear with vertical styling. Creating React Application And Installing Module: Step 1: Create a React application using the following command: npx create-react-app foldername Step 2: After creating your project folder i.e. foldername, move to it using the following command: cd foldername Step 3: After creating the ReactJS application, Install the required module using the following command: npm install @blueprintjs/core Project Structure: It will look like the following. Project StructureExample: Now write down the following code in the App.js file. Here, App is our default component where we have written our code. App.js import React from 'react' import '@blueprintjs/core/lib/css/blueprint.css'; import { Drawer, Classes } from "@blueprintjs/core"; function App() { return ( <div style={{ display: 'block', width: 400, padding: 30 }}> <h4>ReactJS Blueprint Drawer Component</h4> <Drawer isOpen={true} icon="info-sign" title="Drawer Title" > <div className={Classes.DRAWER_BODY}> <div className={Classes.DIALOG_BODY}> <p>I am sample body text!!</p> </div> </div> <div className={Classes.DRAWER_FOOTER}>Drawer Footer</div> </Drawer> </div > ); } export default App; Step to Run Application: Run the application using the following command from the root directory of the project: npm startOutput: Now open your browser and go to http://localhost:3000/, you will see the following output: Reference: https://blueprintjs.com/docs/#core/components/drawer Comment More infoAdvertise with us Next Article ReactJS Blueprint Drawer Component gouravhammad Follow Improve Article Tags : JavaScript Web Technologies ReactJS React-Blueprint Blueprint-Core Blueprint-Overlays +2 More Similar Reads ReactJS Blueprint Divider Component BlueprintJS is a React-based UI toolkit for the web. This library is very optimized and popular for building interfaces that are complex data-dense for desktop applications. Divider Component provides a way for users to visually separate contents with a thin line and margin on all sides. We can use 2 min read ReactJS Blueprint Label Component BlueprintJS is a React-based UI toolkit for the web. This library is very optimized and popular for building interfaces that are complex data-dense for desktop applications. Label Component provides a way for users to enhance the usability of their forms. We can use the following approach in ReactJS 2 min read ReactJS Blueprint Portal Component BlueprintJS is a React-based UI toolkit for the web. This library is very optimized and popular for building interfaces that are complex data-dense for desktop applications. Portal Component renders its children into a new subtree outside the current component hierarchy. We can use the following app 2 min read ReactJS Blueprint Navbar Component BlueprintJS is a React-based UI toolkit for the web. This library is very optimized and popular for building interfaces that are complex data-dense for desktop applications. Navbar Component provides a way for users to provide them navigation controls at the top of an application. We can use the fol 3 min read ReactJS Blueprint Dialog Component BlueprintJS is a React-based UI toolkit for the web. This library is very optimized and popular for building interfaces that are complex data-dense for desktop applications. Dialog Component allows the user to show content on top of an overlay that requires user interaction. We can use the following 7 min read ReactJS Blueprint NonIdealState Component BlueprintJS is a React-based UI toolkit for the web. This library is very optimized and popular for building interfaces that are complex data-dense for desktop applications. NonIdealState Component provides a way for users to inform the user that some content is unavailable. We can use the following 2 min read ReactJS Blueprint Tag Component BlueprintJS is a React-based UI toolkit for the web. This library is very optimized and popular for building interfaces that are complex data-dense for desktop applications. Tag Component is used for categorizing or markup. Tags are great for lists of strings. We can use the following approach in Re 3 min read ReactJS Blueprint Card Component BlueprintJS is a React-based UI toolkit for the web. This library is very optimized and popular for building interfaces that are complex data-dense for desktop applications. Card Component is used as a simple rectangular container, and it is used when the user wants to display content related to a s 2 min read ReactJS Blueprint Tabs Component BlueprintJS is a React-based UI toolkit for the web. This library is very optimized and popular for building interfaces that are complex data-dense for desktop applications. Tabs Component allows the user to switch between components present in given different tabs. We can use the following approach 3 min read Like