react-framer-bottom-sheet
TypeScript icon, indicating that this package has built-in type declarations

0.1.92 • Public • Published

react-framer-bottom-sheet

framer

Installation

npm install react-framer-bottom-sheet

or

yarn add react-framer-bottom-sheet

Usage

import FramerBottomSheet from 'react-framer-bottom-sheet';
import { FramerBottomSheetRef } from 'react-framer-bottom-sheet/dist/sheetType';

function App() {
  const sheetRef = useRef < FramerBottomSheetRef > null;

  const buttonHandler = () => {
    sheetRef.current?.snapTo('bottom');
  };

  return (
    <div className="App">
      <button onClick={buttonHandler}>to bottom</button>
      <FramerBottomSheet
        initialPosition="top"
        ref={sheetRef}
        style={{ backgroundColor: '#FAFAFA' }}
        snapPoint={{ top: { height: 400 }, bottom: { height: 100 } }}
        bottomScrollLock
        headerElement={
          <div style={{ height: 50, backgroundColor: 'red' }}>header</div>
        }
        footerElement={
          <div style={{ height: 50, backgroundColor: 'green' }}>footer</div>
        }
      >
        <div style={{ height: 500, backgroundColor: 'blue' }}>Content</div>
      </FramerBottomSheet>
    </div>
  );
}

export default App;

Package Sidebar

Install

npm i react-framer-bottom-sheet

Weekly Downloads

2

Version

0.1.92

License

MIT

Unpacked Size

227 kB

Total Files

26

Last publish

Collaborators

  • parksunghyun