Skip to content
Kineticons

Using icons

API reference

The Kineticons API: components, the core renderer, toSvg, injectStyles, types and package entry points.

Packages

PackageEntry pointsWhat it gives you
kineticonskineticons, kineticons/dataReact: one component per icon, KineticIcon, and the icon data.
@kineticons/vue@kineticons/vue, /iconsVue 3: one component per icon, KineticIcon, and the icon data.
@kineticons/svelte@kineticons/svelte, /iconsSvelte 5: the Icon component and the icon data.
@kineticons/staticsvg/*, kineticons.css, icons.jsonPlain files for HTML, CDNs and tooling.
@kineticons/core@kineticons/core, /iconsThe renderer and motion, without a framework.

@kineticons/core

ExportSignatureWhat it does
render(icon, options) => SvgNodeThe icon as a tree of SVG elements, for any renderer.
toSvg(icon, options, animated = true) => stringThe icon as SVG markup, its motion inside.
toHtml(icon, options) => stringMarkup for a plain page: styles once, then the icon.
injectStyles(icon) => voidAdds an icon’s motion CSS to the page once (browser only).
iconCss / baseCss(icon) => string / () => stringThe CSS one icon needs, and the CSS all icons share.
stylesheet(icons) => stringThe motion for many icons in one stylesheet.
TOKENSobjectThe motion timing every icon shares.
ts
import { toSvg } from "@kineticons/core";
import { rocket } from "@kineticons/core/icons";

document.querySelector("#start")!.innerHTML = toSvg(rocket, { variant: "duotone", size: 20 });

Types

IconDef (an icon: its name, title, category, tags, parts and motion), Variant, Trigger and Category are exported by every package.

Something unclear or missing? Open an issue.