DavidHDev/svelte-bits
关于
An open source collection of animated, interactive & fully customizable Svelte components for building memorable websites.
网站与应用开发实测星标增长
- 24小时
- 0
- 7天
- +7
- 15天
- +14
- 1个月
- +30
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文Animated Svelte components for websites people remember.
217 free animated components and backgrounds for Svelte.
Tune them yourself, or hand them to your agent.
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.
探索相关项目
加载中…