API & PlaygroundReactuseBottomSheet

useBottomSheet

BottomSheet component is controlled by UseBottomSheetReturn(the return type of useBottomSheet), so they go hand-in-hand. Check out the UseBottomSheetReturn for use cases and examples.

Interface

useBottomSheet: (props: UseBottomSheetProps) => UseBottomSheetReturn;

Example

import { useState } from "react";
import { BottomSheet } from "@plainsheet/react";
 
export default function Home() {
  const bottomSheet = useBottomSheet({
    // props to control your Bottom Sheet.
  });
 
  return (
    <section>
      <BottomSheet {...bottomSheet.props}>Your content goes here</BottomSheet>
 
      <button onClick={bottomSheet.open}>Open</button>
    </section>
  );
}
;