A component registry of animated web components — install any of them into your own project with the motion-blocks CLI, browse and preview them all in a live Astro gallery.
pnpm install
pnpm dev # http://localhost:4321 — live preview/demo gallery
pnpm build # production build → dist/
pnpm preview # preview the production buildInstall components into your own project with the Motion Blocks CLI:
# pnpm
pnpm dlx motion-blocks init
pnpm dlx motion-blocks add magnetic
# npm
npx motion-blocks init
npx motion-blocks add magnetic
# yarn
yarn dlx motion-blocks init
yarn dlx motion-blocks add magnetic
# bun
bunx --bun motion-blocks init
bunx --bun motion-blocks add magneticBrowse available items:
# pnpm
pnpm dlx motion-blocks list
pnpm dlx motion-blocks list --all # include hidden helper libs
pnpm dlx motion-blocks info
# npm
npx motion-blocks list
npx motion-blocks list --all
npx motion-blocks info
# yarn
yarn dlx motion-blocks list
yarn dlx motion-blocks list --all
yarn dlx motion-blocks info
# bun
bunx --bun motion-blocks list
bunx --bun motion-blocks list --all
bunx --bun motion-blocks infoMotion Blocks reads motion-blocks.json only.
motion-blocks/
├── src/
│ ├── registry/ # Component source — one folder per component
│ │ ├── canvas/ # WebGL/canvas-driven effects (god-rays, globe, fluid-simulation, ...)
│ │ ├── interaction/ # Pointer/scroll-driven interactions (magnetic, marquee, card-stack, ...)
│ │ ├── showcase/ # Larger composed showcase pieces (galleries, sliders, video player)
│ │ ├── text/ # Text/typography effects (text-loop, split-reveal, weight-wave, ...)
│ │ └── <group>/registry.json # Include-based manifest listing the group's published items
│ │
│ ├── pages/
│ │ ├── index.astro # Live preview/demo gallery
│ │ └── docs/ # Docs site (introduction, installation, components, changelog)
│ │
│ ├── components/
│ │ ├── ui/ # Primitive components (e.g. component-card)
│ │ ├── docs/ # Docs-site chrome (nav, sidebar, TOC, preview scripts)
│ │ ├── demos/ # Demo wrappers for the gallery
│ │ └── tests/ # Cross-framework test hosts (React/Svelte/Vue)
│ │
│ ├── layouts/ # Astro layouts
│ ├── content/changelog/ # Changelog content collection
│ ├── styles/ # Tailwind v4 config (global.css, @theme tokens)
│ │
│ └── lib/
│ ├── utils/ # cn() and other small utilities
│ ├── helpers/ # gsap.ts, color.ts, fluid-pointer.ts, svg-sdf.ts
│ ├── audio/, testing/ # UI audio + DOM/spec test helpers
│ └── catalog.ts, changelog.ts
│
├── public/r/ # Static registry JSON served to consumers
│ ├── <name>.json # Individual registry item payloads
│ └── registry.json # Top-level registry manifest
│
├── registry.json # Root composed source registry (include-based)
│
├── packages/
│ └── motion-blocks/ # CLI package (init/add/list/build/info commands)
│ └── src/
│ ├── commands/ # init, add, list, build, info
│ ├── producer/ # discover, validate, generate registry artifacts
│ ├── config/ # motion-blocks.json schema + I/O
│ └── detection/ # framework & package-manager detection
│
├── templates/ # Starter templates for supported frameworks
│ ├── astro/ nextjs/ sveltekit/ vite-react/ vue/
│
├── scripts/
│ └── validate-registry.mjs # Registry validation script (pnpm registry:validate)
│
├── ref/motion-core/ # Read-only Svelte 5 reference library (migration source, not built)
│
└── thoughts/
├── plans/ # Implementation plans (e.g. CLI milestone plans)
├── research/ # Research write-ups (migration trade-offs, CLI research)
└── progress.txt # Running log of completed milestones
- Each component lives in
src/registry/<group>/<name>/as a Web Component (LitLitElementor vanillaHTMLElement), with an opt-incomponent.jsonmanifest describing its registry metadata. - Group-level
src/registry/<group>/registry.jsonfiles include published items into the composed source registry (registry.jsonat the root). motion-blocks buildvalidates the published item graph and regeneratespublic/r/<name>.jsonpluspublic/r/registry.json. Text files get inlined ascontent; assets get generatedurlentries.- The docs catalog, component navigation, and preview registration data derive from the published registry item model. Visible components need
src/components/demos/<name>-demo.astro; preview registrations are derived from-element.tsfiles unlessmeta.docs.previewRegistrationsis needed for supporting elements. - Hidden helper libraries use
type: "registry:lib"withmeta.hidden: true. They stay out of normal docs browsing andmotion-blocks list, but remain available throughmotion-blocks list --all,--type registry:lib, andregistryDependencies. - Consumers install a component with:
The CLI fetches the static payload, resolves registry dependencies, writes files to their
pnpm dlx motion-blocks init pnpm dlx motion-blocks add magnetic
targetpaths, and installs npm dependencies unless disabled.
See AGENTS.md and packages/motion-blocks/README.md for detailed authoring and publishing conventions.
| Command | Description |
|---|---|
pnpm dev |
Start the Astro dev server (preview/demo gallery) |
pnpm build |
Production build to dist/ |
pnpm preview |
Preview the production build |
pnpm registry:validate |
Validate the registry source against the schema |
pnpm registry:build |
Build the CLI and regenerate registry artifacts (run manually by maintainers) |
pnpm registry:build:check |
Same as above, in check-only mode (motion-blocks build --check) |
From the monorepo root:
pnpm --filter motion-blocks build
node packages/motion-blocks/dist/index.js --help
node packages/motion-blocks/dist/index.js add magnetic --dry-run --cwd templates/astroSee packages/motion-blocks/RELEASE.md for the pre-publish checklist.