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

Package detail

react-smooth-sheet

HosseinAzadpour29MIT0.3.2

A customizable bottom sheet component for React applications.

react, bottom sheet, bottom drawer, slide panel, swipeable sheet, modal sheet, react component, overlay, customizable blur, customizable opacity, customizable sheet, responsive design, mobile-friendly, smooth animations, UI component, draggable sheet, react UI, touch interaction, sheet overlay, pop-up panel, user-friendly, modern web

readme

TimePicker Demo

🎛️ BottomSheet

A fully responsive and highly customizable bottom sheet component for React applications, designed to provide smooth interactions, seamless animations, and an intuitive user experience. Easily adaptable to various use cases, it supports gesture-based controls, dynamic styling, and effortless integration into any project.

Table of Contents

Installation

You can install the package using npm or yarn:

npm install react-smooth-sheet

or

yarn add react-smooth-sheet

Introduction

BottomSheet is a highly versatile and intuitive React component built to deliver a seamless and interactive bottom sheet experience. Designed with flexibility in mind, it offers extensive customization options, smooth animations, and gesture-based interactions. Whether used for modals, action sheets, or additional UI elements, BottomSheet ensures effortless integration while maintaining optimal performance and responsiveness across all devices.

Key Features:

  • Responsive Design: Adapts to various screen sizes and devices.
  • Customizable Colors: Easily change the color scheme to match your app.
  • Smooth Animations: Enjoy smooth transitions and animations.

Features

  • Toggle visibility with a parent state.
  • Customize overlay opacity and blur.
  • Change the background color of the sheet.
  • Accept custom content as children.

What's New

v0.1.7

  • Reduce package size.
  • Cleaned up unused code .
  • Remove Webpack

v0.1.8

  • Created Custom Hooks.
  • Component-Based Refactoring.
  • Organized Files & Directories

v0.1.9

  • Bugs Fixed.

For more details, see CHANGELOG.md.

Example

import React, { useState } from "react";
import BottomSheet from "react-smooth-sheet";

function App() {
  const [isOpen, setIsOpen] = useState(false);

  return (
    <div className='App'>
      <button onClick={() => setIsOpen(true)}>Open BottomSheet</button>
      <BottomSheet
        isOpen={isOpen}
        sendDataToParent={(open) => setIsOpen(open)}
        overlayDark={1}
        overlayBlur={2}
        backgroundColor={"lightGray"}
      >
        <div style={{ display: "flex", flexDirection: "column" }}>
          <div>Your content </div>
        </div>
      </BottomSheet>
    </div>
  );
}

export default App;

props

Prop Type Default Description
sendDataToParent function false Function to send the state to the parent component.
isOpen boolean false Determines if the bottom sheet is open or closed.
overlayDark number 0 Sets the opacity of the overlay.
overlayBlur number 2 Sets the blur effect for the overlay.
backgroundColor string "lightGray" Sets the background color of the bottom sheet.

API

Functions

  • BottomSheetShow(): Shows the BottomSheet.
  • BottomSheetHide(): Hides the BottomSheet.

Events

  • onTouchStart: Detects the touch start event.
  • onTouchMove: Detects the touch move event.
  • onTouchEnd: Detects the touch end event.

Tips and Tricks

Ensure the isOpen prop is managed by the parent component to control the visibility.
Use the sendDataToParent function to update the parent state when the BottomSheet is closed.

FAQ

Q: How can I customize the BottomSheet?
A: You can customize it using the props provided like overlayOpacity, overlayBlur, and backgroundColor.
Q: How do I close the BottomSheet?
A: Use the sendDataToParent function to change the state in the parent component.

Contributing

Contributions are welcome! Please create an issue or a pull request.

Contact Information

For any questions or feedback, please contact me via:

Email: [hossein.azp94@gmail.com]

LinkedIn: [https://www.linkedin.com/in/hosseinazadpour]

License

This project is licensed under the MIT License - see the LICENSE file for details.

https://github.com/HosseinAzadpour/react-smooth-sheet

changelog

Changelog

[0.1.7] - 2025-03-03

Fixed

  • Resolved multiple bugs that could cause crashes in specific scenarios.
  • Improved error handling to enhance stability.

Removed

  • Eliminated unnecessary dependencies to reduce package size.
  • Cleaned up unused code and redundant functions.
  • Remove Webpack

[0.1.8] - 2025-12-03

Fixed

  • The bottom sheet's blur and opacity effects by handling them dynamically in.
  • The touch-based closing logic using useBottomSheetTouch to ensure smoother interactions.

Removed

  • Redundant inline styling and moved styles to external CSS files.
  • Unnecessary code duplications by centralizing logic in hooks.

Improved

  • Code readability and maintainability by splitting the logic into multiple components.
  • Reusability by extracting repeated logic into custom hooks.
  • Styling organization by creating a styles folder for CSS files.
  • Function organization by categorizing them into separate files.

[0.1.9] - 2025-12-03

Fixed

  • Bugs Fixed.

[0.3.2] - 2025-12-03

Fixed

  • Bugs Fixed.