.d.ts
file with prop and ref types included!pnpm install @wldyslw/react-bottom-sheet
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>
</>
);
}
You can check API Reference as well as examples at official docs page
MIT