• Stars
    star
    1,113
  • Rank 41,718 (Top 0.9 %)
  • Language
    TypeScript
  • License
    MIT License
  • Created about 1 year ago
  • Updated 11 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

react-magic-motion is a react.js library that ✨ magically animates your components.

react-magic-motion

react-magic-motion.com

react-magic-motion is a react.js library that ✨ magically animates your components.

⭐️ Getting Started

📦 Install

npm i react-magic-motion

🔎 Simple Example

🎥 Demo

react-magic-motion-full-demo.mp4

🧑‍💻 Code

import { useState } from "react";
import { MagicMotion } from "react-magic-motion";

function ListItem({ children }: { children: string }) {
  return (
    <li
      style={{
        backgroundColor: "#4d4d4dff",
        width: "20rem",
        padding: "0.5rem",
      }}
    >
      {children}
    </li>
  );
}

export default function App() {
  const [areGoalsShowing, setAreGoalsShowing] = useState(true);
  return (
    <MagicMotion>
      <div
        style={{
          margin: "0.75rem auto 0",
          width: "20rem",
          display: "flex",
          flexDirection: "column",
          gap: "1rem",
          overflow: "hidden",
        }}
      >
        <h1
          style={{
            fontWeight: "bold",
            margin: "0.25rem",
          }}
        >
          My Goals
        </h1>
        {areGoalsShowing && (
          <ul
            style={{
              display: "flex",
              flexDirection: "column",
              gap: "0.75rem",
              listStyle: "none",
              paddingLeft: "0.5rem",
              margin: 0,
            }}
          >
            <ListItem>🏀 Make 10 three pointers in a row</ListItem>
            <ListItem>🏋️‍♂️ Bench press 225 lbs</ListItem>
            <ListItem>🏃‍♂️ Run a 5k in under 20 minutes</ListItem>
          </ul>
        )}
        <button
          style={{
            width: "fit-content",
            whiteSpace: "nowrap",
            padding: "0.5rem 1rem",
            backgroundColor: "#5a70ed",
            color: "#ffffff",
            border: 0,
            cursor: "pointer",
            fontFamily: "inherit",
          }}
          onClick={() => setAreGoalsShowing(!areGoalsShowing)}
        >
          {areGoalsShowing ? "Hide" : "Show"} my goals
        </button>
      </div>
    </MagicMotion>
  );
}

💫 Examples

📓 Docs

  • For a full understanding of react-magic-motion visit the docs here

❓ Want to Contribute

More Repositories

1

slick-fox

🦊 A firefox config that has rounded tabs and a url bar that can disappear when not selected on. It works with any theme.
CSS
373
star
2

euismod

📝 A website that make learning CSS grid easy and interactive
JavaScript
284
star
3

rounded-fox

A userchrome css configuration for firefox that is ultra-minimalistic
CSS
91
star
4

xp-newtab

A new tab extension that is in the style of Windows XP
JavaScript
67
star
5

dragify

✨ An application that can be used to create a custom startpage through interactive tools like drag and drop
JavaScript
57
star
6

Custoplayer

A React.js npm package that allows for the rapid creation of customizable video players.
TypeScript
19
star
7

personal-website

🌈 My personal website. It showcases my most impressive projects.
TypeScript
14
star
8

react-mouse-blur

🖱️ A npm package that allows the user to easily implement motion blur on their mouse cursor.
JavaScript
7
star
9

bytebook

TypeScript
2
star
10

seafoam-fox

🌊 A userchrome.css config that gives a seafoam vibe to your Firefox browser
CSS
2
star
11

thehive.ai-dropdown-menu

The dropdown menu can be seen in the sandbox below:
JavaScript
1
star
12

Szechuan

C#
1
star
13

ea2905-1006-final

The final project for ENGI1006, Introduction to Computing for Engineers and Applied Scientists
HTML
1
star
14

assets

The repository where I store large assets for GitHub readmes
1
star
15

react-swervy-text

➿ A react package that provides an easy way for text to be animated along shapes and curves.
JavaScript
1
star
16

ParVarys

⚡️ A parallel implemention of the Varys algorithm coded in Haskell.
Haskell
1
star
17

senator-battle

🔪 An application that creates a battle between any two senators and the victor is based off of their statistics in office.
JavaScript
1
star
18

interactive-login

😳 The frontend for a login. It uses animations to create an interactive environment.
JavaScript
1
star