jss-keyframes

Helper for generating keyframes with a unique id in jss

Usage no npm install needed!

<script type="module">
  import jssKeyframes from 'https://cdn.skypack.dev/jss-keyframes';
</script>

README

jss-keyframes

Helper for generating keyframes with a unique id in jss

Installation

yarn add jss-keyframes

Usage

import keyframes from 'jss-keyframes';

const animationName = keyframes({
  from: { transform: 'scale(1)' },
  to: { transform: 'scale(0)' },
});

The keyframes function return the name of the animation.

Options

The keyframes function accepts a second object for some options.

type Options = {
  // Jss instance to be used
  // It will generate a separate stylesheet for every instance
  jss: Jss
  // A name to better identify the animation
  // Example: { name: 'button' } would return button-1
  // This option will default to animation 
  name: string
}