Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

react-drag-bottom-sheet

akshay-dholakiya28ISC1.0.15
react, akshay, akshay-dholakiya, akshay dholakiya, react-drag-bottom-sheet, react-web-bottom-sheet, web-drag-bottom-sheet, drag-botttom-sheet

readme

Installation

npm i react-drag-bottom-sheet

Live Demo

Props

Props Description
children Content displayed under the bottom sheet.
isOpen Specifies if the bottom sheet is open by default.
shouldCloseOnOverlayClick Closes the bottom sheet when clicking on the overlay.
shouldCloseOnEsc Closes the bottom sheet when pressing the escape key.
overlayClassName Adds a class name to the overlay.
onAfterClose Callback function executed after the bottom sheet closes.
className Adds a class name to the bottom sheet's parent element.
maxHeight Default maxHeight 50%

Example

`jsx static import React, { useRef } from 'react'; import ReactDragBottomSheet from "react-drag-bottom-sheet";

const App = () => { const ref = useRef(null) const open = () => { if(ref?.current) { ref?.current?.open() } };

return (
    <div className="App">
         <button onClick={open} className="open-button">
            Open Bottom Sheet
        </button>

        <ReactDragBottomSheet ref={ref}>
            <>
                <p> Bottom sheet children</p>
            </>
        </ReactDragBottomSheet>

    </div>
);

}; export default App;

`