Ballmac UI home

Particle Tree

New

A tree made of thousands of small points, standing on rings that spread across the ground. It sways, parts around the pointer and settles back, pauses off screen, and holds still under reduced motion.

v1.0.0Updated Oct 25, 2026Ships with a test
What changed

Move the pointer through the tree

Installation

$ pnpm dlx shadcn@latest add @ballmac/particle-tree

Usage

import { ParticleTree } from "@/components/ballmac/particle-tree"

The full example is in the Code tab above.

Examples

Fewer points, one color

API reference

PropTypeDefault
color

Color of the trunk and branches: a CSS variable name ("--foreground") or any CSS color.

string"--foreground"
accent

Color of the leaves and the rings on the ground.

string"--chart-1"
density

How many particles to draw, from 0.3 to 2. Scaled with the size of the container.

number1
seed

Changes the shape of the tree. The same seed always grows the same tree.

number7
radius

How far the pointer pushes particles away, in pixels. Zero turns it off.

number90
rings

Draw the rings that spread out from the foot of the tree.

booleantrue

Also accepts the standard attributes of its root element.

Accessibility

KeyAction
Decorationaria-hidden and pointer-events-none; content above it stays usable
MotionWith reduced motion it is drawn once and does not sway, twinkle or react to the pointer
PerformanceStops drawing when off screen or when the tab is hidden

Use with AI

Place <ParticleTree /> as the first child of a relative, overflow-hidden container; it fills it (absolute inset-0, aria-hidden, pointer-events-none) and tracks the pointer at window level, so content above it stays clickable. color is the trunk and branches, accent the leaves and ground rings (CSS variable names or any color). density 0.3 to 2, seed changes the shape (the same seed always grows the same tree), radius is how far the pointer pushes points (0 turns it off), rings toggles the ground rings. With the shadcn MCP server set up (guide), ask your agent:

Add the Ballmac UI Particle Tree (@ballmac/particle-tree) to this project with the shadcn MCP, then use it where it fits.

Use it for

  • The background of a dark AI, data or developer hero
  • A quiet, memorable image for a launch or waitlist page

Not for

  • Behind long text
  • Many instances on one page (each runs its own canvas loop)

Registry JSON: https://ui.ballmac.com/r/particle-tree.json

Credits

Free to use in personal and commercial projects.

npm
None

Ballmac UI Pro

Need the whole screen, not one piece?

150 premium blocks (dashboards, settings, calendars, mail, shops, onboarding), a private shadcn registry and Figma tokens. Blocks that show data come with loading, empty and error states built in.

Not ready? Try three Pro blocks free

Leave your email and the blocks appear right here, ready to copy. Yours to use in any project.