1.5.2 • Published 1 year ago

mounty v1.5.2

Weekly downloads
49
License
MIT
Repository
github
Last release
1 year ago

mounty npm npm.io

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.

import { Mounty } from "mounty";

function App() {
  const [active, setActive] = React.useState(false);

  return (
    <>
      <button onClick={() => setActive(!active)}>Click to Pin</button>

      <Mounty in={active} timeout={400} shouldUnmount>
        {({ active, ready, entering, entered, exiting, exited }) => {
          return (
            <div
              style={{
                opacity: ready ? 1 : 0,
                transition: "opacity 400ms",
              }}
            >
              I'm automatically mounted & unmounted, and I fade in and out while
              doing it!
            </div>
          );
        }}
      </Mounty>
    </>
  );
}

render(<App />, document.getElementById("root"));

License

MIT License © Truework

1.5.2

1 year ago

1.5.1

2 years ago

1.5.0

2 years ago

1.4.0

2 years ago

1.2.0

4 years ago

1.3.0

4 years ago

1.1.1

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago

0.1.0

4 years ago

0.0.2

5 years ago

0.0.1

5 years ago