@lovo/matter-react 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Hunter Garrett / Lovo
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,60 @@
1
+ # @lovo/matter-react
2
+
3
+ React binding for **Matter** — shader components on WebGPU + Three.js TSL.
4
+
5
+ This package wraps the engine ([`@lovo/matter`](https://www.npmjs.com/package/@lovo/matter)) with React-friendly primitives: a shared `<MatterScene>` canvas, a `useShaderMaterial` hook for `@react-three/fiber` integration, and input hooks (`useCursor`, `useScroll`).
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ npm install @lovo/matter @lovo/matter-react react three
11
+ ```
12
+
13
+ `react` (^19), `@lovo/matter`, and `three` (^0.170) are peer dependencies.
14
+
15
+ ## Three rendering modes
16
+
17
+ Matter components work in three configurations:
18
+
19
+ 1. **Drop-in** — each component manages its own canvas. Simplest path; one canvas per effect.
20
+ 2. **Shared scene** — wrap multiple Matter components in a single `<MatterScene>` to share one canvas (faster, layered effects).
21
+ 3. **Inside `@react-three/fiber`** — use `useShaderMaterial` directly inside a r3f `<Canvas>` you already own.
22
+
23
+ ## Minimal usage (Mode 2: shared scene)
24
+
25
+ ```tsx
26
+ import { MatterScene } from '@lovo/matter-react'
27
+ // LinearGradient is copy-pasted into your project via @lovo/matter-cli
28
+ import { LinearGradient } from '@/components/matter/linear-gradient'
29
+
30
+ export default function Hero() {
31
+ return (
32
+ <MatterScene>
33
+ <LinearGradient
34
+ colors={['#0b0c2a', '#1d1f57', '#7d2dff']}
35
+ angle={120}
36
+ />
37
+ </MatterScene>
38
+ )
39
+ }
40
+ ```
41
+
42
+ ## Getting components
43
+
44
+ Polished drop-in components (`<LinearGradient>`, `<Aurora>`, `<DotField>`, `<NoiseField>`, `<MeshGradient>`, `<Waves>`) ship via the shadcn-style copy-paste CLI. Install it once:
45
+
46
+ ```bash
47
+ npm install -D @lovo/matter-cli
48
+ npx matter-cli init
49
+ npx matter-cli add linear-gradient
50
+ ```
51
+
52
+ The component lands in `src/components/matter/linear-gradient.tsx` and is yours to edit.
53
+
54
+ ## Docs
55
+
56
+ <https://github.com/lovo-hq/matter>
57
+
58
+ ## License
59
+
60
+ MIT — see [LICENSE](./LICENSE).