If you have ever spent an afternoon rebuilding the same animated text reveal, hover card, or scroll-triggered effect for the third project in a row, React Bits is worth your attention. It is an open-source collection of animated and interactive React components — things like split-text animations, glitch effects, dock-style menus, and animated backgrounds — designed to be dropped into modern React and Next.js projects. This tutorial walks through what React Bits actually is, how to install and use it correctly, and the practical decisions you need to make around styling, TypeScript, and bundle size before shipping it to production.
The core idea behind React Bits is that most animated UI falls into a handful of reusable patterns. Instead of copy-pasting a CodePen into your project and hoping the dependencies resolve, the library gives you structured, customizable components built on well-known animation primitives. That makes it a good fit for landing pages, portfolios, and marketing sites where visual polish matters but you do not want to hand-roll every effect.
What React Bits Is (and What It Is Not)
React Bits is a component library focused on animated and interactive UI elements rather than layout or data-display primitives. Where a library like shadcn/ui gives you buttons, dialogs, and tables, React Bits gives you the flourishes: text that animates in letter by letter, cursors with custom trails, cards that tilt in 3D, and background effects like animated gradients or particle fields.
A few characteristics define how the library works:
- Components are built on top of established animation tooling, most notably GSAP and Framer Motion, plus CSS-based effects where appropriate. This means some components require those libraries as peer dependencies.
- The project offers multiple variants of each component, typically in JavaScript and TypeScript, and in CSS, Tailwind CSS, and styled-components flavors. You pick the variant that matches your stack.
- You can either install components as a package or copy the source code directly into your project, similar in spirit to the shadcn/ui "own the code" model.
It is not a full design system. You will not find form validation, data tables, or accessibility-hardened navigation primitives here. Treat React Bits as a layer you add on top of a solid component foundation, not a replacement for one. That distinction matters: animated components are the easiest part of an app to swap out later, so keeping them isolated in your codebase is a good architectural habit regardless.
Installing React Bits the Right Way
The library's official documentation at reactbits.dev is the authoritative source for current installation steps, and it provides a CLI-based workflow as well as manual copy-paste. The general flow looks like this.
First, make sure you have a working React 18+ or Next.js project. Then install the package along with the animation dependencies your chosen components need:
npm install @react-bits/animated
npm install gsap framer-motion
The exact package names and required peer dependencies vary by component and by version, so check the documentation page for the specific component you want before installing. A text animation built on GSAP will not need Framer Motion, and vice versa — installing both when you only need one adds unnecessary weight.
If you prefer not to add a dependency at all, the manual approach works well. Each component's documentation page shows its source code, and you can copy the relevant file into something like src/components/reactbits/. This is often the better choice for teams that want to customize effects heavily, because you own the code and can refactor it without waiting on upstream changes.
One setup detail that trips people up: components that use GSAP's ScrollTrigger plugin need it registered once at the module level. If you copy source code manually, make sure that registration step survives your refactoring, or scroll-based animations will silently do nothing.
Building Your First Animated Section
Let's walk through a realistic example: a hero section where the headline animates in with a split-text effect. Assume you have already installed the library and its dependencies.
The typical usage pattern is straightforward — import the component, pass your text and configuration props, and render it:
import SplitText from "./components/reactbits/SplitText";
export default function Hero() {
return (
<section className="hero">
<SplitText
text="Ship interfaces people remember"
className="hero-title"
delay={100}
duration={800}
ease="power3.out"
splitType="chars"
/>
<p className="hero-subtitle">
A small studio building fast, accessible web products.
</p>
</section>
);
}
The exact prop names differ between components and variants, so always confirm against the documentation for the version you installed rather than copying props blindly. The general shape, however, is consistent across the library: you pass content (text, children, or an image), timing values like delay and duration, and an easing or animation-type option.
A few practical tips for this kind of hero animation:
- Respect reduced motion. Many users set a "reduce motion" preference at the OS level, and large entrance animations can be genuinely unpleasant or disorienting for them. Check
window.matchMedia("(prefers-reduced-motion: reduce)")and either skip the animation or render a static version. Some components handle this for you; when you own the copied source, it is your responsibility. - Animate once, not on every render. Entrance animations should typically run a single time. If your component re-renders frequently, make sure the animation is not being re-triggered by a changing prop or an unstable parent.
- Keep the animated element layout-stable. Splitting text into individual characters can change how the browser wraps lines. Test your headline at narrow viewport widths, because a character-split animation that looks great on desktop can produce awkward line breaks on mobile.
Choosing Between Variants: CSS, Tailwind, and Styled Components
One of React Bits' more useful design decisions is offering each component in multiple styling variants. This is a genuine decision point, not just a convenience, because the variant you pick affects your bundle and your team's workflow.
If your project already uses Tailwind CSS, the Tailwind variant keeps everything in your existing styling system. The tradeoff is that the component's class strings become part of your markup, which makes heavy customization slightly messier but keeps your CSS bundle predictable.
If you use plain CSS or CSS Modules, the CSS variant is the cleanest fit. You get a stylesheet alongside the component, and you can override styles with your own classes without fighting utility-class specificity.
Styled-components variants make sense only if styled-components is already in your dependency tree. Adding a CSS-in-JS runtime solely for a few animated components is rarely worth the cost, especially given the ongoing evolution of React Server Components, where CSS-in-JS libraries have had compatibility friction.
A reasonable default for most new projects in 2025: Tailwind variant if you are on Tailwind, CSS variant otherwise, and copy the source manually when you expect to modify the animation logic itself.
Common Mistakes and Production Considerations
Animated component libraries fail in production for predictable reasons, and most of them are avoidable.
Overusing effects is the number one problem. A landing page with a glitch title, a particle background, a custom cursor, a dock menu, and scroll-triggered reveals on every section does not feel premium — it feels slow and chaotic. A useful rule of thumb is one or two signature effects per page, with the rest of the UI staying calm. Animation should direct attention, not compete for it.
Bundle size deserves a quick check. GSAP and Framer Motion are both well-engineered, but they are not free. If your page uses a single CSS-only animation from React Bits, do not pull in GSAP for it. When you copy source code manually, you also inherit the responsibility to tree-shake correctly — importing from a barrel file that re-exports every component can pull far more code than you need into your bundle. Prefer direct imports from individual files where your bundler supports it.
Server rendering needs care. In Next.js App Router projects, components that measure the DOM, use window, or run imperative animation code generally need a "use client" directive. If you see hydration mismatches or "window is not defined" errors after adding an animated component, this is almost always the cause. Wrapping the animated component in a small client component boundary, while keeping the surrounding page as a server component, is the clean fix.
Accessibility is easy to overlook. Decorative animations should be invisible to screen readers, and any text that animates in should still be present in the DOM as real text — not replaced by images or canvas. React Bits components generally keep text as text, which is good, but verify this when you customize. Also test keyboard navigation: a flashy dock menu is worthless if its items cannot be reached with Tab and activated with Enter.
Finally, resist the temptation to animate everything "because it's there." The strongest use of a library like this is a single memorable moment — a hero reveal, a distinctive background — executed well, with the rest of the interface behaving conventionally.
Frequently Asked Questions
React Bits is open source and published under a permissive license, so you can use it in commercial projects. Check the repository’s license file for the exact terms, and if you copy source code into your project, keep the license attribution as required.
Yes. The library provides TypeScript variants of its components and works in Next.js projects. In the App Router, components that use browser APIs or imperative animation libraries typically need the `”use client”` directive, and scroll-based effects should be tested after hydration.
No. You can use the components as-is by passing props. However, basic familiarity helps when you want to customize timing, easing, or sequencing, and it is essential if you copy the source code and modify the animation logic yourself.
Framer Motion and GSAP are animation engines; React Bits is a collection of ready-made components built on top of engines like those. Using React Bits saves you from writing the composition logic yourself, while using the engines directly gives you full control at the cost of more code.
They can, if used carelessly. Heavy background effects and large animation libraries increase JavaScript payload and main-thread work, which affects metrics like Interaction to Next Paint. Use effects selectively, lazy-load anything below the fold, and measure with Lighthouse before and after adding animations.
Conclusion
React Bits fills a real gap: it turns the animated flourishes that used to require custom GSAP or Framer Motion work into installable, customizable components, with variants that fit most modern React stacks. The practical recipe is simple — install the package or copy the source, pick the styling variant that matches your project, add a "use client" boundary in Next.js, and honor reduced-motion preferences. The bigger discipline is restraint: one or two well-chosen effects will do more for a page than a dozen competing ones. A good next step is to browse the component gallery at reactbits.dev, pick a single effect for your current project's hero section, and ship it behind a reduced-motion check this week.
Transparency Note: Links in this article are not affiliate links. I recommend these tools and platforms based on their relevance to the topic, and no compensation is received for including them.