Skip to content
AXIcons
AXIcons
Theme

Vanilla JavaScript

Render AXIcons to SVG strings with toSvg, for any framework, SSR or email.

Install

Terminal
pnpm add @axcore/xicons

toSvg

Icons in the core package are plain data. toSvg turns one into an SVG string; the second argument overrides any root attribute.

TypeScript
import { IconCamera, toSvg } from "@axcore/xicons";

document.querySelector("#photo")!.innerHTML = toSvg(IconCamera, {
  class: "size-5 text-sky-500",
  "stroke-width": 1.5,
});

Defaults: width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75", round caps and joins.

Vue, Svelte and others

Render the string with your framework's raw-HTML binding. The markup comes from the package, not user input.

HTML
<!-- Svelte -->
{@html toSvg(IconCamera)}

<!-- Vue -->
<span v-html="toSvg(IconCamera)" />

Brand registry functions

FunctionReturns
getIconSvg(name, variant?)One SVG string from the brand registry. Default variant mono.
getIcon(name)The definition: title, category, website, aliases and every variant.
hasIcon(name)true when a name or alias exists.
listIcons()Every brand registry definition.

Something wrong or missing?Open an issue

Jump to
Browse all iconsIcon library
InstallationGetting started
Quick startGetting started
ReactIntegrations
React NativeIntegrations
↑↓ navigateopen⌘K toggle