# react-glsl-canvas

> React component for rendering GLSL shaders. Based on `glsl-canvas-js`

Latest version **1.0.0-alpha.6** (published 2023-08-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install react-glsl-canvas
pnpm add react-glsl-canvas
yarn add react-glsl-canvas
bun add react-glsl-canvas
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0-alpha.6 |
| Published | 2023-08-06 |
| First published | 2023-07-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 556.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Feodor Rusanov |
| Maintainers | frusanov |
| Keywords | react, glsl, shader, canvas, webgl, glsl-canvas-js |

## Links

- npm: https://www.npmjs.com/package/react-glsl-canvas
- Repository: https://github.com/frusanov/react-glsl-canvas
- Homepage: https://frusanov.github.io/react-glsl-canvas/
- Issues: https://github.com/frusanov/react-glsl-canvas/issues
- npm.io page: https://npm.io/package/react-glsl-canvas

## Dependencies (1)

- [glsl-canvas-js](https://npm.io/package/glsl-canvas-js.md) ^0.2.9

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.0.0-alpha.6 (latest) — 2023-08-06
- 1.0.0-alpha.5 — 2023-07-09
- 1.0.0-alpha.4 — 2023-07-09
- 1.0.0-alpha.3 — 2023-07-09
- 1.0.0-alpha.1 — 2023-07-09

## README

> WARNING! This library is in early development stage. Use it at your own risk.

React GLSL is a library that allows you to rander GLSL shaders inside React components.

Props of GLSL component are passed to the underlying [glsl-canvas-js](https://github.com/actarian/glsl-canvas) instance as options.

```bash
npm install react-glsl-canvas
# or
yarn add react-glsl-canvas
```

```typescript
import React from 'react';
import { GLSL } from 'react-glsl-canvas';
import shader from './shader.glsl';

export const App = () => {
  return (
    <GLSL fragmentString={shader} />
  );
}
```

```glsl
precision mediump float;

uniform float u_time;
uniform vec2 u_mouse;
uniform vec2 u_resolution;

void main() {
  vec2 st = gl_FragCoord.xy/u_resolution.xy;
  gl_FragColor = vec4(st.x,st.y,0.0,1.0);
}
```

---
_Source: https://npm.io/package/react-glsl-canvas · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
