Zero dependencies · 60 animations · UI kit

The universe,
one line of code.

GalaxyJS is a tiny, beautiful animation & component library. Cosmic canvas backdrops, themeable UI components, and a single unified API: Galaxy.create().

⚡ Shared rAF loop ♿ Reduced-motion aware 🎨 Light / dark themes 📦 ~14kb, no build step
The Collection

60 cosmic animations

Every animation is a canvas surface auto-sized to its container, paused when off-screen, and rendered through one shared loop. Click any card to load it in the playground.

Live Playground

Tweak it. Copy it. Ship it.

Adjust parameters in real time and copy the exact code you need.


          
        
UI Kit

Components, fully themed

Buttons, cards, modals, toasts, tooltips, tabs, accordions and more — all driven by the same design tokens, all wired with one call to Galaxy.autoInit().

Buttons

Toasts

Modal & Confirm

Tooltips

Tabs

Planets trace clean elliptical paths around a star.

Accordion

Yes — pure vanilla JS and CSS. No React, no build step required.
Always. Animations render a single static frame when the user prefers reduced motion.

Form controls

Badges & Avatars

New Stable Beta
GX AB CD

Alerts

Launch ready

All systems nominal.

Hull breach

Seal the airlock now.

Segmented & Drawer

Popover & Rating

Orbit insertion

Burn scheduled for T-minus 42s.

Steps

Fuel
Ignite
3
Launch
4
Orbit

Checkbox, Radio & Range

Pagination & Chips

Mars Europa Titan

Ring progress & Copy

72%
K to search

Table

BodyTypeDistance (AU)
MercuryTerrestrial0.39
JupiterGas giant5.20
NeptuneIce giant30.1
Get Started

Use it your way

Plain <script>, CDN, npm/ESM, zero-JS declarative — or let an AI agent wire it up for you. Same one-line API everywhere.

Script tag

local files
<link rel="stylesheet" href="galaxy.css">
<script src="galaxy.js"></script>

<script>
  Galaxy.create('nebula', '#hero')
</script>

CDN

no download
<link rel="stylesheet"
  href="https://unpkg.com/galaxyjs@3/galaxy.css">
<script
  src="https://unpkg.com/galaxyjs@3/galaxy.js"></script>

npm / ESM

bundlers
npm install galaxyjs

import Galaxy from "galaxyjs";
import "galaxyjs/galaxy.css";

Galaxy.create("nebula", "#hero");

Declarative

zero JS
<!-- animation -->
<div data-galaxy="warp" data-galaxy-speed="1.5"></div>

<!-- components auto-wire too -->
<button data-gx-tooltip="Hi!">Hover</button>
AI · MCP

Let an AI build it for you

GalaxyJS ships a machine-readable galaxy.manifest.json, an llms.txt guide, and a Model Context Protocol server. Any AI agent can discover and use every animation & component in one line — at minimal token cost.

Add to your MCP client (e.g. Claude Desktop):

{
  "mcpServers": {
    "galaxyjs": {
      "command": "npx",
      "args": ["-y", "galaxyjs-mcp"]
    }
  }
}

Then just ask:

// you
"Use GalaxyJS to add a slow
 purple nebula to #hero"

// agent calls galaxy_snippet →
Galaxy.create('nebula', '#hero', {
  speed: 0.6,
  colors: ['#7c5cff', '#4c1d95']
});
API reference →