tmt-anim-library
v1.0.4
Published
A simple animation library using Framer Motion
Downloads
330
Maintainers
Readme
Animation Library using Framer Motion
Welcome to the Animation Library! This package allows you to easily apply a variety of animations to your React components with the power of Framer Motion. Our library provides simple and reusable animation components that you can directly integrate into your projects.
Table of Contents
Installation
To install the library, you need to add it to your project via npm
or yarn
.
Using npm
npm install tmt-anim-library
I'll rewrite the content using only markdown formatting and comments, without any code blocks. Here's how it would look:
Usage
Here's a simple example of how to use the animations in your React project:
Importing Animations
To use an animation, import it into your component.
import { FadeIn, SlideIn, Bounce } from 'tmt-anim-library';
Using an Animation
Apply the animation to your component like this:
import React from 'react'; import { FadeIn, SlideIn, Bounce } from 'tmt-anim-library';
const MyComponent = () => (
<div>
<FadeIn>
<h1>
This is a FadeIn animation!</h1>
</FadeIn>
*<SlideIn>*
*<p>This is a SlideIn animation!</p>*
*</SlideIn>*
*<Bounce>*
*<button>Click me!</button>*
*</Bounce>*
</div>
);
export default MyComponent;
In this example, the FadeIn
, SlideIn
, and Bounce
components are used to animate different parts of the component.
Animations Provided
The library includes several built-in animations that you can use out of the box:
FadeIn
Applies a fade-in effect to the wrapped content.
<FadeIn duration={1}>
Content goes here</FadeIn>
SlideIn
Slides the wrapped content from a specified direction (left, right, top, or bottom).
<SlideIn direction="left" duration={0.5}>
Content goes here</SlideIn>
Bounce
Adds a bounce effect to the wrapped content.
<Bounce duration={1}>
Content goes here</Bounce>
Custom Animations
You can also create your own custom animations by adjusting the properties of Framer Motion components directly in your project.
Customization
You can customize the animations in the following ways:
- Duration: Set the duration of the animation to control how fast or slow it plays.
- Direction: For animations like SlideIn, choose from left, right, top, and bottom to control the direction.
- Easing: Customize the easing function for more control over the animation flow (e.g., ease-out, ease-in).
- Delay: Add a delay before the animation starts.
For example:
<FadeIn duration={2} delay={0.5}>
<h2>
This text will fade in slowly with a delay</h2>
</FadeIn>
Contributing
We welcome contributions to the Animation Library! Here's how you can help:
- Fork the repository and clone it locally.
- Create a new branch (git checkout -b feature-name).
- Make your changes and commit them (git commit -m 'Add new animation').
- Push to your branch (git push origin feature-name).
- Open a pull request and describe your changes.