{"id":17689917,"url":"https://github.com/cdaein/ssam-react","last_synced_at":"2026-01-30T16:07:10.150Z","repository":{"id":240823545,"uuid":"803542826","full_name":"cdaein/ssam-react","owner":"cdaein","description":"Use Ssam.js creative coding sketches in a React application","archived":false,"fork":false,"pushed_at":"2024-12-03T18:27:22.000Z","size":70,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-10T22:54:02.365Z","etag":null,"topics":["canvas","create-ssam","creative-coding","react","ssam"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cdaein.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}},"created_at":"2024-05-20T23:35:17.000Z","updated_at":"2024-12-03T18:27:26.000Z","dependencies_parsed_at":"2024-05-21T02:10:39.511Z","dependency_job_id":"fa8bde29-3727-4e77-ab90-795091b37b52","html_url":"https://github.com/cdaein/ssam-react","commit_stats":null,"previous_names":["cdaein/ssam-react"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdaein%2Fssam-react","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdaein%2Fssam-react/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdaein%2Fssam-react/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cdaein%2Fssam-react/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cdaein","download_url":"https://codeload.github.com/cdaein/ssam-react/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248312172,"owners_count":21082638,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["canvas","create-ssam","creative-coding","react","ssam"],"created_at":"2024-10-24T11:49:17.230Z","updated_at":"2026-01-30T16:07:05.128Z","avatar_url":"https://github.com/cdaein.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ssam-react\n\nUse [Ssam.js](https://github.com/cdaein/ssam) sketch in React apps.\n\n\u003e ⚠️ This is an early version. If you find any issues, please report using the Issues tab.\n\n## Installation\n\n```sh\nnpm i ssam-react\n```\n\n## How-to\n\nWrite a Ssam.js sketch as usual and export both `sketch` and `settings`:\n\n```ts\n// sketch.ts\n\nexport const sketch: Sketch\u003c\"2d\"\u003e = ({ wrap, context }) =\u003e {\n  wrap.render = ({ width, height }) =\u003e {\n    // ...\n  };\n};\n\nexport const settings: SketchSettings = {\n  duration: 6_000,\n  // ...\n};\n```\n\nIn your React app, import `\u003cSsamReact\u003e` component and pass the `sketch` and `settings` props:\n\n```jsx\n// App.tsx\n\nimport SsamReact from \"ssam-react\";\nimport { sketch, settings } from \"./sketch\";\n\nexport function default App() {\n  return (\n    \u003c\u003e\n      \u003cOtherStuff /\u003e\n      \u003cSsamReact sketch={sketch} settings={settings} /\u003e\n    \u003c\u003e\n  )\n}\n```\n\n## Notes\n\n- When `settings.dimensions` is not set (`undefined`), Ssam will use scale to its parent element's width and height. Make sure to set the width and height of the parent element.\n- If you want the fixed size Ssam canvas, set `settings.scaleToParent` to `false`.\n- Known issue: Even with clean up, event listeners are registered twice in `React.Strict` (is that normal?).\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcdaein%2Fssam-react","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcdaein%2Fssam-react","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcdaein%2Fssam-react/lists"}