# Drawer Drawer slides into view from the edge of the screen to display additional content, navigation, or actions. It keeps the primary interface uncluttered while providing quick access to secondary information. **Category:** Components **Storybook:** https://doc.ux4g.gov.in/web/?path=/story/ux4g-components-drawer--introduction ## Variants documented in Storybook - Drawer Variants: https://doc.ux4g.gov.in/web/?path=/story/ux4g-components-drawer--drawer-variants ## Framework setup ### HTML / CDN ```html ``` ### React ```bash npm install ux4g-web-components ``` ```jsx import 'ux4g-web-components/styles.css'; import 'ux4g-web-components/design-system'; ``` ### Angular Update `angular.json`: ```json { "styles": [ "node_modules/ux4g-web-components/styles/ux4g.css", "src/styles.css" ], "scripts": [ "node_modules/ux4g-web-components/dist/runtime/design-system.js" ] } ``` ## Code examples The snippets below are extracted from the Storybook canvas for Drawer. Each example shows the rendered HTML, the equivalent React JSX, and the Angular template markup. ### 1. Drawer Variants — Top Drawer HTML: ```html
``` React: ```jsx import React from 'react'; const DrawerExample1Demo = () => ( <> {/* Variant: Drawer Trigger - Top */} {/* Variant: Drawer Panel - Top */}Drawer slides into view from the edge of the screen to display additional content, navigation, or actions. It keeps the primary interface uncluttered while providing quick access to secondary information.
Utility classes for drawer positioning and structure.
|
Top Drawer
ux4g-drawer-top
|
|
Right Drawer
ux4g-drawer-right
|
|
Bottom Drawer
ux4g-drawer-bottom
|
|
Left Drawer
ux4g-drawer-left
|
|
Overlay
ux4g-drawer-overlay
|
|
Header
ux4g-drawer-header
|
|
Body Content
ux4g-drawer-body
|
|
Footer Actions
ux4g-drawer-footer
|
Drawer slides into view from the edge of the screen to display additional content, navigation, or actions. It keeps the primary interface uncluttered while providing quick access to secondary information.
Utility classes for drawer positioning and structure.
|
Top Drawer
ux4g-drawer-top
|
|
Right Drawer
ux4g-drawer-right
|
|
Bottom Drawer
ux4g-drawer-bottom
|
|
Left Drawer
ux4g-drawer-left
|
|
Overlay
ux4g-drawer-overlay
|
|
Header
ux4g-drawer-header
|
|
Body Content
ux4g-drawer-body
|
|
Footer Actions
ux4g-drawer-footer
|
Drawer slides into view from the edge of the screen to display additional content, navigation, or actions. It keeps the primary interface uncluttered while providing quick access to secondary information.
Utility classes for drawer positioning and structure.
|
Top Drawer
ux4g-drawer-top
|
|
Right Drawer
ux4g-drawer-right
|
|
Bottom Drawer
ux4g-drawer-bottom
|
|
Left Drawer
ux4g-drawer-left
|
|
Overlay
ux4g-drawer-overlay
|
|
Header
ux4g-drawer-header
|
|
Body Content
ux4g-drawer-body
|
|
Footer Actions
ux4g-drawer-footer
|