@appletosolutions/reactbits

中文文档
1.0.3发布于 2025/06/24MITTypeScriptESM + CJS近 30 天下载 1878

A comprehensive collection of beautiful, performant React animation components including bounce effects, click sparks, star borders, scroll-triggered animations, and fade transitions.

原始使用文档
文档目录32 节
  1. 🌟 Why ReactBits?
  2. ⚡ Performance First
  3. 🎯 Developer Experience
  4. 🎨 Production Ready
  5. 🚀 Unique Features
  6. 📦 Installation
  7. Peer Dependencies
  8. ⚠️ Troubleshooting
  9. 🚀 Quick Start
  10. 🧩 Component Categories
  11. 🎮 Examples
  12. 🎯 Simple Animations
  13. ⚡ Interactive Effects
  14. 🎨 Background Effects
  15. 🏗️ Complex Compositions
  16. 🌐 3D Showcase
  17. 💡 Showcase
  18. 🏆 Built with ReactBits
  19. 🎯 Perfect For
  20. 🎨 Styling & Customization
  21. 🎨 Framework Compatibility
  22. 🚀 Performance
  23. 📊 Benchmarks
  24. 🛠️ Framework Support
  25. 🤝 Contributing
  26. 🐛 Bug Reports
  27. 💡 Feature Requests
  28. 🔧 Development
  29. 📝 Pull Requests
  30. 🏢 About
  31. 🌟 Support the Project
  32. 📄 License

🎨 ReactBits

The Ultimate React Animation Library

npm version downloads GitHub stars MIT License

80+ Production-Ready Animation Components • TypeScript First • Zero Config • Tree Shakeable

Transform your React apps with stunning animations that actually perform in production.

🚀 Get Started • 📖 Documentation • 🎮 Examples • 💡 Showcase

🌟 Why ReactBits?

ReactBits isn't just another animation library. It's a complete animation ecosystem designed for modern React applications.

⚡ Performance First

  • Canvas & WebGL optimized for 60fps animations
  • Tree-shakeable - only bundle what you use
  • Memory efficient with proper cleanup
  • Mobile optimized with touch interactions

🎯 Developer Experience

  • Zero configuration - works out of the box
  • TypeScript native with full type safety
  • Composable - combine animations effortlessly
  • Consistent API across all components

🎨 Production Ready

  • 80+ components from simple fades to complex 3D effects
  • Battle tested in production applications
  • Accessible with proper ARIA support
  • Framework agnostic - works with Next.js, Vite, CRA

🚀 Unique Features

  • 3D Model Viewer with physics and lighting
  • Shader-based effects for premium visuals
  • Particle systems with WebGL acceleration
  • Advanced text animations with character-level control

📦 Installation

# npm
npm install @appletosolutions/reactbits

# yarn
yarn add @appletosolutions/reactbits

# pnpm
pnpm add @appletosolutions/reactbits

Peer Dependencies

ReactBits uses peer dependencies to avoid conflicts and reduce bundle size. Install only what you need:

# Required for all components
npm install react react-dom

# For 3D components (ModelViewer, Aurora, etc.)
npm install three @react-three/fiber @react-three/drei

# For GSAP-powered animations (Bounce, ScrollReveal, etc.)
npm install gsap

# For physics-based animations (Ballpit, etc.)
npm install matter-js

# For Chakra UI components (optional)
npm install @chakra-ui/react @emotion/react @emotion/styled

# For Framer Motion components (optional)
npm install framer-motion

⚠️ Troubleshooting

Dependency Resolution Errors: If you encounter "Could not resolve" errors for dependencies like matter-js, @react-three/fiber, etc.:

# Install only the peer dependencies you need
npm install three @react-three/fiber @react-three/drei  # For 3D components
npm install matter-js                                   # For physics components
npm install gsap                                        # For GSAP animations

# Use --legacy-peer-deps if needed
npm install @appletosolutions/reactbits --legacy-peer-deps

Bundle Size Optimization: ReactBits uses peer dependencies to keep your bundle small:

# Check what's included in your bundle
npm run build -- --analyze  # For Create React App with bundle analyzer

# Only install dependencies for components you use
npm install gsap              # Only if using GSAP-powered components
npm install three             # Only if using 3D components

TypeScript Errors: Ensure you have the correct type definitions:

npm install --save-dev @types/three @types/matter-js

Framework-Specific Issues:

  • Next.js: Add to next.config.js:

    module.exports = {
      transpilePackages: ['@appletosolutions/reactbits']
    }
    
  • Vite: Add to vite.config.ts:

    export default defineConfig({
      optimizeDeps: {
        include: ['@appletosolutions/reactbits']
      }
    })
    

🚀 Quick Start

Get up and running in 30 seconds:

import { Bounce, ClickSpark, StarBorder } from '@appletosolutions/reactbits';

function App() {
  return (
    <div>
      {/* Bounce animation on mount */}
      <Bounce>
        <h1>Welcome to ReactBits! 🎉</h1>
      </Bounce>

      {/* Interactive click effects */}
      <ClickSpark sparkColor="#ff6b6b" sparkCount={12}>
        <button className="btn-primary">
          Click for sparks! ✨
        </button>
      </ClickSpark>

      {/* Animated border effects */}
      <StarBorder color="#00d4ff" speed="3s">
        <div className="premium-card">
          Premium Feature ⭐
        </div>
      </StarBorder>
    </div>
  );
}

That's it! No configuration, no setup, just beautiful animations.

🧩 Component Categories

📝 Text Animations (20+ components)

Perfect for headlines, CTAs, and dynamic content:

  • SplitText - Character-by-character animations
  • BlurText - Smooth blur-to-focus transitions
  • GlitchText - Cyberpunk-style glitch effects
  • ScrambleText - Matrix-style character scrambling
  • ShinyText - Metallic shine effects
  • GradientText - Animated gradient text
  • DecryptedText - Decryption animation effect
  • FallingText - Gravity-based text animations
  • CountUp - Animated number counters
  • And 11 more...
✨ Interactive Effects (15+ components)

Engage users with responsive animations:

  • ClickSpark - Particle explosions on click
  • StarBorder - Animated star borders
  • GlareHover - Metallic hover effects
  • MagnetLines - Magnetic line attractions
  • PixelTrail - Mouse-following pixel effects
  • SplashCursor - Liquid cursor interactions
  • BlobCursor - Morphing blob cursor
  • ImageTrail - Image-following mouse trails
  • And 7 more...
🎨 Background Effects (20+ components)

Transform your layouts with stunning backgrounds:

  • Aurora - Northern lights shader effect
  • Particles - WebGL particle systems
  • Lightning - Electric lightning effects
  • Silk - Flowing silk animations
  • MetaBalls - Liquid blob animations
  • GridDistortion - Warping grid effects
  • Hyperspeed - Star field animations
  • LiquidChrome - Metallic liquid effects
  • And 12 more...
🏗️ Layout Components (15+ components)

Enhance your UI with animated layouts:

  • AnimatedList - Staggered list animations
  • Carousel - Smooth carousel transitions
  • Stack - Card stack interactions
  • Dock - macOS-style dock effects
  • InfiniteScroll - Smooth infinite scrolling
  • ElasticSlider - Physics-based sliders
  • FlowingMenu - Fluid menu animations
  • CircularGallery - 3D circular galleries
  • And 7 more...
🌐 3D Components (10+ components)

Professional 3D effects powered by Three.js:

  • ModelViewer - Interactive 3D model display
  • FlyingPosters - 3D scrolling galleries
  • Ballpit - Physics-based ball animations
  • Orb - Floating 3D orbs
  • Waves - Ocean wave simulations
  • ChromaGrid - Chromatic aberration grids
  • And 4 more...

🎮 Examples

🎯 Simple Animations

// Bounce effect on page load
<Bounce>
  <h1>Welcome! 👋</h1>
</Bounce>

// Fade in with blur effect
<FadeContent blur={true} duration={1000}>
  <img src="/hero.jpg" alt="Hero" />
</FadeContent>

// Scroll-triggered slide animation
<AnimatedContent direction="vertical" distance={100}>
  <div>Slides up when scrolled into view</div>
</AnimatedContent>

⚡ Interactive Effects

// Click sparks with custom colors
<ClickSpark sparkColor="#ff6b6b" sparkCount={15} sparkRadius={30}>
  <button className="cta-button">
    Click me for fireworks! 🎆
  </button>
</ClickSpark>

// Animated star border
<StarBorder color="#ffd700" speed="2s">
  <div className="premium-badge">
    ⭐ Premium Feature
  </div>
</StarBorder>

// Magnetic hover effect
<Magnet strength={0.3} range={100}>
  <div className="magnetic-card">
    Hover to see magnetic attraction
  </div>
</Magnet>

🎨 Background Effects

// Aurora background with custom colors
<Aurora
  colorStops={["#ff6b6b", "#4ecdc4", "#45b7d1"]}
  amplitude={1.2}
  speed={0.8}
/>

// Particle system background
<Particles
  particleCount={150}
  particleColors={["#ff6b6b", "#4ecdc4"]}
  moveParticlesOnHover={true}
/>

// Animated grid distortion
<GridDistortion
  gridSize={20}
  distortionStrength={0.5}
  animationSpeed={1.0}
/>

🏗️ Complex Compositions

// Multi-layered landing page
<div className="hero-section">
  <Aurora colorStops={["#667eea", "#764ba2"]} />

  <FadeContent blur={true} duration={1200}>
    <Bounce delay={500}>
      <h1>ReactBits Animation Library</h1>
    </Bounce>

    <AnimatedContent direction="vertical" delay={800}>
      <p>80+ components for stunning React animations</p>

      <ClickSpark sparkColor="#ffd700" sparkCount={20}>
        <StarBorder color="#00d4ff">
          <button>Get Started Now</button>
        </StarBorder>
      </ClickSpark>
    </AnimatedContent>
  </FadeContent>
</div>

🌐 3D Showcase

// Interactive 3D model viewer
<ModelViewer
  url="/models/product.glb"
  width={600}
  height={400}
  autoRotate={true}
  enableMouseParallax={true}
/>

// Flying posters gallery
<FlyingPosters
  items={[
    { image: "/poster1.jpg", title: "Project 1" },
    { image: "/poster2.jpg", title: "Project 2" },
    { image: "/poster3.jpg", title: "Project 3" }
  ]}
  distortion={2.5}
/>

💡 Pro Tip: All components are composable! Mix and match to create unique effects.

📖 View Complete Examples →

💡 Showcase

🏆 Built with ReactBits

E-commerce
E-commerce Landing
Aurora + ClickSpark + StarBorder
Portfolio
Portfolio Gallery
FlyingPosters + ModelViewer
Dashboard
Analytics Dashboard
AnimatedList + CountUp + Particles
Gaming
Gaming Interface
GlitchText + Lightning + MetaBalls

🎯 Perfect For

  • 🛍️ E-commerce - Product showcases, CTAs, checkout flows
  • 💼 SaaS Applications - Onboarding, dashboards, feature highlights
  • 🎨 Portfolios - Creative showcases, project galleries
  • 📱 Mobile Apps - Touch interactions, micro-animations
  • 🎮 Gaming - UI effects, loading screens, achievements
  • 📊 Data Visualization - Chart animations, progress indicators

🎨 Styling & Customization

ReactBits components are unstyled by default, giving you complete design freedom:

// Use with any CSS framework
<ClickSpark className="my-custom-button">
  <button className="btn btn-primary">Tailwind Button</button>
</ClickSpark>

// Or with CSS-in-JS
<StarBorder
  style={{ borderRadius: '12px' }}
  color="#ff6b6b"
>
  <div className="styled-component">Custom Styled</div>
</StarBorder>

🎨 Framework Compatibility

✅ Tailwind CSS - Perfect integration ✅ Styled Components - Full support ✅ Emotion - Works seamlessly ✅ CSS Modules - Complete compatibility ✅ Vanilla CSS - No restrictions

🚀 Performance

ReactBits is built for production with performance as a top priority:

MetricReactBitsFramer MotionReact Spring
Bundle Size50KB (core)180KB120KB
Tree Shaking✅ Full⚠️ Partial⚠️ Partial
WebGL Support✅ Yes❌ No❌ No
3D Components✅ 10+❌ No❌ No
Canvas Animations✅ Yes❌ No❌ No

📊 Benchmarks

  • 60fps animations on mobile devices
  • <16ms render times for complex effects
  • Zero layout thrashing with transform-based animations
  • Memory efficient with automatic cleanup

🛠️ Framework Support

FrameworkSupportNotes
Next.js✅ FullSSR compatible
Vite✅ FullOptimized builds
Create React App✅ FullZero config
Remix✅ FullSSR compatible
Gatsby✅ FullStatic generation

🤝 Contributing

We love contributions! Here's how to get started:

🐛 Bug Reports

Found a bug? Open an issue with:

  • Clear description
  • Reproduction steps
  • Expected vs actual behavior
  • Environment details

💡 Feature Requests

Have an idea? Start a discussion to:

  • Describe your use case
  • Explain the proposed solution
  • Discuss implementation details

🔧 Development

# Clone the repository
git clone https://github.com/appletosolutions/reactbits.git

# Install dependencies
npm install

# Start development
npm run dev

# Run tests
npm test

# Build library
npm run build

📝 Pull Requests

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-animation)
  3. Write tests for your changes
  4. Ensure all tests pass (npm test)
  5. Commit your changes (git commit -m 'Add amazing animation')
  6. Push to the branch (git push origin feature/amazing-animation)
  7. Open a Pull Request

🏢 About

ReactBits is crafted with ❤️ by Appleto Solutions

🌟 Support the Project

If ReactBits helps your project, consider:

  • ⭐ Starring the repository
  • 🐦 Sharing on social media
  • 💝 Sponsoring development
  • 🤝 Contributing code or ideas

📄 License

MIT © Appleto Solutions


Made with ❤️ for the React community

⭐ Star on GitHub • 📦 View on NPM • 📖 Documentation

版本与发布记录

@appletosolutions/reactbits 共发布 4 个版本,首次发布于 2025/06/19;过去 12 个月发布了 0 个版本。

版本发布日期距今
1.0.3latest2025/06/241.4 年前
1.0.22025/06/241.4 年前
1.0.12025/06/231.4 年前
1.0.02025/06/191.4 年前

关于 @appletosolutions/reactbits 的常见问题

@appletosolutions/reactbits 是什么?

A comprehensive collection of beautiful, performant React animation components including bounce effects, click sparks, star borders, scroll-triggered animations, and fade transitions.

如何安装 @appletosolutions/reactbits?

在项目目录运行 npm install @appletosolutions/reactbits,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:react(^17.0.0 || ^18.0.0 || ^19.0.0)、react-dom(^17.0.0 || ^18.0.0 || ^19.0.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@appletosolutions/reactbits 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@appletosolutions/reactbits 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@appletosolutions/reactbits 可以商用吗?

@appletosolutions/reactbits 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@appletosolutions/reactbits 的下载量有多少?

根据 npm 官方下载统计,@appletosolutions/reactbits 在 2026/10/07 – 2026/11/05 这 30 天内被下载 1,878 次,日均约 63 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@appletosolutions/reactbits 还在维护吗?

最新版本 1.0.3 发布于 2025/06/24(1.4 年前);至今共发布 4 个版本,其中过去 12 个月发布了 0 个;首次发布于 2025/06/19。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。