Giter VIP home page Giter VIP logo

pandacss-animate's Introduction

PandaCSS animate

PandaCSS Animate is a preset for Panda CSS designed to facilitate the creation of elegant animations within your projects.

Installation

Install PandaCSS Animate via npm:

npm install -D pandacss-animate

Then, integrate the preset into your panda.config.ts file as follows:

import { defineConfig } from "@pandacss/dev";
import pandaAnimate from "pandacss-animate";

export default defineConfig({
  theme: {
    extend: {},
  },
  presets: [pandaAnimate],
});

Usage

The preset offers utilities to enter and exit animations.

Enter animations

Avaible utilities fadeIn, slideInY, slideInX, spinIn, zoomIn, to enter animations to elements.

Exit animations

Avaible utilities fadeOut, slideOutY, slideOutX, spinOut, zoomOut, to exit animations to elements.

Fade

The fade animations include fadeIn and fadeOut, utilizing opacity tokens.

import { css } from "../styled-system/css";

<button
  className={css({
    fadeIn: "10",
  })}
>
  A fade transition
</button>;

Slide

Slide animations include slideInX, slideOutX, slideInY, and slideOutY, using spacing tokens to determine direction and distance.

import { css } from "../styled-system/css";

<button
  className={css({
    // slide from bottom
    slideInY: "10",

    // slide from top
    slideInY: "-10",

    // slide from right
    slideInX: "10",

    // slide from left
    slideInX: "-10",
  })}
>
  A slide transition
</button>;

Spin

Spin animations include spinIn and spinOut, utilizing various degree values.

import { css } from "../styled-system/css";

<button
  className={css({
    spinIn: "45",
  })}
>
  A spin in transition
</button>;

Zoom

Zoom animations consist of zoomIn and zoomOut, allowing for scaling effects.

import { css } from "../styled-system/css";

<button
  className={css({
    zoomIn: "45",
  })}
>
  A zoom in transition
</button>;

Duration

Modify the duration of animations using the duration utility.

import { css } from "../styled-system/css";

<button
  className={css({
    fadeIn: "10",
    duration: "500",
  })}
>
  A fade transition
</button>;

Arbitrary value

For custom values, consider utilizing strict tokes provided by Panda CSS.

Acknowledgement

This preset was inspired by tailwind-animate ๐Ÿš€

pandacss-animate's People

Contributors

mverissimo avatar github-actions[bot] avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.