Tailwind CSS

Use Tailwind CSS icons through ordinary className utilities. Devigner Icons are SVG React components that inherit currentColor, so the same classes you use for text control icon size, colour and interactive states.

Install the icon library

Terminal
pnpm add @devigner-ui/icons

The classes below work the same in Vue and Svelte, with class in place of className; see Frameworks in the sidebar.

Import only what the component needs:

TSX
import { IconBell } from "@devigner-ui/icons/Bell";
import { IconSettings } from "@devigner-ui/icons/Settings";

Set size and colour with utilities

Tailwind's size-* utilities set an icon's width and height. text-* utilities set its stroke or fill through currentColor.

TSX
<IconBell className="size-5 text-slate-600" />
<IconSettings className="size-6 text-indigo-600" />

Keep icon and text in the same colour context for hover and dark-mode states:

TSX
<a
  href="/settings"
  className="inline-flex items-center gap-2 text-slate-700 hover:text-indigo-600 dark:text-slate-200"
>
  <IconSettings className="size-5" />
  Settings
</a>

Pick a visual style

Every icon is available as outline, twotone, bold, bulk and broken. Use variant when an interface needs more visual weight or a clearer secondary tone.

TSX
import { IconHeart } from "@devigner-ui/icons";

<IconHeart className="size-6" />
<IconHeart variant="TwoTone" className="size-6 text-rose-600" />
<IconHeart variant="Bold" className="size-6 text-rose-600" />

Outline, twotone and broken icons also take strokeWidth:

TSX
<IconHeart className="size-6" strokeWidth={2} />

Build an accessible icon button

Use an accessible name when an icon is the only visible control content:

TSX
import { IconMagnifier } from "@devigner-ui/icons/Magnifier";

<button type="button" aria-label="Search" className="grid size-10 place-items-center rounded-md hover:bg-slate-100">
  <IconMagnifier className="size-5" />
</button>

Find icons in the full collection, system controls, or files and documents. For import patterns, see React SVG icons.

Documentation

Browse all 12,480 icons