{"id":17109318,"url":"https://github.com/matejchalk/vscode-material-icons","last_synced_at":"2025-07-24T23:13:33.519Z","repository":{"id":221831086,"uuid":"755448855","full_name":"matejchalk/vscode-material-icons","owner":"matejchalk","description":"VSCode Material Icon Theme wrapper for applications","archived":false,"fork":false,"pushed_at":"2025-02-08T09:11:10.000Z","size":1764,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-10T14:17:41.487Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://vscode-material-icons.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/matejchalk.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":"2024-02-10T08:32:09.000Z","updated_at":"2025-02-08T09:11:11.000Z","dependencies_parsed_at":"2024-04-29T16:40:54.735Z","dependency_job_id":"20440924-0f58-4ece-bf49-b55e2d96dea6","html_url":"https://github.com/matejchalk/vscode-material-icons","commit_stats":{"total_commits":35,"total_committers":3,"mean_commits":"11.666666666666666","dds":"0.11428571428571432","last_synced_commit":"59636c3a39b75b9e6a83fd3c180bc1a815e6b473"},"previous_names":["matejchalk/vscode-material-icons"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matejchalk%2Fvscode-material-icons","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matejchalk%2Fvscode-material-icons/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matejchalk%2Fvscode-material-icons/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matejchalk%2Fvscode-material-icons/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/matejchalk","download_url":"https://codeload.github.com/matejchalk/vscode-material-icons/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248658289,"owners_count":21140917,"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-10-14T16:22:53.028Z","updated_at":"2025-04-13T03:20:16.037Z","avatar_url":"https://github.com/matejchalk.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# vscode-material-icons\n\n**[VSCode Material Icon Theme](https://marketplace.visualstudio.com/items?itemName=PKief.material-icon-theme) wrapper for applications to self-host icons and select icon based on file path.**\n\nFor a full list of available icons, see [showcase](https://vscode-material-icons.vercel.app/).\n\n## Setup\n\nInstall `vscode-material-icons` with your package manager:\n\n\u003cdetails\u003e\n\u003csummary\u003eNPM\u003c/summary\u003e\n\n```sh\nnpm install vscode-material-icons\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eYarn\u003c/summary\u003e\n\n```sh\nyarn add vscode-material-icons\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003ePNPM\u003c/summary\u003e\n\n```sh\npnpm add vscode-material-icons\n```\n\n\u003c/details\u003e\n\n### Self-hosting icons\n\nIf you want to self-host the icons in your front-end app, configure your bundler to copy the `node_modules/vscode-material-icons/generated/icons` folder to your build output.\n\n\u003cdetails\u003e\n\u003csummary\u003eWebpack example\u003c/summary\u003e\n\nUse [copy-webpack-plugin](https://webpack.js.org/plugins/copy-webpack-plugin/) in `webpack.config.js`:\n\n```js\nconst CopyPlugin = require('copy-webpack-plugin');\n\nmodule.exports = {\n  // ...\n  plugins: [\n    // ...\n    new CopyPlugin({\n      patterns: [\n        {\n          from: 'node_modules/vscode-material-icons/generated/icons',\n          to: 'assets/material-icons',\n        },\n      ],\n    }),\n  ],\n};\n```\n\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eAngular example\u003c/summary\u003e\n\nAppend to `assets` in `angular.json` (or `project.json` if using Nx):\n\n```jsonc\n{\n  // ..\n  \"targets\": {\n    \"build\": {\n      \"executor\": \"@angular-devkit/build-angular:browser\",\n      \"options\": {\n        // ...\n        \"assets\": [\n          // ...\n          {\n            \"glob\": \"**/*\",\n            \"input\": \"./node_modules/vscode-material-icons/generated/icons\",\n            \"output\": \"/assets/material-icons/\",\n          },\n        ],\n      },\n      // ...\n    },\n  },\n}\n```\n\n\u003c/details\u003e\n\n## Usage\n\nUse exported functions to get an icon name/URL from a file/folder path:\n\n```ts\nimport {\n  getIconForFilePath,\n  getIconUrlByName,\n  getIconUrlForFilePath,\n  type MaterialIcon,\n} from 'vscode-material-icons';\n\n// should match output path configured in bundler\nconst ICONS_URL = '/assets/material-icons';\n\n// example 1: file path -\u003e image URL\nconst iconUrl: string = getIconUrlForFilePath('src/index.html', ICONS_URL);\n\n// example 2: file path -\u003e icon name\nconst icon: MaterialIcon = getIconForFilePath('src/app/app.component.ts');\n\n// example 3: icon name -\u003e image URL\nconst tsIconUrl: string = getIconUrlByName('typescript', ICONS_URL);\n```\n\nIt's also simple to validate icon names in a type-safe way:\n\n```ts\nimport {\n  isMaterialIcon,\n  MATERIAL_ICONS,\n  type MaterialIcon,\n} from 'vscode-material-icons';\n\n// example 1: use union type for autocomplete\nlet icon: MaterialIcon;\n\n// example 2: validate icon name with type predicate function\nif (isMaterialIcon(value)) {\n  icon = value;\n}\n\n// example 3: integrate with schema validation library, e.g. Zod\nconst materialIconSchema = z.enum(MATERIAL_ICONS);\nicon = materialIconSchema.parse(value);\n```\n\n## Contributing\n\n- Install dependencies with `npm install`.\n- Run unit tests with `npm test`.\n- Build library with `npm run package`.\n- Re-fetch icons from VSCode extension with `npm run fetch-icons` (requires Bun).\n- Release new version with `npm run release`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatejchalk%2Fvscode-material-icons","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmatejchalk%2Fvscode-material-icons","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatejchalk%2Fvscode-material-icons/lists"}