@i316/solar-web
v0.1.1
Published
i316: Solar icons as a web component, raw SVGs and search metadata. No build step needed.
Downloads
530
Maintainers
Readme
@i316/solar-web
i316: Solar icons for plain HTML, with no build step: a <solar-icon> web component, the raw SVG files, and search metadata. 1,454 icons in 6 styles: linear (default), bold, broken, bold-duotone, line-duotone, outline.
Using a framework? Install its package instead: @i316/solar-react (React web), @i316/solar-react-native (React Native), @i316/solar-vue (Vue 3), @i316/solar-angular (Angular).
Web component
<script type="module" src="/vendor/solar-web/web-component.js"></script>
<solar-icon name="alt-arrow-down"></solar-icon>
<solar-icon name="bell" variant="bold" size="20" color="#e11d48" title="Notifications"></solar-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 { SolarIconElement } from '/vendor/solar-web/web-component.js';
SolarIconElement.setBaseUrl('https://assets.example.com/solar/');With a bundler, import '@i316/solar-web'; registers the element. Copy the package's svg/ folder to your static assets, then point setBaseUrl at it.
Attributes: name, variant (style, default linear), size (number = px, or any CSS length), color, stroke-width, secondary-color, secondary-opacity, title. Page-wide defaults come from CSS:
:root { --solar-icon-size: 20px; --solar-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/linear/alt-arrow-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: Solar Icon Set by 480 Design (https://github.com/480-Design/Solar-Icon-Set), licensed under CC BY 4.0. i316 modified them: recolored from the original hardcoded hex (#1C274C) to currentColor; reformatted, with some duotone groups and multi-path Bold icons consolidated into fewer paths (no intended visual change); seven icons renamed (e.g. cloud-file is now file-cloud); converted into React, React Native, Vue, Angular and web-component formats.
186 of the icons are not 480 Design's: they are Solar icon extensions by Hakim Saoudi (the @solar-icons project) (https://github.com/saoudi-h/solar-icons), licensed under MIT. LICENSE lists them, and meta.json in the web package marks them "origin": "extension".
i316 code (components, runtime, tooling): MIT, © 2026 rahil316. See LICENSE for both licenses in full.
