GithubHelp home page GithubHelp logo

bertcatsburg / example-framermotion-with-react-components-as-staggedchildren Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 33 KB

An complete working example on how to do FramerMotion StaggerChildren on a React Component

JavaScript 7.14% HTML 5.94% TypeScript 62.52% CSS 24.39%

example-framermotion-with-react-components-as-staggedchildren's Introduction

Framer Motion with StaggerChildren on React Components

Sorry for the long title, but this is exactly what this project is about.

  • I have a container (ol-list) with React Components as the children.
  • On the container I want to 'stagger the children' with Framer Motion.

Since there are no complete examples found on the internet, only a bunch of software-snippets, I decided to create a complete example.

Tech stack in this project

  • Typescript (no ts-ignore in this project!!)
  • React (18.2.0) + React Router
  • Framer Motion (11.0.5)
  • Vite (5.1.4)

Files

How to work through the files to understand what's happening:

App.tsx

Small and only setting up the Routes

routes.tsx

I wanted to show the difference between HTML and React components. Therefore, 2 pages. One in HTML, the other with a React component.

  • /html
  • /react

RouteLayout.tsx

A page showing 2 buttons:

  • One going to /html (HtmlList component)
  • Another going to /react (ReactList component)

HtmlList.tsx

Shows a small list, with 'ol' and 'li'

ReactList.tsx

Shows the same small list, but now with an 'ol' and a React component (which does the 'li')

See the comments in the code for explanations

How to run this

  • Clone this repo
  • npm install
  • npm run dev

Documentation References

example-framermotion-with-react-components-as-staggedchildren's People

Contributors

bertcatsburg 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.