Skip to content

Icon

Renders one of the Tabler Icons as <i class="ti ti-{name}">. It needs the @tabler/icons-webfont stylesheet, see Installation.

name is the icon name without the ti- prefix, as listed on tabler.io/icons.

Without size, the icon follows the font size of its parent. size gives it a fixed size, with Tabler’s icon class: sm (1rem), md (2.5rem) or lg (3.5rem). inline is 1rem and aligned with the text around it:

filled renders the filled variant of the icon (ti-filled ti-filled-{name}):

The filled icons are a separate font of @tabler/icons-webfont (3.36.1+), and its tabler-icons-filled.css reuses the class names of the outline icons (ti, ti-{name}), so it cannot be loaded next to them. Compile its SCSS source under the ti-filled prefix instead, here with Webpack Encore’s Sass loader (or symfonycasts/sass-bundle with AssetMapper):

assets/styles/tabler-icons-filled.scss
@use '@tabler/icons-webfont/dist/tabler-icons-filled.scss' with (
$ti-prefix: 'ti-filled',
$ti-font-path: '~@tabler/icons-webfont/dist/fonts'
);

$ti-font-path points at the font files: adjust it to how your build resolves node_modules.

With Symfony UX Icons (2.17+ / 3.x) installed, a name with an icon set prefix renders that icon as an inline <svg> instead of the webfont: any of the 200,000+ icons of Iconify (lucide:circle-check, mdi:account, tabler:check…), or your own SVG files in assets/icons/. Names without a prefix keep using the webfont, so both can be mixed.

Terminal window
composer require symfony/ux-icons

The <svg> gets Tabler’s icon class, which sizes SVG icons, and the same variant, size and animation classes. filled picks the filled icon of the tabler set (tabler:{name}-filled) and has no effect on other sets. Every icon prop takes these names too, since the components render it with Icon:

UX Icons hides the icon from assistive technology (aria-hidden="true") unless you give it an aria-label or a title. Download the icons you use with php bin/console ux:icons:lock, so production never calls the Iconify API: see the UX Icons documentation.

variant sets the color (text-{variant}):

animation is pulse, tada or rotate:

Without size and variant, the icon inherits the font size and color of its parent. Other attributes go to the <i>: a spacing class next to a label, a font-size class, or role="img" and an aria-label when the icon carries meaning on its own:

tooltip sets the title and data-bs-toggle="tooltip" on the <i> (or the UX Icons <svg>) itself, with no wrapper, so the icon fits in an input group addon or next to a label. An icon with a tooltip carries meaning: it also gets role="img" and the text as its aria-label, so screen readers announce it. Attributes you pass yourself win: an aria-label with more context, or aria-hidden="true" when the text next to the icon already says the same, which keeps the icon decorative (no role nor aria-label):

Prop Type Default Description
name string (required) Icon name, without the ti- prefix; or a ux-icons name, see UX Icons
variant string? null primary secondary success danger warning info dark light
animation string? null pulse tada rotate
size string? null sm md lg inline (icon icon-{size}); unset, follows the font size
filled bool false Filled variant: ti-filled ti-filled-{name}, see Filled; with UX Icons, tabler:{name}-filled in the tabler set only
tooltip string? null Tooltip text (title, data-bs-toggle="tooltip"), also the aria-label (role="img") unless aria-hidden is set