Skip to content

Icons - AvIcon

✨ Introduction

The AvIcon component places an Icon (see Icon component from Iconify) in a square div of configurable size. It is a Vue.js component for displaying icons with a wide range of customization options, including animations, colors, and sizes. It's designed to be flexible and performant, with support for various display options, flip options, and accessible titles.

It has exactly the same API as OhVueIcon, and uses @iconify/vue under the hood.

WARNING

Icon names must be those from Iconify-vue.

🏗️ Structure

The icon is composed of a square div of configurable size containing the Icon component.

🏷️ Props

NameTypeDefaultMandatoryDescription
sizenumber1The size in rem of the icon.
namestringThe name of the icon to display.
animation'spin' | 'wrench' | 'pulse' | 'spin-pulse' | 'flash' | 'float' | 'ring'undefinedAnimation type applied to the icon.
speed'fast' | 'slow'undefinedAnimation speed, if defined.
flip'horizontal' | 'vertical' | 'both'undefinedFlips the icon horizontally, vertically, or both.
labelstringundefinedARIA label for accessibility.
titlenumberundefinedIcon title (<title> tag), used for accessibility and tooltips.
colorstringundefinedMain color of the icon.
ssrboolean1Enables server-side rendering.

🔊 Events

None.

🎨 Slots

None.

🚀 Storybook demos

You can find examples of use and demo of the component on its dedicated Storybook page.

💡 Examples of use

vue
<template>
  <AvIcon
    name="mdi:warning-outline"
    color="var(--icon)"
    :size="2"
  />
</template>