@i316/phosphor-web
v0.1.0
Published
i316: Phosphor icons as a web component, raw SVGs and search metadata. No build step needed.
Maintainers
Readme
@i316/phosphor-web
i316: Phosphor icons for plain HTML, with no build step: a <phosphor-icon> web component, the raw SVG files, and search metadata. 1,512 icons in 6 styles: thin, light, regular (default), bold, fill, duotone.
Using a framework? Install its package instead: @i316/phosphor-react (React web), @i316/phosphor-react-native (React Native), @i316/phosphor-vue (Vue 3), @i316/phosphor-angular (Angular).
Web component
<script type="module" src="/vendor/phosphor-web/web-component.js"></script>
<phosphor-icon name="caret-down"></phosphor-icon>
<phosphor-icon name="bell" variant="bold" size="20" color="#e11d48" title="Notifications"></phosphor-icon>Serve the package folder from any static host (or a public CDN such as jsDelivr or unpkg). Each icon's SVG is fetched once, on first use, from the package's svg/ folder, which the script locates relative to its own URL. So a page only downloads the icons it shows. To serve the SVGs from elsewhere:
import { PhosphorIconElement } from '/vendor/phosphor-web/web-component.js';
PhosphorIconElement.setBaseUrl('https://assets.example.com/phosphor/');With a bundler, import '@i316/phosphor-web'; registers the element. Copy the package's svg/ folder to your static assets, then point setBaseUrl at it.
Attributes: name, variant (style, default regular), size (number = px, or any CSS length), color, secondary-color, secondary-opacity, title. Page-wide defaults come from CSS:
:root { --phosphor-icon-size: 20px; }
.toolbar { color: slategray; } /* icons follow the CSS color */Accessibility: icons are decorative by default. A title attribute gives the element role="img" and an aria-label.
Raw SVGs
svg/<style>/<name>.svg (e.g. svg/regular/caret-down.svg), with the icon color set to currentColor. Use them in <img>, inline them, or feed them to your own tooling.
Metadata
meta.json lists every icon's name, component name, categories, available styles and search tags. Use it to build an icon picker or search.
License
Icons: Phosphor Icons (https://github.com/phosphor-icons/core), licensed under MIT. i316 modified them: reformatted and grouped into folders by each icon's primary upstream category; converted into React, React Native, Vue, Angular and web-component formats.
i316 code (components, runtime, tooling): MIT, © 2026 rahil316. See LICENSE for both licenses in full.
