Are you an LLM? You can read better optimized documentation at /api/plugins/pantoken/simple-icons/src/functions/simpleIcons.md for this page in Markdown format
pantoken / plugins/pantoken/simple-icons/src / simpleIcons
Function: simpleIcons()
simpleIcons(
options?):PantokenPlugin
Beta
Create the Simple Icons plugin.
Parameters
options?
SimpleIconsOptions = {}
SimpleIconsOptions. Pass a registry to avoid the lazy import (e.g. in token-stage use, where hooks are synchronous).
Returns
A PantokenPlugin with tokens and rehype hooks.
Examples
Emit brand glyphs as <image> tokens
ts
import { buildTokens } from "@pantoken/core";
import { simpleIcons } from "@pantoken/plugin-simple-icons";
import * as registry from "simple-icons";
buildTokens({
theme: "rebrand",
plugins: [simpleIcons({ registry, slugs: ["github", "react"] })],
});
// adds --instui-icon-github, --instui-icon-react as <image> tokensResolve :brand: codes at render (rehype layer)
ts
import { simpleIcons } from "@pantoken/plugin-simple-icons";
import * as registry from "simple-icons";
const { resolve } = simpleIcons({ registry }).rehype!({ resolve: () => undefined });
resolve("github"); // { name, path, svg, viewBox, source: "simple-icons" }