{"id":24568770,"url":"https://github.com/yysuni/blockies-react-svg","last_synced_at":"2025-04-22T17:22:24.007Z","repository":{"id":65184892,"uuid":"585575118","full_name":"YYsuni/blockies-react-svg","owner":"YYsuni","description":"Blockies react SVG function component, blocky identicons, address-unique ethereum avatar, SVG base64 generation in browser or nodejs.","archived":false,"fork":false,"pushed_at":"2023-09-26T16:52:54.000Z","size":833,"stargazers_count":7,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-22T17:22:21.683Z","etag":null,"topics":["address","avatar","base64","blockies","ethereum","nodejs","react","svg"],"latest_commit_sha":null,"homepage":"https://blockies-react-svg.vercel.app/","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/YYsuni.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":"2023-01-05T14:20:09.000Z","updated_at":"2025-01-11T02:05:41.000Z","dependencies_parsed_at":"2024-06-20T19:13:30.900Z","dependency_job_id":null,"html_url":"https://github.com/YYsuni/blockies-react-svg","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YYsuni%2Fblockies-react-svg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YYsuni%2Fblockies-react-svg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YYsuni%2Fblockies-react-svg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YYsuni%2Fblockies-react-svg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/YYsuni","download_url":"https://codeload.github.com/YYsuni/blockies-react-svg/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250285825,"owners_count":21405316,"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":["address","avatar","base64","blockies","ethereum","nodejs","react","svg"],"created_at":"2025-01-23T14:55:20.831Z","updated_at":"2025-04-22T17:22:23.967Z","avatar_url":"https://github.com/YYsuni.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# blockies-react-svg\n\n\u003cp \u003e\n  \u003ca href=\"https://www.npmjs.com/package/blockies-react-svg\" target=\"_blank\"\u003e\n    \u003cimg src=\"https://img.shields.io/npm/v/blockies-react-svg\" /\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://www.npmjs.com/package/blockies-react-svg\" target=\"_blank\"\u003e\n    \u003cimg src=\"https://img.shields.io/npm/dm/blockies-react-svg.svg\" /\u003e\n  \u003c/a\u003e\n    \u003ca href=\"https://github.com/YYsuni/blockies-react-svg/blob/main/LICENSE\" target=\"_blank\"\u003e\n    \u003cimg src=\"https://img.shields.io/npm/l/blockies-react-svg.svg\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\nBlockies react SVG function component, blocky identicons, address-unique ethereum avatar, SVG base64 generation in browser or nodejs.\n\nIt allows you to use responsive width and height without rerendering because of SVG properties, and it will store the result.\n\n\nBase64 url is smaller(~2kb) than the canvas size(~16kb), so it is suitable for server-side rendering.(8x8)\n\n\u003e The address will automatically be converted to lower case until you set the `caseSensitive` property.\n\n![Sample of generated blockies](sample.png \"Blockies\")\n\n\n\n## Installation\n\n```bash\n$ npm i blockies-react-svg\n```\n```bash\n$ npm i blockies-react-svg@canary\n```\n\n## Usage\n\n\n```tsx\n// canary\nimport { BlockiesSvg, BlockiesSvgSync, makeBlockiesUrl, makeBlockiesSvgString } from 'blockies-react-svg'\n\n// \u003cBlockiesSvgSync \n\u003cBlockiesSvg \n  address={address}\n//size={8}\n//scale={10}\n//caseSensitive={false}\n//defaultBackgroundColor=\"black\"\n  className='classname'\n  style={styles} \n  /\u003e\n\n\u003cimg src={makeBlockiesUrl(address)} /\u003e\n\n\u003cdiv dangerouslySetInnerHTML={{ __html: makeBlockiesSvgString(address) }} /\u003e\n\n```\n\n\n## Why SVG?\n\n1. Canvas render doesn't support arbitrary size or other customized styles.\n\n2. SVG is the better experience, because of the infinite resolution.\n\n3. SVG file size is smaller than canvas.\n\n\n## Todo\n- [x] ts component\n- [x] base64 url\n- [x] js compile\n- [x] demo display (github pages)\n- [x] pure base64 (remove react-dom/server dependence, ~70kb bundle size)\n- [x] support nodejs\n- [ ] svg mirror optmization (reduce image size)\n- [ ] svg polygon optmization (reduce image size)\n- [ ] more shapes\n- [ ] different rand algorithm","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyysuni%2Fblockies-react-svg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyysuni%2Fblockies-react-svg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyysuni%2Fblockies-react-svg/lists"}