Skip to content

pantoken-root / formats/icons/src / buildIconResolverChain

Function: buildIconResolverChain() ​

buildIconResolverChain(options): IconResolver

Beta

Build the shared icon-resolver chain: an explicit resolve first, then the built-in pantoken icon set, then plugin rehype resolvers (so a plugin can add codes the built-in set doesn't know, but never shadow a built-in icon name). Used by @pantoken/rehype and @pantoken/markdown-it so the resolution order stays identical across renderers.

Parameters ​

options ​

IconResolverChainOptions

Returns ​

IconResolver

Example ​

ts
import { buildIconResolverChain } from "@pantoken/icons";

const resolveIcon = buildIconResolverChain({ plugins: [myBrandIconsPlugin] });
resolveIcon("arrow-left"); // { name, svg, viewBox, source } | undefined