Git Product home page Git Product logo

react-bottom-sheet's Introduction

React Bottom Sheet Component

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

Screenshot of sheet's example usage

  • ⚡ī¸ PERFORMANT: every motion is done purely with CSS transforms, providing near-native UX.
  • đŸĒļ LIGHTWEIGHT: ~3.5kb mifified UMD, ~2kb gziped. 0 dependencies.
  • 🧘 MINIMALISTIC: nothing redundant, yet everything you may need.
  • ⚙ī¸ TYPED: writen in TypeScript, so .d.ts file with prop and ref types included!

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

react-bottom-sheet's People

Contributors

wldyslw avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤ī¸ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.