EN
Getting started
03 · Icons

Icons

Heroicons v2 (MIT): 324 icons in outline and solid styles. The drawings are embedded in the package; no icon font, CDN or extra package is needed, and only the icons you use end up on the page.

acun:icon
01

Basic usage

Pick an icon with name; the names are listed in the gallery at the end of the page. The default style is outline and the default size is 5 (20px). An undefined name throws an error, so typos do not go unnoticed.

LIVE EXAMPLE
<div class="flex flex-wrap items-center gap-5">
    <acun:icon name="home" />
    <acun:icon name="map-pin" />
    <acun:icon name="truck" />
    <acun:icon name="users" />
    <acun:icon name="document-text" />
</div>
PropValues
nameHeroicons name (e.g. map-pin, truck)
02

Sizes

size is a Tailwind size-* value: 4 is 16px, 5 is 20px, 6 is 24px and 8 is 32px. Because the class is generated from this value, it must be present in your app's compiled CSS; if you choose a value the package never uses (e.g. 20), it must also be written in your templates so the class gets generated.

LIVE EXAMPLE
<div class="flex flex-wrap items-end gap-5">
    <acun:icon name="bell" size="4" />
    <acun:icon name="bell" />
    <acun:icon name="bell" size="6" />
    <acun:icon name="bell" size="8" />
    <acun:icon name="bell" size="10" />
</div>
PropValues
size4 | 5 | 6 | 8 | 10 …
03

Outline and solid

solid draws the icon in the filled style. Use it for selected tabs, active states or icons that read better at small sizes; do not mix the two styles in the same list.

LIVE EXAMPLE
<div class="flex flex-wrap items-center gap-5">
    <acun:icon name="star" size="6" />
    <acun:icon name="star" size="6" solid class="text-amber-500" />
    <acun:icon name="check-circle" size="6" />
    <acun:icon name="check-circle" size="6" solid class="text-emerald-600" />
</div>
PropValues
solidtrue | false
04

Stroke width

stroke sets the stroke width, in the outline style only; the default is 1.8. Thin strokes (1.2–1.5) look more balanced at large sizes, and thick strokes (2–2.5) at small sizes.

LIVE EXAMPLE
<div class="flex flex-wrap items-center gap-5">
    <acun:icon name="map-pin" size="10" stroke="1.2" />
    <acun:icon name="map-pin" size="10" />
    <acun:icon name="map-pin" size="10" stroke="2.5" />
</div>
PropValues
stroke1.2 | 1.5 | 1.8 | 2 | 2.5
05

Color

An icon takes its color from the text color (currentColor). For a different color, add a text-* class; icons inside buttons and links match their color automatically.

LIVE EXAMPLE
<div class="flex flex-wrap items-center gap-5">
    <acun:icon name="trash" size="6" class="text-red-600" />
    <acun:icon name="check-circle" size="6" class="text-emerald-600" />
    <acun:icon name="exclamation-triangle" size="6" class="text-amber-500" />
    <acun:icon name="bell" size="6" class="text-brand-600 dark:text-brand-400" />
    <acun:button size="sm"><acun:icon name="plus" size="4" />New Order</acun:button>
</div>
PropValues
classtext-* color class
06

Accessibility

Icons are hidden from screen readers by default (aria-hidden), because there is usually text next to them. For an icon that carries meaning on its own, set label; this adds role="img" and aria-label. In icon-only buttons, put the label on the button (aria-label), not on the icon.

LIVE EXAMPLE
<div class="flex flex-wrap items-center gap-5">
    <acun:icon name="shield-check" size="6" label="Verified customer" class="text-emerald-600" />
    <acun:button variant="ghost" size="icon" aria-label="Print"><acun:icon name="printer" /></acun:button>
</div>
PropValues
labelName read out by screen readers
07

All icons (324)

LIVE EXAMPLE
<acun:icon name="home" />
<acun:icon name="home" solid />
API

Props and slots

The values the component accepts.

PropDefaultDescription
name — Required. Icon name; an undefined name throws an error
size5Tailwind size-* value (5 = 20px)
solidfalseFilled style
stroke1.8Stroke width (outline only)
labelnullWhen set, role="img" and aria-label; otherwise aria-hidden
Acun UI · IconsDetailed usage and examples