{"id":19343377,"url":"https://github.com/0x241F31/astro-svg-components","last_synced_at":"2026-07-06T19:30:23.713Z","repository":{"id":62100885,"uuid":"557746053","full_name":"MrFoxPro/astro-svg-components","owner":"MrFoxPro","description":null,"archived":false,"fork":false,"pushed_at":"2022-10-30T17:45:27.000Z","size":58,"stargazers_count":1,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-06T19:41:54.166Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/MrFoxPro.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":"2022-10-26T08:17:20.000Z","updated_at":"2023-06-08T16:13:45.000Z","dependencies_parsed_at":"2023-01-20T18:20:39.250Z","dependency_job_id":null,"html_url":"https://github.com/MrFoxPro/astro-svg-components","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MrFoxPro%2Fastro-svg-components","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MrFoxPro%2Fastro-svg-components/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MrFoxPro%2Fastro-svg-components/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MrFoxPro%2Fastro-svg-components/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MrFoxPro","download_url":"https://codeload.github.com/MrFoxPro/astro-svg-components/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240449890,"owners_count":19803125,"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":[],"created_at":"2024-11-10T03:38:10.147Z","updated_at":"2026-07-06T19:30:23.662Z","avatar_url":"https://github.com/MrFoxPro.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"Import SVG files as astro components\n\nInstall:\n`pnpm i -D @foxpro/astro-svg-components`\n\nConfig:\n\n```js\nimport astroSvgComnponents from '@foxpro/astro-svg-components'\nexport default defineConfig({\n  integrations: [astroSvgComnponents()],\n  // optional! alias\n  vite: {\n    resolve: {\n      alias: [\n        {\n          find: '@',\n          replacement: path.resolve('.'),\n        },\n      ],\n    },\n  },\n})\n```\n\nAstro file:\n\n```jsx\n---\nimport CircleIcon from '@/svgs/circle.svg?component-astro'\nconst icons = import.meta.glob('@/svgs/*.svg', { as: 'component-astro', eager: true })\n\nimport { globSVG } from '@foxpro/astro-svg-components'\nconst icons = globSVG('@/svgs/*.svg')\n---\n// Props are passed to \u003csvg\u003e element\n\u003cCircleIcon class=\"icon\"\u003e\n{icons.map((Icon) =\u003e \u003cIcon class=\"icon\" /\u003e)}\n```\n\ntsconfig:\n\n```json\n{\n  \"compilerOptions\": {\n    \"types\": [\"@foxpro/astro-svg-components/types\"]\n  }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0x241F31%2Fastro-svg-components","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F0x241F31%2Fastro-svg-components","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F0x241F31%2Fastro-svg-components/lists"}