{"id":41997080,"url":"https://github.com/hammamikhairi/styled-react-gist","last_synced_at":"2026-01-26T01:07:16.325Z","repository":{"id":50418176,"uuid":"518944661","full_name":"hammamikhairi/styled-react-gist","owner":"hammamikhairi","description":"Styled Github Gist React component","archived":false,"fork":false,"pushed_at":"2022-08-05T11:49:03.000Z","size":740,"stargazers_count":3,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-10-29T20:57:18.766Z","etag":null,"topics":["collaborate","embed","github","github-gist","github-pages","react","typescript"],"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/hammamikhairi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-07-28T17:54:12.000Z","updated_at":"2024-07-24T01:29:16.000Z","dependencies_parsed_at":"2022-08-21T18:20:15.191Z","dependency_job_id":null,"html_url":"https://github.com/hammamikhairi/styled-react-gist","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/hammamikhairi/styled-react-gist","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hammamikhairi%2Fstyled-react-gist","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hammamikhairi%2Fstyled-react-gist/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hammamikhairi%2Fstyled-react-gist/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hammamikhairi%2Fstyled-react-gist/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hammamikhairi","download_url":"https://codeload.github.com/hammamikhairi/styled-react-gist/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hammamikhairi%2Fstyled-react-gist/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28763148,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-26T00:37:26.264Z","status":"ssl_error","status_checked_at":"2026-01-26T00:37:25.959Z","response_time":113,"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":["collaborate","embed","github","github-gist","github-pages","react","typescript"],"created_at":"2026-01-26T01:07:15.751Z","updated_at":"2026-01-26T01:07:16.312Z","avatar_url":"https://github.com/hammamikhairi.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# styled-react-gist\n\nUpgraded rewrite of [react-gist](https://github.com/tleunen/react-gist) created by [Tommy](https://github.com/tleunen). Credit goes out to those who helped build that library.\n\n\n[![NPM](https://img.shields.io/npm/v/styled-react-gist.svg)](https://www.npmjs.com/package/styled-react-gist)\n\u003ca href=\"https://reactjs.org/\"\u003e\n    \u003cimg alt=\"react\" src=\"https://badges.aleen42.com/src/react.svg\" \u003e\n\u003c/a\u003e\n\u003ca href=\"https://www.typescriptlang.org\"\u003e\n    \u003cimg alt=\"code language: typescript\" src=\"https://badges.aleen42.com/src/typescript.svg\"\u003e\n\u003c/a\u003e\n\n\nThis rewrite:\n- Adds native TS support\n- Adds Styling feature ( url || raw css  )\n\n## Why use styled-react-gist ?\n- the fastest library to embed themed code snippets in your website\n- because we care about your bundle size \u003c3\n\n## How it works\nThis package embeds styled github gists in react applications, the styles currently can be imported with a url of a css file `[DOMAIN_NAME]/[FILE_NAME].css` and/or raw css ( refer to this \u003ca href='#-usage'\u003eexample\u003c/a\u003e )\u003cbr\u003e\nIf both methods were used, the styles specified in `cssString` will override the ones, if mentioned, imported with a url. This will allow applying adjustments to an open source (coming soon) css file :)\n\n## 🚀 Installation\n\n##### [`npm`](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm):\n\n```bash\nnpm i styled-react-gist\n```\n\n##### [`yarn`](https://classic.yarnpkg.com/en/docs/install/#mac-stable):\n\n```bash\nyarn add styled-react-gist\n```\n\n## ✨ Usage\n\n```typescript jsx\nimport React from \"react\";\nimport Gist from \"styled-react-gist\";\n\nexport const YourComponent = () =\u003e {\n\n  const cssString = `\n    .js-file-line-container {\n      background : whitesmoke !important;\n    }\n    .gist-meta{\n      display : none !important\n    }\n    .gist-data {\n      background : whitesmoke !important;\n      padding : 1rem 0.5rem !important;\n      // background: transparent !important;\n    }\n  `;\n\n  return (\n    \u003cGist\n      gistId = '189e5c6bbc7217b8bdf952ff243c2411'\n      file = 'styled-react-gist.jsx'\n      gistUrl = 'https://gist.github.com/hammamikhairi/189e5c6bbc7217b8bdf952ff243c2411'\n\n      cssString = {cssString}\n      styleSheetUrl = \"https://pleasedont.hammamikhairi.repl.co/css/npm.css\"\n    /\u003e\n  );\n};\n```\nThe component will render :\n\u003cp\u003e\n  \u003cimg src='./example/preview.png'\u003e\n\u003c/p\u003e\n\n## 📌 Props\n\nProp                  | Type     | Description                   | Required\n--------------------- | -------- | ------------------------- | --------\n`file`|string|Name of the gist's file (if the gist has many file, pick any of them) \u003cbr\u003e **avoid using special Characters**|Yes\n`gistId`|string|gist's id|Yes (if `url` isn't specified)\n`gistUrl`|string|gist's url| Yes (if `gistId` isn't specified)\n`cssString`|string| a string containing css (refer to this \u003ca href='#-usage'\u003eexample\u003c/a\u003e) |No\n`styleSheetUrl`|string|a url to a `.css` file|No|\n\n\n## ✌️ License\n[MIT](https://opensource.org/licenses/MIT)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhammamikhairi%2Fstyled-react-gist","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhammamikhairi%2Fstyled-react-gist","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhammamikhairi%2Fstyled-react-gist/lists"}