Skip to content

About

An open source collection of animated, interactive & fully customizable Svelte components for building memorable websites.

Topics

Resources

Stars

414 stars

Watchers

3 watching

Forks

Repository files navigation


Svelte Bits

Animated Svelte components for websites people remember.

217 free animated components and backgrounds for Svelte.
Tune them yourself, or hand them to your agent.

GitHub stars License: MIT + Commons Clause

Documentation · Installation · MCP · Browse · Changelog


What's inside

Svelte Bits is the official Svelte port of React Bits. Every component is a single Svelte 5 file written in TypeScript and styled with Tailwind, so there is one file to copy and nothing else to wire up. Ports keep the original dependencies, shaders, physics and props.

Category Count What you'll find
Text Animations 33 Split text, typewriters, rotating words and scroll reveals
Animations 38 Cursor effects, hover interactions, borders and image effects
Components 48 Cards, navigation, carousels and galleries
Micro 34 Buttons, toggles, indicators and other small interface details
Backgrounds 64 Gradients, particles, grids and shader effects for whole sections

The docs site gives every component a live demo with controls, and many of them come with presets to start from. You can search the whole library, browse it by category, save favorites, and switch between dark and light mode.

Installation

Add any component with the shadcn CLI, using the component's name in kebab case:

npx shadcn@latest add https://sveltebits.xyz/r/split-text.json

Or with jsrepo:

npx jsrepo add https://sveltebits.xyz/r/split-text.json

On pnpm, Yarn or Bun, replace npx with pnpm dlx, yarn dlx or bunx --bun.

Prefer to copy by hand? Open a component's Code tab, paste the file into your project (for example src/lib/components/SplitText.svelte) and install the dependencies it lists. The installation guide covers both.

Usage

<script lang="ts">
  import SplitText from '$lib/components/SplitText.svelte';
</script>

<SplitText text="Hello, you!" delay={100} duration={0.6} />

Use it with your agent

Svelte Bits works with the shadcn MCP server, so Claude Code, Cursor, Codex, VS Code and Antigravity can find and add components for you. Add the registry to your components.json:

{
  "registries": {
    "@sveltebits": "https://sveltebits.xyz/r/{name}.json"
  }
}

Then connect your client, for example npx shadcn@latest mcp init --client claude, and ask for what you need. See the MCP guide for every client.

Local development

npm install
npm run dev

npm run dev starts the site and rebuilds the component registry in static/r/ when components change. Other scripts:

Command What it does
npm run registry:build Builds the registry once with jsrepo
npm run build Builds the production site
npm run check Runs Svelte diagnostics

Cloudflare deployment

The site uses @sveltejs/adapter-cloudflare in svelte.config.js and a Worker-style wrangler.jsonc. Build with npm run build, then deploy with npx wrangler deploy.

The build output goes to .svelte-kit/cloudflare, with the Worker entry at .svelte-kit/cloudflare/_worker.js and static assets served from the same directory through the ASSETS binding. When deploying through the Cloudflare dashboard, use:

Setting Value
Build command npm run build
Build output directory .svelte-kit/cloudflare
Node.js version 20 or newer

Community

Contributing. Ideas and fixes are welcome. Browse the open issues or open a new one before sending a pull request. Component ports must match the React Bits original as closely as possible, including dependencies, shaders, spring configs, props and behavior.

Other versions. Svelte Bits is a port of React Bits, which is also available for Vue.

Credit

React Bits, and so Svelte Bits, occasionally draws inspiration from publicly available code examples. These are rewritten as full-fledged, customizable components. If you recognize your work, open an issue to request credit.

License

MIT + Commons Clause, free for personal and commercial use. Created and maintained by David Haz.

About

An open source collection of animated, interactive & fully customizable Svelte components for building memorable websites.

Topics

Resources

Stars

414 stars

Watchers

3 watching

Forks

Contributors

Languages