Skip to content
Eskais UI

Theming

Icons

Components draw their icons with lucide-react, imported by name the way shadcn does. Icon names one for screen readers when it carries meaning.

Install

Every item that shows an icon lists lucide-react as a dependency, without a version, so shadcn installs the latest release in a project that doesn't have it and leaves the one you have alone. The icons need 1.68.0 or newer: upgrade an older one. Add it yourself to use icons in your own code, and add icon for named icons:

npm install lucide-reactnpx shadcn@latest add @eskais/icon

Import by name

Import each icon by its name from lucide-react; your bundler keeps only the ones you use. Browse the whole set on lucide.dev.

import { ChevronDownIcon, TrashIcon } from "lucide-react"
<Button variant="outline">  <TrashIcon />  Delete</Button>

Pick one to see its import, ready to copy.

Used by Select, Accordion, Collapsible, NavigationMenu
import { ChevronDownIcon } from "lucide-react"

Decorative or meaningful

  • Lucide sets aria-hidden on an icon that has no aria-*, role or title prop, so a decorative icon next to text needs nothing. It is hidden from agents too.
  • When the icon is the only sign of what it means, wrap it: <Icon icon={XIcon} label="…" /> renders role="img" with that aria-label, in the page's language.
  • An icon-only button is named by the button (aria-label), and its icon stays decorative.
import { TriangleExclamationPointIcon } from "lucide-react"
import { Icon } from "@/components/ui/icon"
// Decorative: the text says it all, and lucide sets aria-hidden on its own.<span><TriangleExclamationPointIcon className="size-4" /> Blocked</span>
// Meaningful: nothing else says "Blocked", so the icon carries the name.<Icon icon={TriangleExclamationPointIcon} label="Blocked" className="size-4 text-destructive" />
// An icon-only button is named by the button, not the icon.<Button size="icon" aria-label="Delete"><TrashIcon /></Button>
Blocked

Size

Controls size their icons: Button, Toggle, menu items, inputs and selects set [&_svg]:size-4, Badge size-3. Those classes win over lucide's size prop. Anywhere else, give the icon a size-* class that matches the text beside it; an icon nothing sizes is 24px.

ClassBesideLooks
size-3.5text-caption, text-body-sm 2 min ago
size-4text-body report.pdf
size-5text-title-sm, text-title This week

Keep lucide's stroke of 2. A tick inside a small indicator (Checkbox, Select) takes strokeWidth={2.5} or {3} to stay legible. Mirror icons that point a direction with rtl:-scale-x-100.

Colour

Icons stroke with currentColor, so a text colour colours them. For status, use the tone's text colour, and still say the status in words.

  • text-muted-foreground
  • text-info
  • text-success
  • text-warning
  • text-destructive

In components

Put the icon first in a Button or Badge, before the text; the component spaces and sizes it. An Alert takes an icon as its first child and colours it with its tone. Toasts draw their tone's icon on their own.

PassedWaiting
Quota almost used
New runs pause at 100%.

Swap the icon library

The components import icons by name from lucide-react and nothing else depends on the library: only the import lines change. Point them at a module that exports the same names from another set, or your own drawings, and Icon takes any SVG component.

- import { ChevronDownIcon } from "lucide-react"+ import { ChevronDownIcon } from "@/components/icons"

Add your own icon

Draw it to lucide's grid so it sits with the rest: a 24×24 view box, a 2px stroke with round caps and joins, fill="none" and currentColor, decorative by default, passing its props to the <svg>. In the registry and on this site, the eskais/no-inline-icons lint rule flags any <svg>; only drawings that aren't icons, like the spinner or a logo, disable it with a reason.

import type { SVGAttributes } from "react"
export function RocketIcon(props: SVGAttributes<SVGSVGElement>) {  return (    <svg      xmlns="http://www.w3.org/2000/svg"      width="24"      height="24"      viewBox="0 0 24 24"      fill="none"      stroke="currentColor"      strokeWidth="2"      strokeLinecap="round"      strokeLinejoin="round"      aria-hidden="true"      {...props}    >      <path d="M5 19c1-3 3-5 6-6M14 4c3 0 6 3 6 6l-7 7-6-6Z" />    </svg>  )}
<Icon icon={RocketIcon} label="Launched" />