Props - Svelte Heros v2 v1

Prop #

Variation #

The default variation value is outline. Use the variation prop to change it to solid, mini or micro.

Size #

To change the size of an icon, use the size prop and specify the desired size. For example:

If you want to override the preconfigured size, you can add a custom size using Tailwind CSS by including the desired classes in the class prop. For example:

CSS HEX Color #

Use the color attribute to change colors with HEX color code for Filled and Outlined components.

Stroke width #

Use the strokeWidth prop to change the SVG stroke-width.

CSS framework #

You can apply CSS framework color and other attributes directly to the icon component or its parent tag using the class prop.

Tailwind CSS #

Bootstrap #

A11y #

All icons have aria-label. For example AcademicCap has aria-label="academic cap". Use ariaLabel prop to modify the aria-label value.

Use title, desc, and ariaLabel props to make your icons accessible.

Dark mode #

If you are using the dark mode on your website with Tailwind CSS, add your dark mode class to the class prop.

Let's use dark for the dark mode class as an example.

withEvents #

As default all icons are unfocusable. However you can add withEvents prop to make your icons focusable.

It is possible to add tabindex="0", but it is not recommended for A11y. If you want to use it add withEvents props.

Events #

All icons have the following events:

Passing down other attributes #

Since all icons have ...$$restProps, you can pass other attibutes as well.

Dynamically change the variation #