Skip to content

Commit 033d361

Browse files
committed
update readme
1 parent 207565a commit 033d361

1 file changed

Lines changed: 185 additions & 21 deletions

File tree

README.md

Lines changed: 185 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,191 @@
1+
<div align="center">
2+
13
<a href="https://canvasui.dev">
24
<img src=".github/readme.gif" alt="Canvas UI" width="100%" />
35
</a>
46

5-
# Canvas UI
6-
7-
An open source library of creative, framework-agnostic components drawn on canvas. Fluid simulations, shader effects, and 3D scenes that run over your live, fully interactive interface.
8-
9-
**[canvasui.dev](https://canvasui.dev)** · [Docs](https://canvasui.dev/docs) · [Components](https://canvasui.dev/components)
7+
<br />
8+
<br />
9+
10+
<p>
11+
<b>An open source library of creative, framework-agnostic components drawn on canvas.</b><br />
12+
Fluid simulations, shader effects, and 3D scenes that run over your live, fully interactive interface.
13+
</p>
14+
15+
<p>
16+
<a href="https://canvasui.dev"><b>canvasui.dev</b></a> ·
17+
<a href="https://canvasui.dev/docs">Docs</a> ·
18+
<a href="https://canvasui.dev/components">Components</a> ·
19+
<a href="https://canvasui.dev/playground">Playground</a> ·
20+
<a href="https://canvasui.dev/docs/installation">Installation</a>
21+
</p>
22+
23+
<p>
24+
<a href="https://github.com/DavidHDev/canvas-ui/stargazers"><picture><source media="(prefers-color-scheme: dark)" srcset="https://shieldcn.dev/github/stars/DavidHDev/canvas-ui.svg?variant=secondary&size=sm&mode=dark" /><img alt="GitHub stars" src="https://shieldcn.dev/github/stars/DavidHDev/canvas-ui.svg?variant=secondary&size=sm&mode=light" /></picture></a>
25+
<a href="https://github.com/DavidHDev/canvas-ui/actions/workflows/ci.yml"><picture><source media="(prefers-color-scheme: dark)" srcset="https://shieldcn.dev/github/ci/DavidHDev/canvas-ui.svg?variant=secondary&size=sm&mode=dark" /><img alt="CI status" src="https://shieldcn.dev/github/ci/DavidHDev/canvas-ui.svg?variant=secondary&size=sm&mode=light" /></picture></a>
26+
<a href="https://canvasui.dev/components"><picture><source media="(prefers-color-scheme: dark)" srcset="https://shieldcn.dev/badge/components-33.svg?variant=secondary&size=sm&logo=shadcnui&mode=dark" /><img alt="33 components" src="https://shieldcn.dev/badge/components-33.svg?variant=secondary&size=sm&logo=shadcnui&mode=light" /></picture></a>
27+
<a href="LICENSE.md"><picture><source media="(prefers-color-scheme: dark)" srcset="https://shieldcn.dev/badge/license-MIT_+_Commons_Clause.svg?variant=secondary&size=sm&logo=opensourceinitiative&mode=dark" /><img alt="License: MIT + Commons Clause" src="https://shieldcn.dev/badge/license-MIT_+_Commons_Clause.svg?variant=secondary&size=sm&logo=opensourceinitiative&mode=light" /></picture></a>
28+
</p>
29+
30+
<p>
31+
<picture><source media="(prefers-color-scheme: dark)" srcset="https://shieldcn.dev/badge/React.svg?variant=secondary&size=sm&logo=react&logoColor=61DAFB&mode=dark" /><img alt="React" src="https://shieldcn.dev/badge/React.svg?variant=secondary&size=sm&logo=react&logoColor=61DAFB&mode=light" /></picture>
32+
<picture><source media="(prefers-color-scheme: dark)" srcset="https://shieldcn.dev/badge/Vue.svg?variant=secondary&size=sm&logo=vuedotjs&logoColor=4FC08D&mode=dark" /><img alt="Vue" src="https://shieldcn.dev/badge/Vue.svg?variant=secondary&size=sm&logo=vuedotjs&logoColor=4FC08D&mode=light" /></picture>
33+
<picture><source media="(prefers-color-scheme: dark)" srcset="https://shieldcn.dev/badge/Svelte.svg?variant=secondary&size=sm&logo=svelte&logoColor=FF3E00&mode=dark" /><img alt="Svelte" src="https://shieldcn.dev/badge/Svelte.svg?variant=secondary&size=sm&logo=svelte&logoColor=FF3E00&mode=light" /></picture>
34+
<picture><source media="(prefers-color-scheme: dark)" srcset="https://shieldcn.dev/badge/Solid.svg?variant=secondary&size=sm&logo=solid&logoColor=4F88C6&mode=dark" /><img alt="Solid" src="https://shieldcn.dev/badge/Solid.svg?variant=secondary&size=sm&logo=solid&logoColor=4F88C6&mode=light" /></picture>
35+
<picture><source media="(prefers-color-scheme: dark)" srcset="https://shieldcn.dev/badge/Preact.svg?variant=secondary&size=sm&logo=preact&logoColor=673AB8&mode=dark" /><img alt="Preact" src="https://shieldcn.dev/badge/Preact.svg?variant=secondary&size=sm&logo=preact&logoColor=673AB8&mode=light" /></picture>
36+
<picture><source media="(prefers-color-scheme: dark)" srcset="https://shieldcn.dev/badge/TypeScript.svg?variant=secondary&size=sm&logo=typescript&logoColor=3178C6&mode=dark" /><img alt="TypeScript" src="https://shieldcn.dev/badge/TypeScript.svg?variant=secondary&size=sm&logo=typescript&logoColor=3178C6&mode=light" /></picture>
37+
</p>
38+
39+
</div>
1040

1141
## What makes it different
1242

13-
Most of the library is built on the experimental [HTML-in-canvas](https://chromestatus.com/feature/5172548013916160) API, which lets WebGL effects read and redraw your live DOM. Text stays selectable, links stay clickable, and the whole page becomes a texture that fire, fluid, and glass can distort in real time.
14-
15-
Where html-in-canvas is not supported, components degrade gracefully to pure WebGL overlays, so every visitor gets a working page.
16-
17-
- **33 components** and counting: Liquid, Glass, Shatter, VHS, Particle Reveal, Force Field, Decrypt Reveal, and more
18-
- **Framework agnostic**: React, Solid, Preact, Vue, Svelte, and vanilla JS builds for every component
19-
- **Copy, do not install**: components ship as source through a shadcn-compatible registry
20-
- **Zero config**: each component is self-contained with sensible defaults and typed props
21-
- **MCP ready**: point the shadcn MCP server at the registry and let your AI assistant install components
43+
Most components use the experimental [HTML-in-canvas](https://chromestatus.com/feature/5172548013916160) API to read and redraw your live DOM. Text stays selectable, links stay clickable, and the page becomes a texture that fire, fluid, and glass distort in real time.
44+
45+
Where it is not supported, components fall back to WebGL overlays, so every visitor gets a working page.
46+
47+
<table>
48+
<tr>
49+
<td align="center">🎨</td>
50+
<td><b>33 components</b> and counting: Liquid, Glass, Shatter, Force Field, Decrypt Reveal, and more</td>
51+
</tr>
52+
<tr>
53+
<td align="center">🧩</td>
54+
<td><b>Framework agnostic</b>: every component ships for React, Solid, Preact, Vue, Svelte, and vanilla</td>
55+
</tr>
56+
<tr>
57+
<td align="center">📋</td>
58+
<td><b>Copy, do not install</b>: source lands in your repo via a shadcn-compatible registry</td>
59+
</tr>
60+
<tr>
61+
<td align="center">⚡</td>
62+
<td><b>Zero config</b>: self-contained, with sensible defaults and typed props</td>
63+
</tr>
64+
<tr>
65+
<td align="center">🤖</td>
66+
<td><b>MCP ready</b>: let your AI assistant find and install components for you</td>
67+
</tr>
68+
</table>
2269

2370
## Quick start
2471

25-
Add a component with the shadcn CLI (run `npx shadcn@latest init` first if you have not used it before):
72+
Add a component with the shadcn CLI (run `npx shadcn@latest init` first if you have not):
2673

2774
```bash
2875
npx shadcn@latest add @canvas-ui/liquid-react
2976
```
3077

31-
Swap `liquid` for any component and `react` for `solid`, `preact`, `vue`, `svelte`, or `vanilla`. The source lands in `components/canvasui/` in your project, yours to edit.
78+
Swap `liquid` for any component, `react` for `solid`, `preact`, `vue`, `svelte`, or `vanilla`. Source lands in `components/canvasui/`, yours to edit.
79+
80+
```tsx
81+
import { Liquid } from "@/components/canvasui/Liquid";
82+
83+
export default function Page() {
84+
return (
85+
<Liquid>
86+
<YourEntirePage />
87+
</Liquid>
88+
);
89+
}
90+
```
91+
92+
Most components wrap your content. The subtree stays live and interactive; the effect runs on top.
93+
94+
See the [installation guide](https://canvasui.dev/docs/installation) for manual setup.
95+
96+
## Components
97+
98+
Every component ships for all six targets. Compare them in the [playground](https://canvasui.dev/playground).
99+
100+
<details open>
101+
<summary><b>🌊 Fluid &amp; motion</b></summary>
102+
103+
| Component | What it does | Component | What it does |
104+
| --------------------------------------------------------- | ------------------------------------ | --------------------------------------------------------------------- | -------------------------------------- |
105+
| [**Liquid**](https://canvasui.dev/docs/components/liquid) | Pointer-driven fluid simulation | [**Ripple**](https://canvasui.dev/docs/components/ripple) | Water ripples from every click |
106+
| [**Cloth**](https://canvasui.dev/docs/components/cloth) | Fabric rippling in the wind | [**Droplets**](https://canvasui.dev/docs/components/droplets) | Rain running down the screen |
107+
| [**Bubble**](https://canvasui.dev/docs/components/bubble) | Metaball droplet trailing the cursor | [**Displacement**](https://canvasui.dev/docs/components/displacement) | Grid that ripples away from the cursor |
108+
109+
</details>
110+
111+
<details open>
112+
<summary><b>🔥 Fire &amp; energy</b></summary>
113+
114+
| Component | What it does | Component | What it does |
115+
| ------------------------------------------------------------------- | ----------------------------------- | ----------------------------------------------------------------- | ----------------------------------- |
116+
| [**Blaze**](https://canvasui.dev/docs/components/blaze) | Sparks, smoke, and heat distortion | [**Flame Wrap**](https://canvasui.dev/docs/components/flame-wrap) | Border of fire around any element |
117+
| [**Force Field**](https://canvasui.dev/docs/components/force-field) | Energy shield with click shockwaves | [**Laser**](https://canvasui.dev/docs/components/laser) | Beam that reveals content on scroll |
118+
119+
</details>
120+
121+
<details open>
122+
<summary><b>💎 Glass &amp; optics</b></summary>
123+
124+
| Component | What it does | Component | What it does |
125+
| ----------------------------------------------------------- | ----------------------------------------- | --------------------------------------------------------- | --------------------------------------------- |
126+
| [**Glass**](https://canvasui.dev/docs/components/glass) | Crystal-ball lens that follows the cursor | [**Frost**](https://canvasui.dev/docs/components/frost) | Ice that melts under the cursor and refreezes |
127+
| [**Magnify**](https://canvasui.dev/docs/components/magnify) | Sci-fi scanner lens with a HUD reticle | [**Bend**](https://canvasui.dev/docs/components/bend) | Folds the page like the face of a cube |
128+
| [**Peel**](https://canvasui.dev/docs/components/peel) | Peels back to reveal a second layer | [**Clouds**](https://canvasui.dev/docs/components/clouds) | Mist parted by cursor wind |
129+
130+
</details>
32131

33-
See the [installation guide](https://canvasui.dev/docs/installation) for manual setup and framework notes.
132+
<details open>
133+
<summary><b>📼 Retro &amp; glitch</b></summary>
134+
135+
| Component | What it does | Component | What it does |
136+
| ------------------------------------------------------------------------- | --------------------------------------- | ----------------------------------------------------------------- | ------------------------------------- |
137+
| [**VHS**](https://canvasui.dev/docs/components/vhs) | Worn tape wave, chroma bleed, and grain | [**Glitch**](https://canvasui.dev/docs/components/glitch) | Broadcast tearing with RGB splits |
138+
| [**Retro Dither**](https://canvasui.dev/docs/components/retro-dither) | Dither lens that pixelates the page | [**Asciify**](https://canvasui.dev/docs/components/asciify) | ASCII lens that follows the cursor |
139+
| [**Decrypt Reveal**](https://canvasui.dev/docs/components/decrypt-reveal) | Cipher text decrypting at the cursor | [**Glyph Rain**](https://canvasui.dev/docs/components/glyph-rain) | Falling glyphs that light up the page |
140+
141+
</details>
142+
143+
<details open>
144+
<summary><b>✨ Particles &amp; structure</b></summary>
145+
146+
| Component | What it does | Component | What it does |
147+
| --------------------------------------------------------------------------- | ------------------------------------- | --------------------------------------------------------------------------- | -------------------------------------- |
148+
| [**Particle Reveal**](https://canvasui.dev/docs/components/particle-reveal) | Particles merging into crisp UI | [**Particle Scroll**](https://canvasui.dev/docs/components/particle-scroll) | Sand that reassembles on scroll |
149+
| [**Shatter**](https://canvasui.dev/docs/components/shatter) | 3D glass shards that lift and refract | [**Grid**](https://canvasui.dev/docs/components/grid) | 3D tiles rippling around the cursor |
150+
| [**Hex Float**](https://canvasui.dev/docs/components/hex-float) | Floating hex tiles with cursor lift | [**Canvas**](https://canvasui.dev/docs/components/canvas) | Woven canvas you drag wet paint across |
151+
152+
</details>
153+
154+
<details open>
155+
<summary><b>🧊 3D effects</b>: no flag needed, these work everywhere</summary>
156+
157+
Point these at a GLB/glTF model, SVG, or image to render it as a 3D scene.
158+
159+
| Component | What it does | Component | What it does |
160+
| --------------------------------------------------------------------------- | -------------------------------------- | --------------------------------------------------------------------------- | --------------------------------- |
161+
| [**ASCII Object**](https://canvasui.dev/docs/components/ascii-object) | Redrawn as shape-matched ASCII | [**Glass Object**](https://canvasui.dev/docs/components/glass-object) | Liquid glass with real dispersion |
162+
| [**Particle Object**](https://canvasui.dev/docs/components/particle-object) | Particles that scatter and spring back | [**Dithered Object**](https://canvasui.dev/docs/components/dithered-object) | Rendered through a 1-bit dither |
163+
| [**Liquid Object**](https://canvasui.dev/docs/components/liquid-object) | Dragged through swirling liquid | | |
164+
165+
</details>
34166

35167
## Browser support
36168

37-
The full html-in-canvas experience currently requires Chrome or Edge 140+ with the `chrome://flags/#canvas-draw-element` flag enabled (for production sites, an [origin trial](https://canvasui.dev/docs/installation) token is available). Everywhere else, components automatically fall back to WebGL overlay rendering. Details in the [docs](https://canvasui.dev/docs).
169+
| Browser | HTML-in-canvas components | 3D effect components |
170+
| ------------------------------------------------------------------------------ | :-----------------------: | :------------------: |
171+
| Chrome with the [flag or origin trial](https://canvasui.dev/docs/installation) | ✅ Full effect | ✅ Full effect |
172+
| Everything else | ⚠️ WebGL overlay fallback | ✅ Full effect |
173+
174+
Html-in-canvas needs Chrome with the `chrome://flags/#canvas-draw-element` flag. An [origin trial](https://canvasui.dev/docs/installation) token lifts that for your visitors. That is how canvasui.dev runs in a plain Chrome install. Details in the [docs](https://canvasui.dev/docs).
175+
176+
## Use with AI
177+
178+
The registry is [MCP](https://canvasui.dev/docs/mcp) ready, so your assistant can browse and install components:
179+
180+
```bash
181+
npx shadcn@latest mcp init --client claude
182+
```
183+
184+
Works with Claude Code, Cursor, VS Code, Codex, and OpenCode. Then just ask: _"add the Liquid component from Canvas UI"_.
38185

39186
## Development
40187

41-
This repo contains the library source (`src/lib`), the documentation site (Next.js 16, Tailwind v4, deployed to Cloudflare Workers), and the registry build.
188+
This repo holds the library source, the docs site (Next.js 16, Tailwind v4, on Cloudflare Workers), and the registry build.
42189

43190
```bash
44191
npm install
@@ -47,10 +194,27 @@ npm run build # production build
47194
npm run deploy # build and deploy to Cloudflare
48195
```
49196

197+
| Path | What lives here |
198+
| ---------------------------- | ------------------------------------------------------- |
199+
| `src/lib/<Component>/` | The engine (`*Vanilla.ts`) plus five framework wrappers |
200+
| `src/demos/` | Interactive demo and controls for each component |
201+
| `src/app/` | Documentation site routes |
202+
| `scripts/build-registry.mts` | Generates `public/r/*.json` for the shadcn CLI |
203+
204+
Each component is one engine in plain TypeScript and WebGL, with thin framework wrappers. Nothing depends on anything else, and the engine defines its own props.
205+
50206
## Contributing
51207

52-
Issues and pull requests are welcome. See [CONTRIBUTING.md](.github/CONTRIBUTING.md) to get started.
208+
Issues and pull requests welcome. See [CONTRIBUTING.md](.github/CONTRIBUTING.md).
53209

54210
## License
55211

56-
[MIT + Commons Clause](LICENSE.md). Free to use in your own projects, commercial or not. The Commons Clause only restricts selling the library itself.
212+
[MIT + Commons Clause](LICENSE.md). Free in your own projects, commercial or not. The Commons Clause only restricts selling the library itself.
213+
214+
<div align="center">
215+
<br />
216+
<sub>Built by <a href="https://github.com/DavidHDev">David Haz</a> · <a href="https://x.com/davidhdev">@davidhdev</a></sub>
217+
<br /><br />
218+
<a href="https://canvasui.dev"><b>canvasui.dev</b></a>
219+
220+
</div>

0 commit comments

Comments
 (0)