Skip to main content
Version: latest
Server Component

Icon is best rendered on the server. Use the standard import (e.g. @prokodo/ui/icon) — the library detects the runtime automatically.

Icon

Icon renders SVG icons from the prokodo icon set. Icons are loaded from the jsDelivr CDN in any environment where process.env.MODE is not 'development' — in development mode they fall back to local /assets/icons.

Live demo →

Overview

import { Icon } from "@prokodo/ui/icon"
;<Icon name="arrow-right" size={24} color="primary" />

Import

import { Icon } from "@prokodo/ui/icon"

CSS:

import "@prokodo/ui/icon.css"

Props

PropTypeDefaultRequiredDescription
nameIconNameIcon identifier from the icon registry.
labelstringAccessible label text (sets aria-label).
sizeIconSizeIcon size (preset string or numeric px value).
colorstringCSS color value or token.
rolestringARIA role override.
onClick() => voidClick handler.
classNamestringCSS class on root element.

See src/components/icon/Icon.model.ts for the full IconProps type.


Design Tokens

Icon does not define component-specific CSS custom properties. It resolves color via currentColor from the following global semantic tokens:

TokenDescription
--pk-color-brandIcon color for color="primary"
--pk-color-accentIcon color for color="secondary"
--pk-color-mutedIcon color for color="info"
--pk-color-successIcon color for color="success"
--pk-color-warningIcon color for color="warning"
--pk-color-errorIcon color for color="error"
--pk-palette-whiteIcon color for color="white"

WCAG 2.2 Status

CriterionNameStatusNote
1.1.1Non-text Content (A)✅ FulfilledAll images, icons, and media require a text alternative (alt, aria-label, or aria-labelledby). Decorative-only elements must carry aria-hidden.
1.3.1Info and Relationships (A)✅ FulfilledSemantic structure (headings, lists, labels, landmarks) must be conveyed programmatically via HTML or ARIA.
4.1.2Name, Role, Value (A)✅ FulfilledName, role, and state of all interactive UI components must be programmatically determinable via native HTML semantics or ARIA.

Test coverage: 2 jest-axe assertion(s) across 1 test file(s) · 2 ARIA attribute occurrence(s) in source scan. Criteria marked 🔍 require manual verification in the final product integration and theme context.

Storybook

👉 Open Icon in Storybook


Source

src/components/icon/Icon.model.ts