{"id":28332195,"url":"https://github.com/cobaltinc/atelier","last_synced_at":"2025-08-10T07:06:23.668Z","repository":{"id":50617542,"uuid":"390977172","full_name":"cobaltinc/atelier","owner":"cobaltinc","description":"Expandable drawing component for React built by Cobalt, Inc.","archived":false,"fork":false,"pushed_at":"2023-05-25T12:41:59.000Z","size":1345,"stargazers_count":46,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-08-02T03:34:00.529Z","etag":null,"topics":["canvas","drawing","react"],"latest_commit_sha":null,"homepage":"https://cobaltinc.github.io/atelier","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/cobaltinc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","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":"2021-07-30T07:43:49.000Z","updated_at":"2024-10-14T15:01:51.000Z","dependencies_parsed_at":"2024-06-21T14:22:44.210Z","dependency_job_id":"c09e29a5-b1eb-4036-a699-01981b6e8bf0","html_url":"https://github.com/cobaltinc/atelier","commit_stats":{"total_commits":40,"total_committers":1,"mean_commits":40.0,"dds":0.0,"last_synced_commit":"e0ea987e3d893592322393a9b464518296974996"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/cobaltinc/atelier","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cobaltinc%2Fatelier","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cobaltinc%2Fatelier/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cobaltinc%2Fatelier/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cobaltinc%2Fatelier/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cobaltinc","download_url":"https://codeload.github.com/cobaltinc/atelier/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cobaltinc%2Fatelier/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269688398,"owners_count":24459455,"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","status":"online","status_checked_at":"2025-08-10T02:00:08.965Z","response_time":71,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["canvas","drawing","react"],"created_at":"2025-05-26T19:42:05.175Z","updated_at":"2025-08-10T07:06:23.661Z","avatar_url":"https://github.com/cobaltinc.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align='center'\u003e\n  Atelier 🎨\n\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\u003cstrong\u003eExpandable drawing component for React built by \u003ca href=\"https://cobalt.run\"\u003eCobalt, Inc.\u003c/a\u003e\u003c/strong\u003e\u003c/p\u003e\n\n\u003cp align='center'\u003e\n  \u003ca href=\"https://cobalt.run\"\u003e\n    \u003cimg src=\"https://badgen.net/badge/icon/Made%20by%20Cobalt?icon=https://caple-static.s3.ap-northeast-2.amazonaws.com/cobalt-badge.svg\u0026label\u0026color=5B69C3\u0026labelColor=414C9A\" /\u003e\n  \u003c/a\u003e\n  \u003ca href='https://www.npmjs.com/package/@cobaltinc/atelier'\u003e\n    \u003cimg src='https://img.shields.io/npm/v/@cobaltinc/atelier.svg' alt='Latest npm version'\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/cobaltinc/atelier/blob/master/.github/CONTRIBUTING.md\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/PRs-welcome-brightgreen.svg\" alt=\"PRs welcome\" /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n## :rocket: Getting started\n\n```bash\nnpm install @cobaltinc/atelier # or yarn add @cobaltinc/atelier\n```\n\n```jsx\nimport React from 'react'\nimport { Atelier } from '@cobaltinc/atelier'\n\n\u003cAtelier /\u003e\n```\n\nDemo page: [`https://cobaltinc.github.io/atelier`](https://cobaltinc.github.io/atelier)\n\n### Props\n\nProp | Description | Default\n---- | ----------- | -------\n`command` | Set the name of registered plugin | `pen`\n`color` | Set the color of the line | `#000000`\n`lineWidth` | Set the width of the line | `2`\n`width` | Set the width of the DOM | `800`\n`height` | Set the height of the DOM | `600`\n`canvasWidth` | Set the width of the canvas\n`canvasHeight` | Set the height of the canvas\n`enableDraw` | Set to `true` or `false` to enable or disable draw the canvas | `true`\n`enablePressure` | Set to `true` or `false` to enable or disable pressure the canvas | `false`\n`plugins` | Register the plugins to use | `[PenPlugin]`\n`style` | Add inline styles to the root element\n`className` | Add className to the root element\n`onChange(e: AtelierChangeEvent)` | Fired when an alteration to canvas is commited\n\n### Instance Methods\nUse `ref` to call instance methods. See the [demo page](https://cobaltinc.github.io/atelier) for an example of this.\nProp | Description\n---- | -----------\n`draw(e: DrawingInterface)` | Draw programmatically on the canvas\n`clear()` | Erase everything on the canvas\n\n## 🖋️ Default Plugins\n\u003ctable\u003e\n  \u003ctr\u003e\n    \u003cth\u003ePenPlugin\u003c/th\u003e\u003cth\u003eBrushPlugin\u003cbr/\u003e(Support pressure)\u003c/th\u003e\u003cth\u003eErasePlugin\u003c/th\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e\u003cimg src=\"https://user-images.githubusercontent.com/3623695/141398823-7fe13e29-cbf7-4ae3-84fa-b14e88659148.gif\" width='187' alt=\"PenPlugin gif\"\u003e\u003c/td\u003e\n    \u003ctd\u003e\u003cimg src=\"https://user-images.githubusercontent.com/3623695/141398991-4f70f01f-59bd-494e-9f69-ce39372af698.gif\" width='187' alt=\"BrushPlugin gif\"\u003e\u003c/td\u003e\n    \u003ctd\u003e\u003cimg src=\"https://user-images.githubusercontent.com/3623695/141399191-aa396b83-7e05-4c5d-b075-3b8ebd701274.gif\" width='187' alt=\"ErasePlugin gif\"\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003cth\u003eHighlighterPlugin\u003c/th\u003e\u003cth\u003eLaserPlugin\u003c/th\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd\u003e\u003cimg src=\"https://user-images.githubusercontent.com/3623695/141399532-d29a3454-d5c0-45f3-a4df-6f8794f382bd.gif\" width='187' alt=\"HighlighterPlugin gif\"\u003e\u003c/td\u003e\n    \u003ctd\u003e\u003cimg src=\"https://user-images.githubusercontent.com/3623695/141399656-677cb722-8556-477d-8106-635d548c350c.gif\" width='187' alt=\"LaserPlugin gif\"\u003e\u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n```jsx\nimport React from 'react'\nimport {\n  Atelier,\n  PenPlugin,\n  BrushPlugin,\n  ErasePlugin,\n  HighlighterPlugin,\n  LaserPlugin\n} from '@cobaltinc/atelier'\n\n\u003cAtelier plugins={[PenPlugin, BrushPlugin, ErasePlugin, HighlighterPlugin, LaserPlugin]} /\u003e\n```\n\n## 🖌️ Custom Plugin\n\nIf you want new plugin, you can make easily.\n\n```tsx\nclass DashPlugin extends Plugin {\n  name: string = 'dash';\n  prevX: number;\n  prevY: number;\n\n  draw(data: DrawingInterface) {\n    super.draw(data);\n\n    const { x, y, state } = data;\n    const context = this.canvas?.getContext('2d');\n    context.setLineDash([5, 30]);\n\n    const prevX = this.prevX || x;\n    const prevY = this.prevY || y;\n\n    if (state === 'draw-started' || state === 'drawing') {\n      context.beginPath();\n      context.moveTo(prevX, prevY);\n      context.lineTo(x, y);\n      context.stroke();\n      context.closePath();\n\n      Object.assign(this, {\n        lastX: x,\n        lastY: y,\n      });\n    }\n  }\n}\n\n\u003cAtelier command=\"dash\" plugins={[DashPlugin]} /\u003e\n```\n\nAnd the result:\n\n\u003cimg src=\"https://user-images.githubusercontent.com/3623695/141399812-9f8e3645-ad40-4d16-887e-0de485c7a720.gif\" width=\"500\" alt=\"DashPlugin gif\"\u003e\n\n## :page_facing_up: License\n\nAtelier is made available under the [MIT License](./LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcobaltinc%2Fatelier","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcobaltinc%2Fatelier","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcobaltinc%2Fatelier/lists"}