Foundation

Icons

Nerio components consume icons through a small adapter API. Lucide is the default source, but custom SVG React components use the same contract.

Icon adapter contract

@nerio-ui/adapters/icons
SourceContract
LucideDefault icon source via @nerio-ui/adapters/icons.
Custom SVGReact SVG components implement IconSvgProps and use the same Icon contract.

Size contract

SizeTokenDefault
Extra small--n-icon-size-xs12px
Small--n-icon-size-sm14px
Medium--n-icon-size-md16px
Large--n-icon-size-lg18px
Extra large--n-icon-size-xl20px
RoleTokenDefault
Inline icon--n-icon-inline-size1em
Button icon--n-button-icon-size--n-icon-size-md
Small icon-only Button--n-icon-button-icon-size-sm--n-icon-size-md
Medium icon-only Button--n-icon-button-icon-size-md--n-icon-size-lg
Large icon-only Button--n-icon-button-icon-size-lg--n-icon-size-xl

Contract

RuleReason
Pass React icon components through the icon prop.Components stay independent from Lucide implementation details.
Use the default decorative mode inside named controls and labelled content.The renderer sets aria-hidden and prevents the SVG from receiving keyboard focus, so the surrounding text remains the accessible name.
Set decorative={false} and provide label for a standalone meaningful icon.The renderer exposes an image role and the supplied accessible name.
Icon-only controls require an accessible label.The visible icon is decorative; the label names the action.
Use semantic color tokens around icons.Icons inherit text color and stay theme-aware.
Let component aliases set icon size.Buttons and icon-only controls keep glyphs proportional to their hit area.
Opt into Lucide fixed strokes explicitly.Use lucideAbsoluteStrokeWidth only with Lucide icons. Generic IconSvgProps never includes the Lucide-only property, so ordinary custom SVG prop spreads stay warning-free.

Usage

import { Search } from '@nerio-ui/adapters/icons';import { Icon } from '@nerio-ui/ui';import { Button } from '@nerio-ui/ui/client';<Icon icon={Search} /><Icon icon={Search} lucideAbsoluteStrokeWidth /><Button icon={Search} aria-label="Search workspace" tooltip="Search workspace" />
import type { IconSvgProps } from '@nerio-ui/adapters/icons';function CustomLogoIcon({ strokeWidth = 2, ...props }: IconSvgProps) {  return (    <svg viewBox="0 0 24 24" fill="none" {...props}>      <path d="M5 17V7l7 10V7l7 10V7" stroke="currentColor" strokeWidth={strokeWidth} />    </svg>  );}<Icon decorative={false} icon={CustomLogoIcon} label="Nerio logo" />

Migration

Import IconComponent and IconSvgProps from @nerio-ui/adapters/icons for icon props and custom SVG implementations. The same type names remain re-exported from @nerio-ui/ui as compatible aliases, but new component APIs should use the adapter boundary. Existing LucideIcon imports remain compatible while Lucide is the default source. During the Core 0.1 alpha, replace an explicit absoluteStrokeWidth Icon prop with lucideAbsoluteStrokeWidth; the old name remains as a deprecated alias until the next major version. Custom SVG components should accept and spread only IconSvgProps.

The previous @nerio-ui/adapters root import is intentionally unsupported during the pre-release alpha. Use the explicit icons subpath so UI consumers do not resolve unrelated table, chart, form, or schema integrations.

Do / do not

GuidanceRecommendation
DoUse icons to clarify compact actions and metadata when text would be repetitive.
Do notUse brand color for routine icons or rely on an icon without an accessible name.