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-simple-bottom-sheet

v1.0.1-readme

Published

A simple bottom sheet component for your React apps - **best for PWAs** ๐Ÿ”ฅ

Downloads

176

Readme

React Simple Bottom Sheet ๐ŸŽ‰

A simple bottom sheet component for your React apps - best for PWAs ๐Ÿ”ฅ

Preview

Installation ๐Ÿš€

This library is built with framer-motion and styled-components therefore you have to install first these two dependencies on your project.

npm install framer-motion styled-components or yarn add framer-motion styled-components

then

npm install react-simple-bottom-sheet or yarn add react-simple-bottom-sheet

Sample Usage ๐Ÿ’ป

import React from "react";
import { bottomSheet } from "react-simple-bottom-sheet";

export  default  function App() {
    const handleOpen = () => bottomSheet.create({
	    content: (<p>Hello world!</p>),
    });
    return <button onClick={handleOpen}>Open</button>
}

You can check example/src folder to know more!

API ๐Ÿ‘‹

  • bottomSheet.create(createConfig)
  • bottomSheet.close(closeConfig)
  • bottomSheet.isOpen(id)

The properties of config are as follows:

create({...})

| Property | Description | Type | Default | | ------------ | --------------------------------------- | ------------------------------------------------------------------------------------------ | -------------------- | | id | Unique identifier of the bottom sheet | string | "default" | | content | Main content of bottom sheet (required) | ReactNode | - | | header | Header content of bottom sheet | ReactNode | - | | footer | Footer content of bottom sheet | ReactNode | - | | dragHandle | Draggable elements of bottom sheet | ['content' \| 'header \| 'footer' \| 'mask'] | ['header', 'mask'] | | onClose | function | Trigger when bottom sheet is closed | - | | onOpen | function | Trigger when bottom sheet is opened | - | | darkMode | boolean | Changes the appearance of bottom sheet to dark mode | false | | maskClosable | boolean | Whether to close the modal dialog when the mask (area outside the bottom sheet) is clicked | true | | debug | boolean | Enables debug mode to show the draggable areas | false |

close({...})

| Property | Description | Type | Default | | -------- | --------------------------------------------------------------------------- | -------- | ----------- | | id | Unique identifier of the bottom sheet that needs to be closed | string | "default" | | callback | Specifies the function that will be called after the bottom sheet is closed | function | - |

isOpen(id)

| Property | Description | Type | Default | | -------- | ---------------------------------------------------------------------------- | ------ | ----------- | | id | Unique identifier of the bottom sheet that needs to be checked if it's open. | string | "default" |

Note ๐Ÿ—’

Putting clickable elements such as Buttons, Inputs, etc. on draggable areas is not possible as of the moment - still working on it.

Donation ๐Ÿ™

If this project help you reduce time to develop, you can give me a cup of โ˜•๏ธ or โ˜•๏ธ :)

Paypal donate button

License ๐Ÿ™Œ

Copyright (c) 2021 chcepe.github.io

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.