wldyslw / react-bottom-sheet

React component for iOS- and Android-like bottom sheet
https://wldyslw.github.io/react-bottom-sheet/
MIT License
9 stars 1 forks source link
bottom-sheet bottomsheet drawer gesture modal pnpm popup react sheet tailwindcss ux vite

React Bottom Sheet Component

npm
(scoped) npm bundle size
(scoped) npm bundle size
(scoped)

Screenshot of sheet's example usage

Getting Started

  1. Install the package:
pnpm install @wldyslw/react-bottom-sheet
  1. Use it:
import { useRef } from 'react';
import BottomSheet from '@wldyslw/react-bottom-sheet';
// don't forget styles! If you use TailwindCSS, you can include package to config.content and save even more precious kilobytes!
import '@wldyslw/react-bottom-sheet/lib/style.css';

function App() {
    const sheetRef = useRef(null);

    return (
        <>
            <button onClick={() => sheetRef.current?.open()}>Open Sheet</button>
            <BottomSheet ref={sheetRef}>Hello!</BottomSheet>
        </>
    );
}

Docs

You can check API Reference as well as examples at official docs page

License

MIT