Installations
npm install react-modern-drawer
Developer Guide
Typescript
Yes
Module System
CommonJS
Node Version
20.15.1
NPM Version
10.7.0
Score
96.7
Supply Chain
99.5
Quality
78.3
Maintenance
100
Vulnerability
100
License
Releases
Contributors
Unable to fetch Contributors
Languages
TypeScript (72%)
HTML (15.3%)
CSS (9.45%)
JavaScript (3.25%)
Love this project? Help keep it running — sponsor us today! 🚀
Developer
Download Statistics
Total Downloads
3,650,031
Last Day
1,168
Last Week
31,934
Last Month
124,853
Last Year
1,524,412
GitHub Statistics
MIT License
222 Stars
54 Commits
25 Forks
2 Watchers
6 Branches
5 Contributors
Updated on Feb 06, 2025
Bundle Size
1.98 kB
Minified
983.00 B
Minified + Gzipped
Package Meta Information
Latest Version
1.4.0
Package Id
react-modern-drawer@1.4.0
Unpacked Size
38.11 kB
Size
7.50 kB
File Count
9
NPM Version
10.7.0
Node Version
20.15.1
Published on
Aug 12, 2024
Total Downloads
Cumulative downloads
Total Downloads
3,650,031
Last Day
-11.6%
1,168
Compared to previous day
Last Week
4.3%
31,934
Compared to previous week
Last Month
13.6%
124,853
Compared to previous month
Last Year
-9.8%
1,524,412
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Peer Dependencies
1
Dev Dependencies
27
react-modern-drawer
creating drawers made easy!
Low bundle size with fantastic performance
Demo 💻🔥
Browsers support
![]() IE / Edge | ![]() Firefox | ![]() Chrome | ![]() Safari | ![]() iOS Safari | ![]() Samsung | ![]() Opera |
---|---|---|---|---|---|---|
All | All | All | All | All | All | All |
Install
1npm install --save react-modern-drawer
or if you are using yarn :
1yarn add react-modern-drawer
Usage
1import React from 'react' 2 3// import component 👇 4import Drawer from 'react-modern-drawer' 5 6//import styles 👇 7import 'react-modern-drawer/dist/index.css' 8 9const App = () => { 10 const [isOpen, setIsOpen] = React.useState(false) 11 const toggleDrawer = () => { 12 setIsOpen((prevState) => !prevState) 13 } 14 15 return ( 16 <> 17 <button onClick={toggleDrawer}>Show</button> 18 <Drawer 19 open={isOpen} 20 onClose={toggleDrawer} 21 direction='right' 22 className='bla bla bla' 23 > 24 <div>Hello World</div> 25 </Drawer> 26 </> 27 ) 28} 29 30export default App
API
api | type | required | default | value | desciption |
---|---|---|---|---|---|
direction | string | yes | "right" | "right" , "left" , "top","bottom" | Selecting the direction that drawer opens |
open | boolean | yes | false | true , false | Select when to show drawer |
onClose | function | no | ( )=>{ } | any executable function | This function is called when clicking on backdrop layer usually used for closing the drawer |
size | number or string | no | 250 | integer or '{integer}px' or '{integer}vw' | Determines the size of drawer |
style | React.CSSProperties | no | null | Normal stylings | Can be used for inline styles |
duration | number | no | 300 | Any positive Integer | Determines the duration of opening the drawer |
overlayOpacity | number | no | 0.4 | Number between 0 and 1 | Determines the opacity of overlay |
overlayColor | string | no | "#000" | Any color code | Determines the color of overlay |
enableOverlay | boolean | no | true | true , false | Determines whether to show the overlay |
zIndex | number | no | 100 | Any positive Integer | Determines the zIndex of drawer |
children | React.ReactNode | no | null | Any ReactNode | This is the same as props.children |
className | string | no | undefined | - | normal regular classNames and stuff |
overlayClassName | string | no | undefined | - | normal regular classNames and stuff |
customIdSuffix | string | no | A random string based on Math.random() | - | Used for making different ids for drawers, can be customized for special cases. |
lockBackgroundScroll | boolean | no | false | - | Locks the body scroll when drawer is open. |
Support
If you like this package please consider giving it a star.
Contribution
clone the project and run yarn install
then run yarn start
to run the main project.
then cd example
and run yarn start
to start the development example in order to test the component.
any PRs are welcome!
License
MIT © Farzin-Firoozi

No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
Found 4/18 approved changesets -- score normalized to 2
Reason
0 commit(s) and 3 issue activity found in the last 90 days -- score normalized to 2
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 22 are checked with a SAST tool
Reason
52 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92
- Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw
- Warn: Project is vulnerable to: GHSA-fwr7-v2mv-hh25
- Warn: Project is vulnerable to: GHSA-qwcr-r2fm-qrc7
- Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg
- Warn: Project is vulnerable to: GHSA-w8qv-6jwh-64r5
- Warn: Project is vulnerable to: GHSA-pxg6-pf52-xh8x
- Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275
- Warn: Project is vulnerable to: GHSA-3wcq-x3mq-6r9p
- Warn: Project is vulnerable to: GHSA-phwq-j96m-2c2q
- Warn: Project is vulnerable to: GHSA-ghr5-ch3p-vcr6
- Warn: Project is vulnerable to: GHSA-rv95-896h-c2vc
- Warn: Project is vulnerable to: GHSA-qw6h-vgh9-j6wx
- Warn: Project is vulnerable to: GHSA-74fj-2j2h-c42q
- Warn: Project is vulnerable to: GHSA-pw2r-vq6v-hr8c
- Warn: Project is vulnerable to: GHSA-jchw-25xp-jwwc
- Warn: Project is vulnerable to: GHSA-cxjh-pqwp-8mfp
- Warn: Project is vulnerable to: GHSA-c7qv-q95q-8v27
- Warn: Project is vulnerable to: GHSA-78xj-cgh5-2h22
- Warn: Project is vulnerable to: GHSA-2p57-rm9w-gvfp
- Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h
- Warn: Project is vulnerable to: GHSA-76p3-8jx3-jpfq
- Warn: Project is vulnerable to: GHSA-3rfm-jhwj-7488
- Warn: Project is vulnerable to: GHSA-hhq3-ff78-jv3g
- Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9
- Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm
- Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv
- Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3
- Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h
- Warn: Project is vulnerable to: GHSA-mwcw-c2x4-8c55
- Warn: Project is vulnerable to: GHSA-2r2c-g63r-vccr
- Warn: Project is vulnerable to: GHSA-cfm4-qjh2-4765
- Warn: Project is vulnerable to: GHSA-x4jg-mjrx-434g
- Warn: Project is vulnerable to: GHSA-rp65-9cf3-cjxr
- Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9
- Warn: Project is vulnerable to: GHSA-9wv6-86v2-598j
- Warn: Project is vulnerable to: GHSA-rhx6-c78j-4q9w
- Warn: Project is vulnerable to: GHSA-7fh5-64p2-3v2j
- Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp
- Warn: Project is vulnerable to: GHSA-gcx4-mw62-g8wm
- Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw
- Warn: Project is vulnerable to: GHSA-m6fv-jmcg-4jfg
- Warn: Project is vulnerable to: GHSA-cm22-4g7w-348p
- Warn: Project is vulnerable to: GHSA-4wf5-vphf-c2xc
- Warn: Project is vulnerable to: GHSA-jgrx-mgxx-jf9v
- Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3
- Warn: Project is vulnerable to: GHSA-hc6q-2mpp-qw7j
- Warn: Project is vulnerable to: GHSA-4vvj-4cpr-p986
- Warn: Project is vulnerable to: GHSA-wr3j-pwj9-hqq6
- Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7
- Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q
- Warn: Project is vulnerable to: GHSA-566m-qj78-rww5
Score
2.6
/10
Last Scanned on 2025-02-10
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn MoreOther packages similar to react-modern-drawer
@jamsr-ui/drawer
A modern and beautiful Next.js UI components library.
@cisseui/react-components
Modern React UI components including Table, Modal, and Drawer
expo-drawer
The Animated Drawer Menu is a versatile navigation component designed to enhance user interaction with sleek and dynamic animations. It features four built-in animations, including sliding, fading, scaling, and bouncing effects, providing a modern and eng
slick-bottom-sheet
Modern bottom sheet component for React, built with Framer Motion.