@instantshader/react 0.3.0 → 0.4.1

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/README.md CHANGED
@@ -1,9 +1,9 @@
1
1
  # @instantshader/react
2
2
 
3
3
  React bindings for [instantshader](https://www.npmjs.com/package/instantshader), a
4
- zero-dependency animated WebGL gradient engine. Drop a `<Flow>` or `<Beam>`
5
- component into any sized wrapper to mount a live, animated gradient. Built by
6
- [InstantGradient](https://instantgradient.com/shaders).
4
+ zero-dependency animated WebGL gradient engine. Drop a `<Flow>`, `<Beam>` or
5
+ `<Bloom>` component into any sized wrapper to mount a live, animated gradient. Built by
6
+ [InstantGradient](https://instantgradient.com/app).
7
7
 
8
8
  ## Install
9
9
 
@@ -26,6 +26,32 @@ export function Background() {
26
26
  }
27
27
  ```
28
28
 
29
+ ## Shaders
30
+
31
+ One component per shader, each a thin wrapper over the same props:
32
+
33
+ | Component | Look | Params |
34
+ | --- | --- | --- |
35
+ | `<Flow>` | Isotropic swirling currents with defined luminous edges and calm negative space. | `scale`, `curl`, `drift`, `openness`, `grain` |
36
+ | `<Beam>` | One wide beam of soft light crossing a near-black frame, the palette walking its length. | `scale`, `width`, `glow`, `angle`, `grain` |
37
+ | `<Bloom>` | A fan of huge soft petals radiating from the bottom edge, palette as concentric scalloped bands. | `scale`, `petals`, `pinch`, `bend`, `sway`, `colorflow`, `grain` |
38
+
39
+ ```tsx
40
+ import { Bloom } from "@instantshader/react";
41
+
42
+ <Bloom
43
+ colors={["#ffd9e8", "#ffb300", "#ff8fc0", "#3d7bff", "#0a2e14"]}
44
+ // bloom has two independent motion modes: petals that breathe and lean,
45
+ // and colours that travel outward through a still pattern.
46
+ params={{ sway: 0.5, colorflow: 0.4 }}
47
+ style={{ width: "100%", height: "100%" }}
48
+ />;
49
+ ```
50
+
51
+ See the [`instantshader` README](https://www.npmjs.com/package/instantshader)
52
+ for what each param does and for the shader defs themselves (re-exported from
53
+ here as `flow`, `beam` and `bloom`).
54
+
29
55
  ## Seamless loops
30
56
 
31
57
  Pass `loopSeconds` to make the animation repeat exactly, with no visible seam
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { CSSProperties, ReactElement } from "react";
2
- import { ParamDef, ShaderDef, ShaderDef as ShaderDef$1, beam, flow } from "instantshader";
2
+ import { ParamDef, ShaderDef, ShaderDef as ShaderDef$1, beam, bloom, flow } from "instantshader";
3
3
 
4
4
  //#region src/ShaderCanvas.d.ts
5
5
  interface ShaderCanvasProps {
@@ -53,5 +53,6 @@ declare function ShaderCanvas({
53
53
  //#region src/shaders.d.ts
54
54
  declare function Flow(props: Omit<ShaderCanvasProps, "shader">): ReactElement;
55
55
  declare function Beam(props: Omit<ShaderCanvasProps, "shader">): ReactElement;
56
+ declare function Bloom(props: Omit<ShaderCanvasProps, "shader">): ReactElement;
56
57
  //#endregion
57
- export { Beam, Flow, type ParamDef, ShaderCanvas, type ShaderCanvasProps, type ShaderDef, beam, flow };
58
+ export { Beam, Bloom, Flow, type ParamDef, ShaderCanvas, type ShaderCanvasProps, type ShaderDef, beam, bloom, flow };
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use client";
2
2
  import { useEffect, useMemo, useRef } from "react";
3
- import { beam, beam as beam$1, flow, flow as flow$1, mountGradient } from "instantshader";
3
+ import { beam, beam as beam$1, bloom, bloom as bloom$1, flow, flow as flow$1, mountGradient } from "instantshader";
4
4
  import { jsx } from "react/jsx-runtime";
5
5
 
6
6
  //#region src/ShaderCanvas.tsx
@@ -73,6 +73,12 @@ function Beam(props) {
73
73
  ...props
74
74
  });
75
75
  }
76
+ function Bloom(props) {
77
+ return /* @__PURE__ */ jsx(ShaderCanvas, {
78
+ shader: bloom$1,
79
+ ...props
80
+ });
81
+ }
76
82
 
77
83
  //#endregion
78
- export { Beam, Flow, ShaderCanvas, beam, flow };
84
+ export { Beam, Bloom, Flow, ShaderCanvas, beam, bloom, flow };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instantshader/react",
3
- "version": "0.3.0",
3
+ "version": "0.4.1",
4
4
  "description": "React bindings for InstantShader animated WebGL gradients.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -9,7 +9,7 @@
9
9
  "url": "git+https://github.com/ugolbck/instantshader.git",
10
10
  "directory": "packages/react"
11
11
  },
12
- "homepage": "https://instantgradient.com/shaders",
12
+ "homepage": "https://instantgradient.com/app",
13
13
  "exports": {
14
14
  ".": {
15
15
  "types": "./dist/index.d.ts",
@@ -36,7 +36,7 @@
36
36
  "react"
37
37
  ],
38
38
  "dependencies": {
39
- "instantshader": "0.3.0"
39
+ "instantshader": "0.4.1"
40
40
  },
41
41
  "peerDependencies": {
42
42
  "react": "^18 || ^19",