scrollxui

Gravity

Backgrounds 11

About

An animated container effect where small glowing particles launch upward like rockets and fall back down under gravity, used as a decorative background inside cards or hero sections.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Gravity to your project and fits it to your theme.

Code

How Gravity is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

import { Gravity } from "@/components/ui/gravity";

export default function GravityDemo() {
  return (
    <div className="flex items-center justify-center px-4 py-12">
      <div className="relative w-full max-w-sm">
        <div
          className="relative flex h-85 w-[90%] flex-col items-start justify-end
          overflow-hidden rounded-2xl border border-gray-300 dark:border-gray-800
          bg-gray-50 dark:bg-[#0a0a0a]
          px-5 py-8 shadow-xl mx-auto transition-colors"
        >
          <h2 className="relative z-50 mb-3 text-xl font-bold text-gray-900 dark:text-white">
            Gravity
          </h2>
          <p className="relative z-50 mb-5 text-base font-normal text-gray-600 dark:text-gray-400 leading-relaxed">
            Gravity pulls everything down, not to defeat it, but to give every
            fall the chance to launch again with greater force.
          </p>
          <Gravity number={20} />
        </div>
      </div>
    </div>
  );
}

Dependencies

More by scrollxui

View all
  • Contact with Globe

    Contact with Globe

    307
  • Features With Panel

    Features With Panel

    260
  • Logo Cloud Marquee

    Logo Cloud Marquee

    148
  • Hero Section with Cards

    Hero Section with Cards

    126
  • FAQ Accordion

    FAQ Accordion

    121
  • Particles

    Particles

    98
  • Hero With Pixel Background

    Hero With Pixel Background

    77
  • Testimonials Marquee

    Testimonials Marquee

    59

More in Backgrounds

View all
  • Elegant Dark Pattern

    Elegant Dark Pattern

    811
  • Gradient Backgrounds

    Gradient Backgrounds

    25
  • Jade Sky

    Jade Sky

    85
  • Light theme Tailwind CSS Background Snippet

    Light theme Tailwind CSS Background Snippet

    221
  • Background snippets

    Background snippets

    16
  • Gradient Blur Bg

    Gradient Blur Bg

    34
  • Background Components

    Background Components

    233
  • Tailwind CSS Background Snippet

    Tailwind CSS Background Snippet

    535