@mal-icons/preact
v0.7.11
Published
Preact components for mal-icons.
Maintainers
Readme
@mal-icons/preact
Preact adapter for mal-icons — a high-performance, tree-shakeable icon SDK. Each icon is a pre-generated Preact component that renders plain SVG, with no runtime parsing.
Highlights
- Tree-shakeable — every icon is its own module.
- Tiny — strict per-icon size budget; ideal for size-sensitive Preact apps.
- Themeable —
IconContextprovider with per-icon overrides. - Pure-CSS animations —
spin,pulse,beat,bounce,ping,shake,wiggle,float,heartbeat,flip,rotate,zoom,fade,slide,glow,swing,tada, with aprefers-reduced-motionguard. - Accessible — correct
role/aria-hiddenand optional<title>.
Installation
bun add @mal-icons/preact
# or
npm install @mal-icons/preactRequires Preact 10 or newer (peer dependency).
Use with AI agents
AI coding agents can add and theme these icons for you via the
mal-icons agent skill. Install it with the
skills CLI:
npx skills add mal-icons/mal-iconsThen ask your agent to "add a trash icon" and it searches the catalog and writes
the correct @mal-icons/preact import. See the
Preact setup guide.
Quick start
import { FiActivity } from "@mal-icons/preact/fi";
export function Status() {
return <FiActivity size={24} title="Status" />;
}App-wide theming
import { IconContext } from "@mal-icons/preact";
<IconContext.Provider value={{ size: 20, color: "#3366ff" }}>
<App />
</IconContext.Provider>;Per-icon props always override context values.
Props
| Prop | Type | Description |
| ---------------- | ------------------------------------------------------------------------------ | ---------------------------------------------------- |
| size | number \| string | Width and height (defaults to 1em) |
| color | string | Overrides currentColor |
| multicolor | boolean | Keep the icon's own colors (omits the currentColor stroke/fill defaults) |
| weight | "thin" \| "light" \| "regular" \| "bold" | Stroke weight for stroke-based sets |
| animate | IconAnimation ("spin", "pulse", "bounce", "shake", "heartbeat", …) | CSS animation preset |
| secondaryColor | string | Multi-tone color, exposed as --mal-icons-secondary |
| title | string | Accessible label |
| class | string | Additional class names |
Animations
import { ICON_ANIMATIONS_CSS } from "@mal-icons/preact";
<style>{ICON_ANIMATIONS_CSS}</style>;
<FiLoader animate="spin" />;API
import {
IconBase,
createIcon,
IconContext,
DefaultIconContext,
ICON_ANIMATIONS_CSS,
WEIGHT_STROKE_WIDTH,
animationClass,
} from "@mal-icons/preact";Icons
The bundled icon sets, their upstream licenses, pinned versions, and counts:
| Icon Library | License | Version | Count | | ---------------------------------------- | --------------------------------------------------------------------------------- | ------- | ----: | | Ant Design Icons | MIT license | 4.0.0 | 420 | | Circum Icons | MPL-2.0 license | 2.0.2 | 288 | | Codicons | CC BY 4.0 license | 0.0.46 | 604 | | css.gg | MIT license | 2.1.1 | 704 | | Devicons | MIT license | 2.0.1 | 1725 | | Feather | MIT license | 4.29.0 | 287 | | Flat Color Icons | CC BY 4.0 license | 1.0.2 | 312 | | Font Awesome Free | CC BY 4.0 license | 6.7.2 | 1402 | | Font Awesome Free Brands | CC BY 4.0 license | 6.7.2 | 495 | | Font Awesome Free Regular | CC BY 4.0 license | 6.7.2 | 163 | | Grommet | Apache 2.0 license | 4.14.0 | 637 | | Heroicons | MIT license | 2.2.0 | 324 | | Ionicons | MIT license | 8.0.13 | 1357 | | Lucide | ISC license | 1.19.0 | 1727 | | Octicons | MIT license | 19.28.1 | 733 | | Radix Icons | MIT license | 0.0.17 | 318 | | Simple Line Icons | MIT license | 2.5.5 | 189 | | Themify | SIL OFL 1.1 license | 9600186 | 352 | | Typicons | CC BY-SA 4.0 license | 2.1.2 | 336 | | Weather Icons | SIL OFL 1.1 license | 2.0.12 | 219 |
Subpath exports
| Import | Contents |
| --------------------------------- | --------------------------------- |
| @mal-icons/preact | Adapter and context |
| @mal-icons/preact/ad | All Ant Design icons (named exports) |
| @mal-icons/preact/ci | All Circum icons (named exports) |
| @mal-icons/preact/dev | All Devicons icons (named exports) |
| @mal-icons/preact/ad/AdHome | A single Ant Design icon module |
| @mal-icons/preact/ci/CiHeart | A single Circum icon module |
| @mal-icons/preact/dev/DevDreamhost | A single Devicons icon module |
| @mal-icons/preact/fa | All Font Awesome icons (named exports) |
| @mal-icons/preact/fab | All Font Awesome Brands icons (named exports) |
| @mal-icons/preact/far | All Font Awesome Regular icons (named exports) |
| @mal-icons/preact/fc | All Flat Color icons (named exports) |
| @mal-icons/preact/fi | All Feather icons (named exports) |
| @mal-icons/preact/gr | All Grommet icons (named exports) |
| @mal-icons/preact/fa/FaHeart | A single icon module |
| @mal-icons/preact/fab/FabGithub | A single icon module |
| @mal-icons/preact/far/FarHeart | A single icon module |
| @mal-icons/preact/fc/FcAbout | A single icon module |
| @mal-icons/preact/fi/FiActivity | A single icon module |
| @mal-icons/preact/gr/GrHome | A single icon module |
| @mal-icons/preact/io | All Ionicons (named exports) |
| @mal-icons/preact/lu | All Lucide (named exports) |
| @mal-icons/preact/oc | All Octicons (named exports) |
| @mal-icons/preact/io/IoHeart | A single Ionicons icon module |
| @mal-icons/preact/lu/LuHeart | A single Lucide icon module |
| @mal-icons/preact/oc/OcHeart16 | A single Octicons icon module |
| @mal-icons/preact/ti | All Typicons (named exports) |
| @mal-icons/preact/wi | All Weather Icons (named exports) |
| @mal-icons/preact/ti/TiHeart | A single Typicons icon module |
| @mal-icons/preact/wi/WiDaySunny | A single Weather Icons icon module |
| @mal-icons/preact/hi | All Heroicons icons (named exports) |
| @mal-icons/preact/hi/HiAcademicCap | A single Heroicons icon module |
| @mal-icons/preact/sl | All Simple Line Icons icons (named exports) |
| @mal-icons/preact/sl/SlActionRedo | A single Simple Line Icons icon module |
| @mal-icons/preact/cg | All css.gg icons (named exports) |
| @mal-icons/preact/cg/CgAbstract | A single css.gg icon module |
| @mal-icons/preact/vsc | All Codicons icons (named exports) |
| @mal-icons/preact/vsc/VscAccount | A single Codicons icon module |
| @mal-icons/preact/tf | All Themify icons (named exports) |
| @mal-icons/preact/tf/TfAgenda | A single Themify icon module |
| @mal-icons/preact/rx | All Radix Icons icons (named exports) |
| @mal-icons/preact/rx/RxAccessibility | A single Radix Icons icon module |
Example
A Vite + Preact 10 gallery lives in
examples/preact.
Repository
https://github.com/mal-icons/mal-icons · package directory
packages/preact.
License
MIT © MALDevs
