Logo

    Tailwind CSS and Framer Motion components

    Tailwind handles the static styles, Motion handles the values that change over time, and the trouble starts when both try to own the same property.

    Trusted by Founders and Entrepreneurs from all over the world

    John Shahawy
    Henrik Söderlund
    John Ferry
    Meru Gokhale
    Georg Weingartner
    Jonathan Barshop
    Ray Thai
    Tony Pujals
    Next.js
    React
    Tailwind CSS
    Framer Motion

    Making Tailwind CSS and Motion work together

    Start with the naming, because it causes real confusion. Framer Motion was renamed to Motion and now ships as the motion package, imported as motion/react. The older framer-motion package still exists and still works, but new projects should install motion and write import { motion } from "motion/react". If you are reading a tutorial from 2023 the API is largely the same, so the only line you usually need to change is the import.

    The division of labour is simple once you see it. Tailwind is a compiler for static utility classes, so it is good at everything that does not change: spacing, colour, radius, type, breakpoints. Motion owns anything interpolated over time. Where people get burned is applying a Tailwind transition or transform class to an element whose transform Motion is also animating. Motion writes inline styles, and inline styles win, so your class silently does nothing or the animation jumps at the start. Pick one owner per property and stay with it.

    For an element that both animates on mount and needs hover feedback, the cleanest split is Motion for the entrance and Tailwind for the hover, but only if the hover changes something Motion is not touching, such as background colour or border. If the hover needs to scale the element, move that to Motion's whileHover too and drop the Tailwind hover:scale class. Mixing them on scale produces a visible stutter that is very hard to debug later, because nothing errors.

    Two habits keep animated Tailwind pages fast. Animate transform and opacity, which the compositor can handle without recalculating layout, and avoid animating width, height, top or margin, which force layout on every frame. Tailwind makes the slow version easy to reach for, since transitioning h-0 to h-96 is one class away, and on a long page with several of those you will feel it on a mid-range Android device. If you need a size change, animate scale, or hand the job to Motion's layout prop which uses a transform under the hood.

    Finally, respect the user setting. Wrap motion in a check on prefers-reduced-motion, either with Tailwind's motion-safe and motion-reduce variants for class-driven animation or with Motion's useReducedMotion hook for component-driven animation. Reduced motion does not have to mean no motion. Cutting distance and duration, so an element fades in place instead of sliding forty pixels, keeps the page legible for people who get motion sick without stripping the design back to nothing.

    Frequently asked questions

    Is Framer Motion the same as Motion?

    It is the same library after a rename. The framer-motion package was renamed to motion, so current installs use npm install motion and import from motion/react. Existing framer-motion code keeps working, and migrating is usually just the import path.

    How do I use Framer Motion with Tailwind CSS?

    Put your Tailwind classes on the motion element as normal and let Motion handle only the animated values through initial, animate, exit and transition. The rule to follow is that no property should be controlled by both, since Motion's inline styles override Tailwind classes.

    Why is my Tailwind transition not working with Framer Motion?

    Almost always because Motion is writing an inline style for the same property, which takes precedence over the utility class. Remove the Tailwind transition and transform classes for that property and express the change through Motion's transition object instead.

    Do I need use client for Motion components in Next.js?

    Yes. Motion relies on hooks and browser APIs, so any file importing from motion/react needs the use client directive in the App Router. Keep those components small and leaf level so the rest of the route can stay on the server.

    Does adding Motion make my bundle much bigger?

    The full import is in the tens of kilobytes gzipped, which is noticeable on a small marketing site and irrelevant in an application that already ships a router and a data layer. If size matters, Motion offers a lighter mini version for simple animations, and you can lazy load heavier animated sections that sit below the fold.

    Keep exploring

    Loved by thousands of people

    Here's what some of our users have to say about Aceternity UI.

    Featured by popular YouTubers

    See what the best YouTubers are saying about Aceternity UI.

    Video thumbnail
    Jeff from
    Fireship
    talks about how Aceternity UI can help you build awesome landing pages with speed
    Video thumbnail
    Watch
    Web Prodigies
    build an entire SaaS application from scratch with Aceternity UI
    Video thumbnail
    Josh from
    Josh Tried Coding
    talks about how Aceternity UI components can help your website stand out.
    Video thumbnail
    Watch
    Hitesh Choudhary
    build an entire website from scratch with Aceternity UI
    Video thumbnail
    Adrian from
    Adrian Twarog
    talks about Aceternity UI and how to use the components efficiently
    Video thumbnail
    Adrian from
    JavaScript Mastery
    creates an entire portfolio website with amazing details and beautiful UI with Aceternity UI
    Video thumbnail
    Watch
    Raj Talks Tech
    walk through Aceternity UI components and teaches how to incorporate them into your website

    ceternity UI

    Access an ever-growing collection of premium, meticulously crafted templates and Component Blocks.

    A product by Aceternity
    Building in public at @mannupaaji

    © 2026 Aceternity Labs LLC. All Rights Reserved.