An open API service indexing awesome lists of open source software.

https://github.com/ha1fstack/slick-bottom-sheet

Modern bottom sheet component for React, built with Framer Motion.
https://github.com/ha1fstack/slick-bottom-sheet

Last synced: about 2 months ago
JSON representation

Modern bottom sheet component for React, built with Framer Motion.

Awesome Lists containing this project

README

        

# Slick Bottom Sheet

Modern bottom sheet component for React, built with [Framer Motion](https://github.com/framer/motion).

## Introduction

Slick Bottom Sheet is a bottom sheet component with buttery smooth animation and user friendly interactions for React. The gestures and animations are handled with Framer Motion. It aims to provide a simple and flexible API that works out of the box, with minimal dependencies.

## Install

This package requires framer-motion as a peer dependency.

```bash
npm install slick-bottom-sheet
yarn add slick-bottom-sheet
pnpm install slick-bottom-sheet
```

## Demo

[slick-bottom-sheet.vercel.app](https://slick-bottom-sheet.vercel.app/)

or clone the repo and run the `./example` Next.JS app locally.

## API Reference

For now, please refer to JSDoc and demo source code.

## Example

```tsx
"use client";

import React from "react";
import { SlickBottomSheet, SlickBottomSheetControl } from "slick-bottom-sheet";

export default function Page() {
const [isOpen, setIsOpen] = React.useState(false);
const ref = React.useRef(null);

React.useEffect(() => {
setIsOpen(true);
}, []);

return (
<>


{
console.log("open");
setIsOpen(true);
}}
>
Open


{
setIsOpen(false);
}}
ref={ref}
onSnap={console.log}
className="bg-white rounded-t-2xl overflow-hidden shadow-xl z-10 isolate border"
header={



}
footer={

ref.current?.snapTo("close")}
className="w-full bg-indigo-600 py-2 font-medium text-white rounded"
>
Dismiss


}
backdropClassName="backdrop-blur-sm bg-black bg-opacity-10"
>



Hello There!



This is a sheet demo with default breakpoint ["auto"].


You can drag the sheet or backdrop to control the sheet.






>
);
}
```

## To Do

- [ ] More exposed options
- [ ] Add testings
- [ ] Add more examples
- [ ] Improve docs
- [ ] Better A11Y support