npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@mal-icons/core

v0.10.0

Published

Framework-agnostic types and theming utilities for mal-icons.

Downloads

1,920

Readme

@mal-icons/core

npm License: MIT

The framework-agnostic foundation of mal-icons — shared TypeScript types and theming utilities used by every framework adapter (React, Vue, Svelte, Preact, Solid, Angular, Astro, React Native, and the web renderer).

You normally don't install this package directly — it ships as a dependency of each adapter. Install it only when you are building your own adapter or need the shared types and theming primitives in framework-neutral code.

Why it exists

Every mal-icons adapter renders the same SVG markup from the same data model. @mal-icons/core is where that contract lives:

  • One serializable icon data model (IconData, IconNode, NodeTuple).
  • One prop surface (IconBaseProps) and theming contract (IconContextValue).
  • One override-resolution rule (resolveIconAttrs) so per-icon props always beat context.
  • One set of differentiators: stroke weight presets and pure-CSS animations.

There is no runtime dependency and no framework code — just types and a few tiny pure functions.

Use with AI agents

The mal-icons agent skill teaches AI coding agents to find, import, and theme icons across every @mal-icons adapter. Install it with the skills CLI:

npx skills add mal-icons/mal-icons

See skills/mal-icons for the catalog and per-framework guides.

Installation

bun add @mal-icons/core
# or
npm install @mal-icons/core

What's inside

Types

| Export | Description | | ---------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | IconNode | Recursive { tag, attr, child } build-time icon shape | | NodeTuple | Compact [tag, attr] tuple used at render time | | IconData | Minimal { viewBox, nodes, defaultAttr? } render payload | | IconDefinition | Fully-described, deduplicatable icon (used by the pipeline) | | IconBaseProps<St> | Props every generated icon component accepts | | IconContextValue<St> | Theming values supplied through a framework provider | | IconsManifest | Top-level manifest describing all available icon sets | | IconWeight | "thin" \| "light" \| "regular" \| "bold" | | IconAnimation | "spin" \| "spin-reverse" \| "pulse" \| "beat" \| "bounce" \| "ping" \| "shake" \| "wiggle" \| "float" \| "heartbeat" \| "flip" \| "rotate" \| "zoom" \| "fade" \| "slide" \| "glow" \| "swing" \| "tada" |

Utilities

import {
  resolveIconAttrs,
  WEIGHT_STROKE_WIDTH,
  animationClass,
  ICON_ANIMATIONS_CSS,
} from "@mal-icons/core";

// Merge per-icon props over context, following the override priority:
//   props.color > context.color
//   props.size  > context.size > "1em"
const { size, color, className } = resolveIconAttrs(
  { size: 24, color: "#3366ff" },
  { size: 20 },
);

// Map a stroke weight preset to a concrete stroke-width.
WEIGHT_STROKE_WIDTH.bold; // 3

// Class name applied to the <svg> for a CSS animation.
animationClass("spin"); // "mal-icons-animate-spin"

// Inject once to enable the CSS animation presets (with a built-in
// prefers-reduced-motion guard).
document.head.insertAdjacentHTML(
  "beforeend",
  `<style>${ICON_ANIMATIONS_CSS}</style>`,
);

Building your own adapter

A framework adapter only needs to:

  1. Read theming from IconContextValue via the framework's context/provider.
  2. Call resolveIconAttrs(props, context) to compute the final attributes.
  3. Render an <svg viewBox={data.viewBox}> and map data.nodes to elements.

That's the entire contract — the generated icon modules supply the IconData.

Repository

Source, issues, and contribution guidelines live in the monorepo: https://github.com/mal-icons/mal-icons · package directory packages/core.

License

MIT © MALDevs