1.1.0 • Published 11 months ago
snap-react-drawer v1.1.0
snap-react-drawer
As easy as your fingers snap drawer using createPortal.
!!!Demo: https://snap-components.netlify.app/?path=/story/snap-drawer--basic
Install
npm install snap-react-drawer
As easy as your fingers snap 👌
<Drawer isOpen={isOpen} onClose={() => setOpen(false)}>
This is so easy!
</Drawer>Simply modify styles and control dimensions
import Drawer from "snap-react-drawer";
function App() {
const [isOpen, setOpen] = React.useState(false);
return (
<div className="App">
<button onClick={() => setOpen(true)}>Open Drawer</button>
<Drawer
isOpen={isOpen}
onClose={() => setOpen(false)}
overlayClassName="overlayStyles" // this class modifies overlay styles
bodyClassName="drawerStyles" // and this modifies drawer container
size={300} // easy to control dimensions
>
Still so easy!
</Drawer>
</div>
);
}Props
isOpen: defines if the drawer open or not (required)onClose: to close the drawer (required)size: defines the width or height of the drawer depending on its positionoverlayClassName: overrides overlay of the drawer (note: please use!importantproperty in your css to make sure styles will apply)bodyClassName: overrides body of the drawer (note: please use!importantproperty in your css to make sure styles will apply)closeButton: defines if the default close button is showingcloseOnClickOutside: defines if the drawer is closable on outside clickposition: defines position of the drawerduration: defines transition duration of the drawerenableOverlay: defines if overlay of the drawer is enabled
1.1.0
11 months ago
1.0.18
11 months ago
1.0.17
11 months ago
1.0.16
11 months ago
1.0.9
11 months ago
1.0.8
11 months ago
1.0.7
11 months ago
1.0.6
11 months ago
1.0.5
11 months ago
1.0.4
11 months ago
1.0.11
11 months ago
1.0.10
11 months ago
1.0.15
11 months ago
1.0.14
11 months ago
1.0.13
11 months ago
1.0.12
11 months ago
1.0.3
2 years ago
1.0.2
2 years ago
1.0.1
2 years ago
1.0.0
3 years ago