{"id":28429471,"url":"https://github.com/uiwjs/react-stackblitz","last_synced_at":"2025-06-26T16:09:37.584Z","repository":{"id":37029128,"uuid":"326442989","full_name":"uiwjs/react-stackblitz","owner":"uiwjs","description":"A React component is provided that allows you to programmatically generate stackblitz projects from code samples on the fly.","archived":false,"fork":false,"pushed_at":"2025-02-26T09:01:31.000Z","size":8517,"stargazers_count":4,"open_issues_count":4,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-05-30T10:52:25.535Z","etag":null,"topics":["react","react-component","stackblitz"],"latest_commit_sha":null,"homepage":"https://uiwjs.github.io/react-stackblitz","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/uiwjs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-01-03T15:50:45.000Z","updated_at":"2024-08-22T23:09:05.000Z","dependencies_parsed_at":"2022-06-25T16:37:51.273Z","dependency_job_id":null,"html_url":"https://github.com/uiwjs/react-stackblitz","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/uiwjs/react-stackblitz","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uiwjs%2Freact-stackblitz","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uiwjs%2Freact-stackblitz/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uiwjs%2Freact-stackblitz/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uiwjs%2Freact-stackblitz/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/uiwjs","download_url":"https://codeload.github.com/uiwjs/react-stackblitz/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/uiwjs%2Freact-stackblitz/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262099731,"owners_count":23258670,"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":["react","react-component","stackblitz"],"created_at":"2025-06-05T13:38:09.646Z","updated_at":"2025-06-26T16:09:37.546Z","avatar_url":"https://github.com/uiwjs.png","language":"TypeScript","readme":"React StackBlitz\n===\n\n\u003c!--dividing--\u003e\n\n[![Build \u0026 Deploy](https://github.com/uiwjs/react-stackblitz/actions/workflows/ci.yml/badge.svg)](https://github.com/uiwjs/react-stackblitz/actions/workflows/ci.yml)\n[![Issues](https://img.shields.io/github/issues/uiwjs/react-stackblitz.svg)](https://github.com/uiwjs/react-stackblitz/issues)\n[![Forks](https://img.shields.io/github/forks/uiwjs/react-stackblitz.svg)](https://github.com/uiwjs/react-stackblitz/network)\n[![Stars](https://img.shields.io/github/stars/uiwjs/react-stackblitz.svg)](https://github.com/uiwjs/react-stackblitz/stargazers)\n[![Release](https://img.shields.io/github/release/uiwjs/react-stackblitz)](https://github.com/uiwjs/react-stackblitz/releases)\n[![npm version](https://img.shields.io/npm/v/@uiw/react-stackblitz.svg)](https://www.npmjs.com/package/@uiw/react-stackblitz)\n\nA React component is provided that allows you to programmatically generate [stackblitz](https://stackblitz.com/) projects from code samples on the fly.\n\n## Install\n\n```bash\nnpm install @uiw/react-stackblitz --save\n```\n\n## Usage\n\n```jsx\nimport React from 'react';\nimport StackBlitz from '@uiw/react-stackblitz';\n\nconst code = `import React from \"react\";\nimport ReactDOM from \"react-dom\";\nimport Avatar from '@uiw/react-avatar';\nimport \"@uiw/react-avatar/lib/esm/style/index.css\";\n\nReactDOM.render(\n  \u003cdiv\u003e\n    \u003cdiv style={{ paddingBottom: 20 }}\u003e\n      \u003cAvatar icon=\"user\" /\u003e\n      \u003cAvatar size=\"small\" icon=\"user\" /\u003e\n    \u003c/div\u003e\n    \u003cdiv\u003e\n      \u003cAvatar shape=\"square\" size=\"large\" icon=\"user\" /\u003e\n      \u003cAvatar shape=\"square\" icon=\"user\" /\u003e\n      \u003cAvatar shape=\"square\" size=\"small\" icon=\"user\" /\u003e\n      \u003cAvatar shape=\"square\" size=\"mini\" icon=\"user\" /\u003e\n    \u003c/div\u003e\n  \u003c/div\u003e,\n  document.getElementById(\"root\")\n);`;\n\nconst Example = () =\u003e {\n  return (\n    \u003cStackBlitz\n      template=\"create-react-app\"\n      title=\"uiw\"\n      description=\"uiw v4.7.2 - demo\"\n      tags={[\"stackblitz\", \"uiw\", \"react\"]}\n      dependencies={{\n        \"react\": \"17.0.1\",\n        \"react-dom\": \"17.0.1\",\n        \"@uiw/react-avatar\": \"4.7.2\",\n        \"@babel/runtime\": \"7.12.5\",\n      }}\n      files={{\n        \"index.html\": `\u003cdiv id=\"root\"\u003e\u003c/div\u003e`,\n        \"index.js\": code,\n      }}\n    \u003e\n      Basic Example Open in StackBlitz\n    \u003c/StackBlitz\u003e\n  )\n}\n```\n\n## Props\n\n```typescript\ntype StackBlitzProps = Project \u0026 React.ButtonHTMLAttributes\u003cHTMLButtonElement\u003e \u0026 {\n  /**\n   * String of the Github username, repo and optionally branch/tag/commit.\n   * https://developer.stackblitz.com/docs/platform/javascript-sdk#sdkopengithubprojectreposlug-opts\n   */\n  repoSlug?: string;\n  projectId?: string;\n  embedOpts?: EmbedOpts;\n  openOpts?: OpenOptions;\n};\n```\n\n## Development\n\nRuns the project in development mode.  \n\n```bash\n# Step 1, run first, listen to the component compile and output the .js file\n# listen for compilation output type .d.ts file\nnpm run watch\n# Step 2, development mode, listen to compile preview website instance\nnpm run start\n```\n\n**production**\n\nBuilds the app for production to the build folder.\n\n```bash\nnpm run build\n```\n\nThe build is minified and the filenames include the hashes.\nYour app is ready to be deployed!\n\n### Related\n\n- [`@uiw/react-codepen`](https://github.com/uiwjs/react-codepen)\n- [`@uiw/react-codesandbox`](https://github.com/uiwjs/react-codesandbox)\n\n## Contributors\n\nAs always, thanks to our amazing contributors!\n\n\u003ca href=\"https://github.com/uiwjs/react-codepen/graphs/contributors\"\u003e\n  \u003cimg src=\"https://uiwjs.github.io/react-codepen/CONTRIBUTORS.svg\" /\u003e\n\u003c/a\u003e\n\nMade with [github-action-contributors](https://github.com/jaywcjlove/github-action-contributors).\n\n## License\n\nLicensed under the MIT License.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuiwjs%2Freact-stackblitz","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fuiwjs%2Freact-stackblitz","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuiwjs%2Freact-stackblitz/lists"}