{"id":19369363,"url":"https://github.com/bdombro/mdi-paths-split","last_synced_at":"2026-07-14T15:05:52.391Z","repository":{"id":57293605,"uuid":"333267636","full_name":"bdombro/mdi-paths-split","owner":"bdombro","description":"Material Design Icon paths Javascript","archived":false,"fork":false,"pushed_at":"2023-02-09T23:10:19.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-23T10:05:48.805Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/bdombro.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-27T01:30:11.000Z","updated_at":"2023-02-09T23:08:35.000Z","dependencies_parsed_at":"2022-09-01T08:40:42.997Z","dependency_job_id":null,"html_url":"https://github.com/bdombro/mdi-paths-split","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/bdombro%2Fmdi-paths-split","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bdombro%2Fmdi-paths-split/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bdombro%2Fmdi-paths-split/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bdombro%2Fmdi-paths-split/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bdombro","download_url":"https://codeload.github.com/bdombro/mdi-paths-split/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240491897,"owners_count":19809978,"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-10T08:10:50.580Z","updated_at":"2025-10-25T09:02:41.492Z","avatar_url":"https://github.com/bdombro.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mdi-paths [![npm package](https://img.shields.io/npm/v/mdi-paths-split.svg?style=flat-square)](https://npmjs.org/package/mdi-paths-split) [![Material Design Icons version](https://img.shields.io/badge/mdi-v5.9.55-blue.svg?style=flat-square)](https://materialdesignicons.com)\n\nSTATUS: Moved to [@slimr/mdi-paths](https://npmjs.org/package/@slimr/mdi-paths)\n\n[Material Design Icon](https://materialdesignicons.com) paths for any TS/JS project, packaged as single components.\n\n- Each modules is named to match the name in [https://materialdesignicons.com](https://materialdesignicons.com), so easy to find\n- Unlike most libraries, this one includes all the aliases found in [https://materialdesignicons.com](https://materialdesignicons.com)\n- By splitting the paths into different files, lazy loading is easy and possible!\n- Version is pinned to the version of `@mdi/svg` this was generated from\n\n## Installation\n\n```bash\nnpm install mdi-paths-split\n# or if you use Yarn\nyarn add mdi-paths-split\n```\n\n## Usage\n\nJust search for an icon on [materialdesignicons.com](https://materialdesignicons.com) and look for its name.  \nThe name translates to PascalCase in `mdi-paths-split`.  \n\nAlso it's possible to import with an alias. You can find them on the detail page of the respective icon.\n\nSimplest Usage:\n\n```javascript\nimport HomePath from 'mdi-paths-split/Home'\nexport function HomeIcon ({ color = 'currentColor', size = 24, ...props }) {\n  const className = 'mdi-icon ' + (props.class || props.className || '');\n  return (\n    \u003csvg {...props} class={className} width={size} height={size} fill={color} viewBox=\"0 0 24 24\"\u003e\n      \u003cpath d={HomePath} /\u003e\n    \u003c/svg\u003e\n  );\n}\n```\n\nWith Lazy-Loading/Code-Splitting and blank placeholder:\n\n```javascript\nexport function HomeIcon ({ color = 'currentColor', size = 24, ...props }) {\n  const className = 'mdi-icon ' + (props.class || props.className || '');\n  const [path, setPath] = useState('')\n  useEffect(() =\u003e { \n    import('mdi-paths-split/Home'))().then((module: any) =\u003e setPath(module.default)) \n  }, [])\n\n  return (\n    \u003csvg {...props} class={className} width={size} height={size} fill={color} viewBox=\"0 0 24 24\"\u003e\n      \u003cpath d={path} /\u003e\n    \u003c/svg\u003e\n  );\n}\n```\n\nAnd here is how I use it. I made a helper component and factory to make it crazy easy to add more icons while simultaneously reducing line-count per-icon. *Notice how each icon is code-split and lazy loaded with an empty placeholder!!!!*\n\n```typescript\nimport {Account, Counter, Home} from '~/components/Icons'\n\nexport default function HeaderLogo() {\n    return \u003cdiv\u003e\n        \u003cAccount /\u003e\n        \u003cCounter /\u003e\n        \u003cHome /\u003e\n    \u003c/div\u003e\n}\n```\n\nSource of helper `~/components/Icons`:\n\n```typescript\nimport { h } from 'preact';\nimport { useEffect, useState } from 'preact/hooks';\n\nexport const Account =   I(() =\u003e import('mdi-paths-split/CardAccountDetailsOutline'))\nexport const Counter =   I(() =\u003e import('mdi-paths-split/Counter'))\nexport const Home =      I(() =\u003e import('mdi-paths-split/HomeOutline'))\n// ... add as many as you want\n\n\nfunction I(lazyPath: LazyPathType) { // aka Icon Factory, shortened to be easier to read\n  return (props: IconProps) =\u003e \u003cLazySvg lazyPath={lazyPath} {...props} /\u003e\n}\ntype IconProps = Omit\u003cLazySvgProps, 'lazyPath'\u003e\n\n\nfunction LazySvg({ lazyPath, color = 'currentColor', size = 24, ...props }: LazySvgProps) {\n  const className = 'mdi-icon ' + (props.class || props.className || '');\n  const [path, setPath] = useState('')\n  useEffect(() =\u003e { lazyPath().then((module: any) =\u003e setPath(module.default)) }, [])\n\n  return (\n    \u003csvg {...props} class={className} width={size} height={size} fill={color} viewBox=\"0 0 24 24\"\u003e\n      \u003cpath d={path} /\u003e\n    \u003c/svg\u003e\n  );\n};\ntype LazyPathType = () =\u003e Promise\u003cany\u003e\ninterface LazySvgProps {\n  color?: string\n  size?: number | string\n  class?: string\n  className?: string\n  children?: never\n  lazyPath: LazyPathType\n}\n```\n\n## References\n\n- [mdi-react](https://npmjs.com/package/mdi-react) - The generator in this package was adapted from that one (Thanks!). This package achieves similar things but does so with much less bandwidth penalty per icon.\n- [materialdesignicons.com](https://materialdesignicons.com) - Where to browse icons\n- [@mdi/js](https://npmjs.com/package/@mdi/js) - Very similar to this lib, but puts all the paths in one file\n- [@mdi/svg](https://npmjs.com/package/@mdi/svg) - Where this lib gets the icons from\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbdombro%2Fmdi-paths-split","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbdombro%2Fmdi-paths-split","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbdombro%2Fmdi-paths-split/lists"}