{"id":21456316,"url":"https://github.com/svey-xyz/simple-shader-component","last_synced_at":"2026-02-16T19:40:19.632Z","repository":{"id":263200829,"uuid":"889247510","full_name":"svey-xyz/simple-shader-component","owner":"svey-xyz","description":"Zero dependency shader component","archived":false,"fork":false,"pushed_at":"2025-01-25T21:48:45.000Z","size":59,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-25T07:36:53.092Z","etag":null,"topics":["art","open-source","published","webdev"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/svey-xyz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-11-15T22:38:48.000Z","updated_at":"2025-01-25T21:47:02.000Z","dependencies_parsed_at":"2024-11-19T07:24:35.353Z","dependency_job_id":"939990ee-6d3c-4dfd-993e-31eb857189ec","html_url":"https://github.com/svey-xyz/simple-shader-component","commit_stats":null,"previous_names":["svey-xyz/shadercomponenet","svey-xyz/simple-shader-component"],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/svey-xyz/simple-shader-component","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/svey-xyz%2Fsimple-shader-component","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/svey-xyz%2Fsimple-shader-component/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/svey-xyz%2Fsimple-shader-component/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/svey-xyz%2Fsimple-shader-component/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/svey-xyz","download_url":"https://codeload.github.com/svey-xyz/simple-shader-component/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/svey-xyz%2Fsimple-shader-component/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29516176,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-16T18:37:19.720Z","status":"ssl_error","status_checked_at":"2026-02-16T18:36:46.920Z","response_time":115,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["art","open-source","published","webdev"],"created_at":"2024-11-23T05:15:20.681Z","updated_at":"2026-02-16T19:40:19.612Z","avatar_url":"https://github.com/svey-xyz.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Simple Shader Component\n*by [svey](https://svey.xyz)*\n\n[![GitHub release (latest by date including pre-releases)](https://img.shields.io/github/v/tag/svey-xyz/simple-shader-component?include_prereleases\u0026sort=semver)](https://GitHub.com/svey-xyz/simple-shader-component/tags/)\n[![GitHub commits](https://badgen.net/github/commits/svey-xyz/simple-shader-component)](https://GitHub.com/svey-xyz/simple-shader-component/commit/)\n[![GNU license v3.0](https://img.shields.io/badge/License-GNU-green.svg)](https://github.com/svey-xyz/simple-shader-component/LICENSE)\n[![Bundle size](https://img.shields.io/bundlejs/size/simple-shader-component)](https://github.com/svey-xyz/simple-shader-component)\n\n## Description\nThis library provides a simple to use webgl shader component, with included framework wrappers and strong typing. Shaders are powerful tools and can be used to add a lot of visual interest to your web project. However, setting-up many shader tools can be complicated and add a large bundle to your project, this library provides a simple core package to make rendering a shader in your DOM incredibly easy.\n\n## Core Concepts\n### Why\nWhile libraries like [three.js](https://threejs.org/) are amazing, not every project requires all the provided features. That's where simple-shader-component comes in; this is a zero-dependency library that provides a simple to use component for rendering GLSL shaders on the web.\n\n## Installation \u0026 Usage\n```zsh\nbun i simple-shader-component\n```\n\nThe base class and types are all exported from the root of the package.\nFramework wrappers are available under sub exports.\n```ts\nimport { SimpleShaderCanvas } from 'simple-shader-component/react'\n```\n***Note**: Right now only the React wrapper is included. If there's interest, or if my workflow requires it, I will add additional wrappers.*\n\n### Hooks\nHooks can be added to any of the class methods, to add a hook you can pass it on construction or using the exposed add hook method.\n\n```tsx\nimport { Shader, MethodName } from 'simple-shader-component' // import types from base package\n\nconst hook = {\n\tmethodName: MethodName.RENDER,\n\thook: (shader: Shader) =\u003e void\n}\n\nShader.addHook(hook) // use addHook method\n\u003cSimpleShaderCanvas args={{ hooks:[hook] }} /\u003e // or pass on construction\n```\n\n### Basic Usage\n'use client' directive is required to set hooks. If you're not using hooks it can be done in a server component.\n\n```tsx\n'use client'\n\nimport { SimpleShaderCanvas } from 'simple-shader-component/react'\nimport { Shader, UniformValue } from 'simple-shader-component'\n\n// Define shaders as strings, or import from a glsl file with a loader\nimport { frag, vert } from '.your-custom-shaders'\n\n// Example uniform to track elapsed time in the shader\nconst uniforms: Array\u003cUniformValue\u003e = [\n\t{\n\t\tname: 'u_time',\n\t\ttype: \"float\",\n\t\tvalue: 0.0\n\t}\n]\n\nexport const Test = () =\u003e {\n\t// Simple hook to update a uniform\n\tconst loopLogic = (shader: Shader) =\u003e {\n\t\tconst uTime: UniformValue = {\n\t\t\tname: 'u_time',\n\t\t\ttype: 'float',\n\t\t\tvalue: shader.getElapsedTime() // Uses exposed method of shader\n\t\t}\n\t\tshader.setUniform(uTime)\n\t}\n\n\t// Define which method to attach the hook to\n\tconst loopHook = {\n\t\tmethodName: MethodName.LOOP,\n\t\thook: loopLogic\n\t}\n\n\t// Render component with args\n\treturn \u003cSimpleShaderCanvas args={{ uniforms: uniforms, fragShader: frag, vertShader: vert, hooks: [loopHook] }} /\u003e\n}\n```\n\n*Coming Soon*\n- improved documentation\n- screenshots \u0026 examples of how shaders as a component can be used to add visual interest\n- roadmap\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsvey-xyz%2Fsimple-shader-component","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsvey-xyz%2Fsimple-shader-component","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsvey-xyz%2Fsimple-shader-component/lists"}