1.0.15 • Published 1 year ago

react-drag-bottom-sheet v1.0.15

Weekly downloads
-
License
ISC
Repository
-
Last release
1 year ago

Installation

npm i react-drag-bottom-sheet

Live Demo

Props

PropsDescription
childrenContent displayed under the bottom sheet.
isOpenSpecifies if the bottom sheet is open by default.
shouldCloseOnOverlayClickCloses the bottom sheet when clicking on the overlay.
shouldCloseOnEscCloses the bottom sheet when pressing the escape key.
overlayClassNameAdds a class name to the overlay.
onAfterCloseCallback function executed after the bottom sheet closes.
classNameAdds a class name to the bottom sheet's parent element.
maxHeightDefault maxHeight 50%

Example

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;
1.0.15

1 year ago

1.0.14

1 year ago

1.0.13

1 year ago

1.0.12

1 year ago

1.0.11

1 year ago

1.0.10

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago