npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

react-smooth-sheet

v0.1.6

Published

A customizable bottom sheet component for React applications.

Downloads

27

Readme

BottomSheet

A responsive and customizable bottom sheet component for React applications.

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 versatile and user-friendly React component designed to provide a smooth bottom sheet experience. With customizable options, BottomSheet ensures a seamless integration into your project.

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.

Interactive Demo

TimePicker Demo

Features

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

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: [[email protected]]

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

License

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

Links

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