Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

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.

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)