Props - Svelte Ant Design Icons v3

Props #

All icons are extended SVGAttributes from svelte/elements.

Types #

Size #

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

You can add a custom size using Tailwind CSS by including the desired classes in the class prop. For example:

CSS HEX Colors #

Use the color attribute to change colors with HEX color code:

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 #

Dark mode #

Your website with Tailwind CSS, add your dark mode class to the class prop.

A11y #

Decorative Icons #

By default, icons have no aria-label. This is intentional - when icons are used next to text or as decorative elements, they don't need labels as screen readers will ignore them.

Standalone Icons #

When icons are used without accompanying text (e.g., icon-only buttons), you should provide an accessible label using the ariaLabel prop:

Rich Descriptions #

For complex icons that need detailed descriptions, use title and desc props. The title provides a short label, while desc offers a longer description:

App storeThe shape of a red app store

Note: When using title, you don't need ariaLabel as the title will be used automatically via aria-labelledby.

Focusable #

Icons are not keyboard-focusable by default (focusable="false"). If you need to change this behavior, use the focusable prop:

Passing down other attributes #

As default all icons are extended SVGAttributes SVGElement interface. This means you can add any standard SVG attribute or event listener to our icon components.