{"id":13581173,"url":"https://github.com/phosphor-icons/react","last_synced_at":"2025-05-13T18:12:38.623Z","repository":{"id":38617883,"uuid":"280608591","full_name":"phosphor-icons/react","owner":"phosphor-icons","description":"A flexible icon family for React","archived":false,"fork":false,"pushed_at":"2025-04-21T20:26:57.000Z","size":16463,"stargazers_count":1323,"open_issues_count":13,"forks_count":62,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-05-05T05:03:01.883Z","etag":null,"topics":["icon-font","icon-pack","icons","react","reactjs","svg","svg-icons"],"latest_commit_sha":null,"homepage":"https://phosphoricons.com","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/phosphor-icons.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yaml","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,"zenodo":null},"funding":{"github":["phosphor-icons","rektdeckard"],"open_collective":"phosphoricons","ko_fi":"phosphoricons","patreon":"phosphoricons","buy_me_a_coffee":"phosphoricons"}},"created_at":"2020-07-18T07:46:50.000Z","updated_at":"2025-05-01T19:23:13.000Z","dependencies_parsed_at":"2024-06-12T02:35:09.524Z","dependency_job_id":"117243d8-45bf-4dd1-9bbe-9a635c3f7238","html_url":"https://github.com/phosphor-icons/react","commit_stats":{"total_commits":203,"total_committers":14,"mean_commits":14.5,"dds":"0.11330049261083741","last_synced_commit":"1c70b9291f44adac7dfed1f786c0aed52be386e1"},"previous_names":["phosphor-icons/phosphor-react"],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phosphor-icons%2Freact","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phosphor-icons%2Freact/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phosphor-icons%2Freact/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phosphor-icons%2Freact/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phosphor-icons","download_url":"https://codeload.github.com/phosphor-icons/react/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254000859,"owners_count":21997443,"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":["icon-font","icon-pack","icons","react","reactjs","svg","svg-icons"],"created_at":"2024-08-01T15:01:58.828Z","updated_at":"2025-05-13T18:12:38.611Z","avatar_url":"https://github.com/phosphor-icons.png","language":"TypeScript","readme":"\u003e [!IMPORTANT]\n\u003e As part of a major update, we will be replacing the existing `phosphor-react` package with `@phosphor-icons/react`. We recommend using this new version, as it has improved performance and a significantly smaller bundle size. No APIs have been changed, so drop-in replacement should be straightforward. The legacy package will continue to receive maintenance, but will not be updated with new icons upstream. [Take me to the legacy version ➜](https://github.com/phosphor-icons/react/tree/legacy)\n\n# @phosphor-icons/react\n\n\u003c!-- BEGIN_LOGO --\u003e\n\u003cimg src=\"/.github/logo.png\" width=\"128\" align=\"right\" /\u003e\n\u003c!-- END_LOGO --\u003e\n\nPhosphor is a flexible icon family for interfaces, diagrams, presentations — whatever, really. Explore all our icons at [phosphoricons.com](https://phosphoricons.com).\n\n[![NPM](https://img.shields.io/npm/v/@phosphor-icons/react.svg?style=flat-square)](https://www.npmjs.com/package/@phosphor-icons/react) [![Travis](https://img.shields.io/github/actions/workflow/status/phosphor-icons/react/main.yml?branch=vite\u0026style=flat-square)](https://travis-ci.com/github/phosphor-icons/react)\n\n[![GitHub stars](https://img.shields.io/github/stars/phosphor-icons/react?style=flat-square\u0026label=Star)](https://github.com/phosphor-icons/react)\n[![GitHub forks](https://img.shields.io/github/forks/phosphor-icons/react?style=flat-square\u0026label=Fork)](https://github.com/phosphor-icons/react/fork)\n[![GitHub watchers](https://img.shields.io/github/watchers/phosphor-icons/react?style=flat-square\u0026label=Watch)](https://github.com/phosphor-icons/react)\n[![Follow on GitHub](https://img.shields.io/github/followers/rektdeckard?style=flat-square\u0026label=Follow)](https://github.com/rektdeckard)\n\n## Installation\n\n```bash\nnpm i @phosphor-icons/react\n```\n\n## Usage\n\nSimply import the icons you need, and add them anywhere in your render method. Phosphor supports tree-shaking, so your bundle only includes code for the icons you use.\n\n```tsx\nimport { Horse, Heart, Cube } from \"@phosphor-icons/react\";\n\nconst App = () =\u003e {\n  return (\n    \u003cmain\u003e\n      \u003cHorse /\u003e\n      \u003cHeart color=\"#AE2983\" weight=\"fill\" size={32} /\u003e\n      \u003cCube color=\"teal\" weight=\"duotone\" /\u003e\n    \u003c/main\u003e\n  );\n};\n```\n\n### Import Performance Optimization\n\nWhen importing icons during development directly from the main module `@phosphor-icons/react`, some bundlers may eagerly transpile all 9,000+ modules exported by the package. This behavior can drastically increase compilation time.\nTo avoid transpiling all modules, import individual icons from their specific file paths instead:\n\n```tsx\nimport { BellSimple } from \"@phosphor-icons/react/dist/icons/BellSimple\";\n```\n\n#### Next.js Specific Optimizations\n\nIf you're using Next.js 13+, consider using [optimizePackageImports](https://nextjs.org/docs/app/api-reference/config/next-config-js/optimizePackageImports) in your next.config.js to have Next.js only load the modules that you are actually using. With this approach, you can use `@phosphor-icons/react` directly without causing Next.js to compile all its modules:\n\n```tsx\nmodule.exports = {\n  experimental: {\n    optimizePackageImports: [\"@phosphor-icons/react\"],\n  },\n}\n```\n\n### React Server Components and SSR\n\nWhen using Phosphor Icons in an SSR environment, within a React Server Component, or in any environment that does not permit the use of the Context API ([Next.js](https://nextjs.org/) Server Component, for example), import icons from the `/dist/ssr` submodule:\n\n```tsx\nimport { Fish } from \"@phosphor-icons/react/dist/ssr\";\n\nconst MyServerComponent = () =\u003e {\n  return \u003cFish weight=\"duotone\" /\u003e;\n};\n```\n\n\u003e [!NOTE]\n\u003e These variants do not use React Context, and thus cannot inherit styles from an ancestor `IconContext`.\n\n### Props\n\nIcon components accept all props that you can pass to a normal SVG element, including inline `style` objects, `onClick` handlers, and more. The main way of styling them will usually be with the following props:\n\n- **color?**: `string` – Icon stroke/fill color. Can be any CSS color string, including `hex`, `rgb`, `rgba`, `hsl`, `hsla`, named colors, or the special `currentColor` variable.\n- **size?**: `number | string` – Icon height \u0026 width. As with standard React elements, this can be a number, or a string with units in `px`, `%`, `em`, `rem`, `pt`, `cm`, `mm`, `in`.\n- **weight?**: `\"thin\" | \"light\" | \"regular\" | \"bold\" | \"fill\" | \"duotone\"` – Icon weight/style. Can also be used, for example, to \"toggle\" an icon's state: a rating component could use Stars with `weight=\"regular\"` to denote an empty star, and `weight=\"fill\"` to denote a filled star.\n- **mirrored?**: `boolean` – Flip the icon horizontally. Can be useful in RTL languages where normal icon orientation is not appropriate.\n- **alt?**: `string` – Add accessible alt text to an icon.\n\n### Context\n\nPhosphor takes advantage of React Context to make applying a default style to all icons simple. Create an `IconContext.Provider` at the root of the app (or anywhere above the icons in the tree) and pass in a configuration object with props to be applied by default to all icons:\n\n```tsx\nimport { IconContext, Horse, Heart, Cube } from \"@phosphor-icons/react\";\n\nconst App = () =\u003e {\n  return (\n    \u003cIconContext.Provider\n      value={{\n        color: \"limegreen\",\n        size: 32,\n        weight: \"bold\",\n        mirrored: false,\n      }}\n    \u003e\n      \u003cdiv\u003e\n        \u003cHorse /\u003e {/* I'm lime-green, 32px, and bold! */}\n        \u003cHeart /\u003e {/* Me too! */}\n        \u003cCube /\u003e {/* Me three :) */}\n      \u003c/div\u003e\n    \u003c/IconContext.Provider\u003e\n  );\n};\n```\n\nYou may create multiple Contexts for styling icons differently in separate regions of an application; icons use the nearest Context above them to determine their style.\n\n\u003e [!NOTE]\n\u003e The context will also pass any provided SVG props down to icon instances, which can be useful E.G. in adding accessible `aria-label`s, `classNames`, etc.\n\n\u003e [!NOTE]\n\u003e React Context is not available in some environments. See [React Server Components and SSR](#react-server-components-and-ssr) for details.\n\n### Composability\n\n\u003cimg src=\"/.github/cube-rotate.svg\" width=\"128\" align=\"right\" /\u003e\n\nComponents can accept arbitrary SVG elements as children, so long as they are valid children of the `\u003csvg\u003e` element. This can be used to modify an icon with background layers or shapes, filters, animations, and more. The children will be placed _below_ the normal icon contents.\n\nThe following will cause the Cube icon to rotate and pulse:\n\n```jsx\nconst RotatingCube = () =\u003e {\n  return (\n    \u003cCube color=\"darkorchid\" weight=\"duotone\"\u003e\n      \u003canimate\n        attributeName=\"opacity\"\n        values=\"0;1;0\"\n        dur=\"4s\"\n        repeatCount=\"indefinite\"\n      \u003e\u003c/animate\u003e\n      \u003canimateTransform\n        attributeName=\"transform\"\n        attributeType=\"XML\"\n        type=\"rotate\"\n        dur=\"5s\"\n        from=\"0 0 0\"\n        to=\"360 0 0\"\n        repeatCount=\"indefinite\"\n      \u003e\u003c/animateTransform\u003e\n    \u003c/Cube\u003e\n  );\n};\n```\n\n\u003e [!NOTE]\n\u003e The coordinate space of slotted elements is relative to the contents of the icon `viewBox`, which is 256x256 square. Only [valid SVG elements](https://developer.mozilla.org/en-US/docs/Web/SVG/Element#SVG_elements_by_category) will be rendered.\n\n### Imports\n\nYou may wish to import all icons at once for use in your project, though depending on your bundler this could prevent tree-shaking and make your app's bundle larger.\n\n```tsx\nimport * as Icon from \"@phosphor-icons/react\";\n\n\u003cIcon.Smiley /\u003e\n\u003cIcon.Folder weight=\"thin\" /\u003e\n\u003cIcon.BatteryHalf size=\"24px\" /\u003e\n```\n\nFor information on using Phosphor Icons in Server Components, see See [React Server Components and SSR](#react-server-components-and-ssr).\n\n### Custom Icons\n\nIt is possible to extend Phosphor with your custom icons, taking advantage of the styling and context abstractions used in our library. To create a custom icon, first design your icons on a 256x256 pixel grid, and export them as SVG. For best results, flatten the icon so that you only export assets with `path` elements. Strip any `fill` or `stroke` attributes, as these will be inherited from the wrapper.\n\nNext, create a new React `forwardRef` component, importing the `IconBase` component, as well as the `Icon` and `IconWeight` types from this library. Define a `Map\u003cIconWeight, ReactElement\u003e` that maps each icon weight to _the contents of each SVG asset_, effectively removing the wrapping `\u003csvg\u003e` element from each. Name your component, and render an `\u003cIconBase /\u003e`, passing all props and the ref, as well as the `weights` you defined earlier, as JSX props:\n\n```tsx\nimport { forwardRef, ReactElement } from \"react\";\nimport { Icon, IconBase, IconWeight } from \"@phosphor-icons/react\";\n\nconst weights = new Map\u003cIconWeight, ReactElement\u003e([\n  [\"thin\", \u003cpath d=\"...\" /\u003e],\n  [\"light\", \u003cpath d=\"...\" /\u003e],\n  [\"regular\", \u003cpath d=\"...\" /\u003e],\n  [\"bold\", \u003cpath d=\"...\" /\u003e],\n  [\"fill\", \u003cpath d=\"...\" /\u003e],\n  [\n    \"duotone\",\n    \u003c\u003e\n      \u003cpath d=\"...\" opacity=\"0.2\" /\u003e\n      \u003cpath d=\"...\" /\u003e\n    \u003c/\u003e,\n  ],\n]);\n\nconst CustomIcon: Icon = forwardRef((props, ref) =\u003e (\n  \u003cIconBase ref={ref} {...props} weights={weights} /\u003e\n));\n\nCustomIcon.displayName = \"CustomIcon\";\n\nexport default CustomIcon;\n```\n\n\u003e [!NOTE]\n\u003e If you have multiple child elements, wrap them in a `Fragment`. Typically our `duotone` icons have multiple elements, with the background layer at 20% opacity.\n\nIf Custom Icons are intended to be used in [React Server Components](#react-server-components-and-ssr), use `\u003cSSRBase /\u003e` instead of `\u003cIconBase /\u003e` as the render component.\n\n\u003c!-- BEGIN_LINKS --\u003e\n## Our Projects\n\n- [@phosphor-icons/homepage](https://github.com/phosphor-icons/homepage) ▲ Phosphor homepage and general info\n- [@phosphor-icons/core](https://github.com/phosphor-icons/core) ▲ Phosphor icon assets and catalog\n- [@phosphor-icons/elm](https://github.com/phosphor-icons/phosphor-elm) ▲ Phosphor icons for Elm\n- [@phosphor-icons/figma](https://github.com/phosphor-icons/figma) ▲ Phosphor icons Figma plugin\n- [@phosphor-icons/flutter](https://github.com/phosphor-icons/flutter) ▲ Phosphor IconData library for Flutter\n- [@phosphor-icons/pack](https://github.com/phosphor-icons/pack) ▲ Phosphor web font stripper to generate minimal icon bundles\n- [@phosphor-icons/penpot](https://github.com/phosphor-icons/penpot) ▲ Phosphor icons Penpot plugin\n- [@phosphor-icons/react](https://github.com/phosphor-icons/react) ▲ Phosphor icon component library for React\n- [@phosphor-icons/sketch](https://github.com/phosphor-icons/sketch) ▲ Phosphor icons Sketch plugin\n- [@phosphor-icons/swift](https://github.com/phosphor-icons/swift) ▲ Phosphor icon component library for SwiftUI\n- [@phosphor-icons/theme](https://github.com/phosphor-icons/theme) ▲ A VS Code (and other IDE) theme with the Phosphor color palette\n- [@phosphor-icons/unplugin](https://github.com/phosphor-icons/unplugin) ▲ A multi-framework bundler plugin for generating Phosphor sprite sheets\n- [@phosphor-icons/vue](https://github.com/phosphor-icons/vue) ▲ Phosphor icon component library for Vue\n- [@phosphor-icons/web](https://github.com/phosphor-icons/web) ▲ Phosphor icons for Vanilla JS\n- [@phosphor-icons/webcomponents](https://github.com/phosphor-icons/webcomponents) ▲ Phosphor icons as Web Components\n\n## Community Projects\n\n- [adamglin0/compose-phosphor-icons](https://github.com/adamglin0/compose-phosphor-icon) ▲ Phosphor icons for Compose Multiplatform\n- [altdsoy/phosphor_icons](https://github.com/altdsoy/phosphor_icons) ▲ Phosphor icons for Phoenix and TailwindCSS\n- [amPerl/egui-phosphor](https://github.com/amperl/egui-phosphor) ▲ Phosphor icons for egui apps (Rust)\n- [babakfp/phosphor-icons-svelte](https://github.com/babakfp/phosphor-icons-svelte) ▲ Phosphor icons for Svelte apps\n- [brettkolodny/phosphor-lustre](https://github.com/brettkolodny/phosphor-lustre) ▲ Phosphor icons for Lustre\n- [cellularmitosis/phosphor-uikit](https://github.com/cellularmitosis/phosphor-uikit) ▲ XCode asset catalog generator for Phosphor icons (Swift/UIKit)\n- [cjohansen/phosphor-clj](https://github.com/cjohansen/phosphor-clj) ▲ Phosphor icons as Hiccup for Clojure and ClojureScript\n- [codeat3/blade-phosphor-icons](https://github.com/codeat3/blade-phosphor-icons) ▲ Phosphor icons in your Laravel Blade views\n- [dreamRs/phosphor-r](https://github.com/dreamRs/phosphoricons) ▲ Phosphor icon wrapper for R documents and applications\n- [duongdev/phosphor-react-native](https://github.com/duongdev/phosphor-react-native) ▲ Phosphor icon component library for React Native\n- [haruaki07/phosphor-svelte](https://github.com/haruaki07/phosphor-svelte) ▲ Phosphor icons for Svelte apps\n- [IgnaceMaes/ember-phosphor-icons](https://github.com/IgnaceMaes/ember-phosphor-icons) ▲ Phosphor icons for Ember apps\n- [iota-uz/icons](https://github.com/iota-uz/icons) ▲ Phosphor icons as Templ components (Go)\n- [jajuma/phosphorhyva](https://github.com/JaJuMa-GmbH/phosphor-hyva) ▲ Phosphor icons for Magento 2 \u0026 Mage-OS with Hyvä Theme\n- [Kitten](https://kitten.small-web.org/reference/#icons) ▲ Phosphor icons integrated by default in Kitten\n- [lucagoslar/phosphor-css](https://github.com/lucagoslar/phosphor-css) ▲ CSS wrapper for Phosphor SVG icons\n- [maful/ruby-phosphor-icons](https://github.com/maful/ruby-phosphor-icons) ▲ Phosphor icons for Ruby and Rails applications\n- [meadowsys/phosphor-svgs](https://github.com/meadowsys/phosphor-svgs) ▲ Phosphor icons as Rust string constants\n- [mwood/tamagui-phosphor-icons](https://github.com/mwood23/tamagui-phosphor-icons) ▲ Phosphor icons for Tamagui\n- [noozo/phosphoricons_elixir](https://github.com/noozo/phosphoricons_elixir) ▲ Phosphor icons as SVG strings for Elixir/Phoenix\n- [oyedejioyewole/nuxt-phosphor-icons](https://github.com/oyedejioyewole/nuxt-phosphor-icons) ▲ Phosphor icons integration for Nuxt\n- [pepaslabs/phosphor-uikit](https://github.com/pepaslabs/phosphor-uikit) ▲ Xcode asset catalog generator for Swift/UIKit\n- [raycast/phosphor-icons](https://www.raycast.com/marinsokol/phosphor-icons) ▲ Phosphor icons Raycast extension\n- [reatlat/eleventy-plugin-phosphoricons](https://github.com/reatlat/eleventy-plugin-phosphoricons) ▲ An Eleventy shortcode plugin to embed icons as inline SVGs\n- [robruiz/wordpress-phosphor-icons-block](https://github.com/robruiz/phosphor-icons-block) ▲ Phosphor icon block for use in WordPress v5.8+\n- [sachaw/solid-phosphor](https://github.com/sachaw/solid-phosphor) ▲ Phosphor icons for SolidJS\n- [SeanMcP/phosphor-astro](https://github.com/SeanMcP/phosphor-astro) ▲ Phosphor icons as Astro components\n- [SorenHolstHansen/phosphor-leptos](https://github.com/SorenHolstHansen/phosphor-leptos) ▲ Phosphor icon component library for Leptos apps (Rust)\n- [vnphanquang/phosphor-icons-tailwindcss](https://github.com/vnphanquang/phosphor-icons-tailwindcss) ▲ TailwindCSS plugin for Phosphor icons\n- [wireui/phosphoricons](https://github.com/wireui/phosphoricons) ▲ Phosphor icons for Laravel\n\nIf you've made a port of Phosphor and you want to see it here, just open a PR [here](https://github.com/phosphor-icons/homepage)!\n\n## License\n\nMIT © [Phosphor Icons](https://github.com/phosphor-icons)\n\u003c!-- END_LINKS --\u003e\n","funding_links":["https://github.com/sponsors/phosphor-icons","https://github.com/sponsors/rektdeckard","https://opencollective.com/phosphoricons","https://ko-fi.com/phosphoricons","https://patreon.com/phosphoricons","https://buymeacoffee.com/phosphoricons"],"categories":["TypeScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphosphor-icons%2Freact","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphosphor-icons%2Freact","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphosphor-icons%2Freact/lists"}