@i316/heroicons-web
v0.1.0
Published
i316: Heroicons icons as a web component, raw SVGs and search metadata. No build step needed.
Maintainers
Readme
@i316/heroicons-web
i316: Heroicons icons for plain HTML, with no build step: a <hero-icon> web component, the raw SVG files, and search metadata. 324 icons in 2 styles: outline (default), solid.
Using a framework? Install its package instead: @i316/heroicons-react (React web), @i316/heroicons-react-native (React Native), @i316/heroicons-vue (Vue 3), @i316/heroicons-angular (Angular).
Web component
<script type="module" src="/vendor/heroicons-web/web-component.js"></script>
<hero-icon name="chevron-down"></hero-icon>
<hero-icon name="bell" variant="solid" size="20" color="#e11d48" title="Notifications"></hero-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 { HeroIconElement } from '/vendor/heroicons-web/web-component.js';
HeroIconElement.setBaseUrl('https://assets.example.com/heroicons/');With a bundler, import '@i316/heroicons-web'; registers the element. Copy the package's svg/ folder to your static assets, then point setBaseUrl at it.
Attributes: name, variant (style, default outline), size (number = px, or any CSS length), color, stroke-width, title. Page-wide defaults come from CSS:
:root { --hero-icon-size: 20px; --hero-icon-stroke-width: 2; }
.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/outline/chevron-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: Heroicons by Tailwind Labs (https://github.com/tailwindlabs/heroicons), licensed under MIT. i316 modified them: 24px outline and solid sets only, recolored to currentColor and reformatted; 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.
