1
0
mirror of https://github.com/tabler/tabler.git synced 2025-12-21 17:34:25 +04:00
Files
tabler/docs/content/ui/components/icons.md
2025-05-07 21:08:05 +02:00

3.9 KiB

title, summary, banner, description
title summary banner description
Icons Use any of over 5000 icons created specifically for Tabler and make your dashboard look even more attractive. All icons are under MIT license, so you can use them without any problem both in private and commercial projects. icons Enhance dashboards with custom icons.

If you need to add icons to your website, you can use the [Tabler Icons library]({{ site.icons.link }}). It contains over 5000 icons that you can use in your projects. All icons are under the MIT license, so you can use them without any problem both in private and commercial projects.

Base icon

To add an icon to your code copy the SVG code from the Tabler Icons website and paste it into your HTML file.

{% include "ui/icon.html" icon="heart" %}

Results can be seen in the example below.

{% capture html -%} {% include "ui/icon.html" icon="heart" %} {% include "ui/icon.html" icon="ghost-2" %} {% include "ui/icon.html" icon="lego" %} {% include "ui/icon.html" icon="building-carousel" %} {%- endcapture %} {% include "docs/example.html" html=html %}

Filled icons

To use filled icons, you need to copy the SVG code from the Tabler Icons website and paste it into your HTML file.

{% include "ui/icon.html" icon="heart-filled" %}

Look at the example below to see the filled icons.

{% capture html -%} {% include "ui/icon.html" icon="heart-filled" %} {% include "ui/icon.html" icon="bell-ringing-filled" %} {% include "ui/icon.html" icon="cherry-filled" %} {% include "ui/icon.html" icon="circle-key-filled" %} {%- endcapture %} {% include "docs/example.html" html=html %}

Icon colors

To change the color of the icon, you need to add the text- class to the parent element of the icon. See the full list of available colors for more details. Color classes can be used with any HTML element.

<span class="text-red">
  {% include "ui/icon.html" icon="heart" %}
</span>

Look at the example below to see how the color of the icon changes.

{% capture html -%} {% include "ui/icon.html" icon="heart-filled" %} {% include "ui/icon.html" icon="star-filled" %} {% include "ui/icon.html" icon="circle" %} {% include "ui/icon.html" icon="square-rounded" %} {%- endcapture %} {% include "docs/example.html" html=html %}

Icon animations

To add an animation to the icon, you need to add the icon-pulse, icon-tada, or icon-rotate class to the SVG element.

{% include "ui/icon.html" icon="heart" %}
{% include "ui/icon.html" icon="bell" %}
{% include "ui/icon.html" icon="rotate-clockwise" %}

Look at the example below to see the animated icons.

{% capture html -%} <svg xmlns="http://www.w3.org/2000/svg" class="icon icon-pulse" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"

{%- endcapture %} {% include "docs/example.html" html=html %}