h

heroic

@preview

Use Heroicons in Typst.

v0.1.2
MIT

Package Information

Last Updated
Minimum Typst Version
0.13.0
Categories
visualizationfun

1. Get the package

Download the package using the TPIX CLI:

tpix get @preview/heroic:0.1.2

2. Import in your Typst file

Add this to your .typ file:

#import "@preview/heroic:0.1.2": *

Version History

0.1.20.13.0
6246fe2f0ff0...
0.1.10.13.0
0aa356126c76...
0.1.00.13.0
f17619c52b4a...

heroic (v0.1.2)

Use Heroicons (v2.2.0) in Typst.

Compared to other icon packages, heroic can be used without the need to install
any icon fonts and works out of the box with bundled SVG icons.

Usage

Import the package and use either the #icon or #hi commands.

#import "@preview/heroic:0.1.2": icon, hi

Use `#icon` to add icons as images as seen in @map-pin-icon.
#figure(
  icon("map-pin", height: 2cm, color: green),
  caption: [`map-pin` icon],
) <map-pin-icon>

#text(fill: orange)[Use #hi("megaphone", solid: false) `#hi` for context-aware inline icons]\
that adapt to the surrounding text.

Commands

Both commands use the same arguments:

  • name (str): Name of the icon.
  • color (color | auto): Color of the icon (default: auto).
  • height (length): Height of the icon (default: 1em).
  • solid (bool): If the icon should be filled with a solid color or outlined (default: true).

#hi also takes additional arguments:

  • baseline (length): Baseline of the icon.

Overview of all available icons

All icons can be browsed and searched on https://heroicons.com/.

Overview of all bundled icons

Development

Bundling Heroicons

To update the icon files to a new version, run the bundle.py script from the scripts folder:

python3 scripts/bundle.py <heroicons_release_version>

Changelog

  • Version 0.1.2 (2026-02-06)

    • Replaced SVG sprite files with Typst dictionaries for improved performance.
    • Improved error handling in scripts/bundle.py.
  • Version 0.1.1 (2025-12-23)

    • Updated Heroicons to 2.2.0.
    • Improved scripts/bundle.py script to download and bundle new Heroicon versions.
    • Added auto-generated src/icon-index.txt instead of fixed list of icon names.
    • Added parameter columns for #list-icons.
  • Version 0.1.0 (2025-05-15)

    • Initial release.