Base Pure CSS

Icon

Nabu’s line icons from the core; decorative by default, accessible with a label.

Real scenarios

The component as it is used in a product — not a specimen grid.

The document manager’s file list

The type glyph sits beside its text, so it is decorative (aria-hidden) and follows the row’s size and colour. The sync status carries meaning on its own — there it takes a label and renders as role=img, and the word stays next to it so colour is never the only cue. The folder’s “go deeper” chevron is directional: it flips by itself on this RTL page.

  • Invoices 1404 24 files
  • Contract — Nabu.pdf 2.1 MB · yesterday Synced
  • Store banner.png 840 KB · 2 days ago Synced
  • Podcast intro.mp3 4.7 MB · 3 days ago Upload failed
  • Voice note from support 1.2 MB · last week Synced

Picking the project’s icon

The whole core set — 56 icons — as a real picker: native radios under each tile, so arrow keys and Space work and the checked tile is announced. The name under every icon is its API name, ready to copy into code.

Project icon

Current pick: sparkles

The two rules everyone asks about

Arrows and chevrons that point along the reading direction mirror themselves on RTL pages — “next” keeps pointing at the inline end without any extra class. And an icon has no size or colour of its own: it rides the text (1.15em) and takes currentColor, so both come from the parent.

Directional, self-mirroring
  • arrow-left
  • arrow-right
  • chevron-left
  • chevron-right

On this page dir is ltr, so arrow-right points at the inline end — flip the language and watch them turn.

Sized by the text, tinted by the text
var(--nx-text-sm) var(--nx-text-md) var(--nx-text-lg) var(--nx-text-xl) var(--nx-text-2xl)

star, play and stop are drawn filled; the rest are stroked. Without the component the helper prints the same svg — inline like this:

Important props

Important props
Prop Type Default What it does
name string — An icon name from the core set (packages/core/src/js/icons.ts); left/right arrows and chevrons are directional and mirror themselves on RTL pages.
label string null With a label the icon becomes an img; without it it is aria-hidden.
class string '' Classes pass through to the svg; size rides the surrounding text (1.15em) and colour is currentColor — set both via the parent’s font-size/color.

Snippet

{{-- تزئینی — کنار متن خودش --}}
<x-nx::icon name="file" />

{{-- بامعنا — نقش img با برچسب دسترس‌پذیر --}}
<x-nx::icon name="alert-triangle" label="بارگذاری ناموفق" />

{{-- بدون کامپوننت، همان خروجی --}}
{{ \NabuXUI\NabuXUI::icon('check') }}