5.1.6 • Published 5 months ago

@react-md/transition v5.1.6

Weekly downloads
2
License
MIT
Repository
github
Last release
5 months ago

@react-md/transition

Create simple CSS transitions using the provided transition hooks and components utilizing the default transition timing functions. This package also provides a collapse transition, scaling transition, vertical only scaling transition, and a new page transition named cross fade.

Provided components and hooks:

  • Collapse or useCollapseTransition - transition an element in and out of view based on the height of the element
  • CrossFade or useCrossFadeTransition - a transition generally used for a full page transition that fades and slightly moves a child component into view
  • ScaleTransition or useScaleTransition - transition an element in and out of view with a scale transform that can be updated to just be scaleY
  • useTransition - a hook implementation of the Transition component from react-transition-group
  • CSSTransition or useCSSTransition - allows for a CSS transition that was heavily inspired by react-transition-group
  • useFixedPositioning - hooks into the CSSTransition component from to fix an element to another element within the viewport

The rmd-transition-shadow-transition mixin allows you to "performantly" transition between two box shadow values using the opacity trick. This mixin automatically creates a pseudo ::before or ::after element with the final box shadow and animates the opacity once one of the $active-selectors are triggered. The code below will help explain this part a bit more.

Installation

npm install --save @react-md/transition

It is also recommended to install the following packages as they work hand-in-hand with this package:

npm install --save @react-md/theme \
  @react-md/utils

Documentation

You should check out the full documentation for live examples and more customization information, but an example usage is shown below.

Usage

import type { useState } from "react";
import { render } from "react-dom";
import { Button } from "@react-md/button";
import { Collapse } from "@react-md/transition";

const App = () => {
  const [collapsed, setCollapsed] = useState(true);

  return (
    <>
      <Button onClick={() => setCollapsed(!collapsed)}>Toggle</Button>
      <Collapse collapsed={collapsed}>
        <div>This is my collapsible content!</div>
      </Collapse>
    </>
  );
};

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

5 months ago

5.1.3

2 years ago

5.1.2

2 years ago

5.1.0

2 years ago

4.0.3

2 years ago

5.0.0

2 years ago

4.0.1

2 years ago

4.0.0

2 years ago

3.1.0

3 years ago

3.0.1

3 years ago

3.0.1-alpha.2

3 years ago

3.0.1-alpha.1

3 years ago

3.0.1-alpha.0

3 years ago

3.0.0

3 years ago

3.0.0-alpha.0

3 years ago

2.9.1

3 years ago

2.9.0

3 years ago

2.8.5

3 years ago

2.8.4

3 years ago

2.8.0

3 years ago

2.8.3

3 years ago

2.8.2

3 years ago

2.7.1

3 years ago

2.7.0

3 years ago

2.6.0

3 years ago

2.5.5

3 years ago

2.5.4

3 years ago

2.5.0

3 years ago

2.4.2

4 years ago

2.4.1

4 years ago

2.4.0

4 years ago

2.3.1

4 years ago

2.3.0

4 years ago

2.3.0-alpha.3

4 years ago

2.3.0-alpha.2

4 years ago

2.3.0-alpha.1

4 years ago

2.2.1

4 years ago

2.2.2

4 years ago

2.3.0-alpha.0

4 years ago

2.1.2

4 years ago

2.1.1

4 years ago

2.1.0

4 years ago

2.0.2

4 years ago

2.0.0

4 years ago

2.0.0-beta.2

4 years ago

2.0.0-beta.1

4 years ago

2.0.0-beta.0

4 years ago

2.0.0-alpha.15

4 years ago

2.0.0-alpha.14

4 years ago

2.0.0-alpha.13

4 years ago

2.0.0-alpha.12

4 years ago

2.0.0-alpha.11

4 years ago

2.0.0-alpha.10

5 years ago

2.0.0-alpha.9

5 years ago

2.0.0-alpha.8

5 years ago

2.0.0-alpha.7

5 years ago

2.0.0-alpha.6

5 years ago

2.0.0-alpha.5

5 years ago

2.0.0-alpha.4

5 years ago

2.0.0-alpha.3

5 years ago

2.0.0-alpha.1

5 years ago

2.0.0-alpha.0

5 years ago