Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/truework/mounty
A tiny React mount/unmount transition manager with a familiar API.
https://github.com/truework/mounty
Last synced: about 5 hours ago
JSON representation
A tiny React mount/unmount transition manager with a familiar API.
- Host: GitHub
- URL: https://github.com/truework/mounty
- Owner: truework
- Created: 2019-11-01T19:42:05.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2023-10-03T18:56:11.000Z (about 1 year ago)
- Last Synced: 2024-12-08T18:56:42.909Z (4 days ago)
- Language: TypeScript
- Homepage:
- Size: 1.42 MB
- Stars: 12
- Watchers: 9
- Forks: 0
- Open Issues: 14
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# mounty ![npm](https://img.shields.io/npm/v/mounty) [![](https://badgen.net/bundlephobia/minzip/mounty)](https://bundlephobia.com/result?p=mounty)
A tiny React transition manager with mount/unmount support and a familiar API.
### Install
```
npm i mounty --save
```# Usage
The code below is [demoed here](https://codesandbox.io/s/mounty-demo-4zgwp).
```javascript
import { Mounty } from "mounty";function App() {
const [active, setActive] = React.useState(false);return (
<>
setActive(!active)}>Click to Pin
{({ active, ready, entering, entered, exiting, exited }) => {
return (
I'm automatically mounted & unmounted, and I fade in and out while
doing it!
);
}}
>
);
}render(, document.getElementById("root"));
```### License
MIT License © [Truework](https://www.truework.com)