API Reference
Nava Icons provides three APIs: static imports for tree shaking, a dynamic runtime API, and global configuration for setting defaults across your app.
Static API (Recommended)
Import individual icon components directly. Supports full tree shaking.
import { HomeIcon, CheckCircleIcon } from '@whydrf/nava-icon-react'
import type { IconName, IconMode } from '@whydrf/nava-icon-react'
<HomeIcon size={24} />
<CheckCircleIcon mode="filled" color="green" />Dynamic API
Use the <Icon> component for runtime icon selection.
import { Icon } from '@whydrf/nava-icon-react'
<Icon name="home" size={24} />
<Icon name="check-circle" mode="filled" />Global Configuration
Set default icon props once. All icons inherit these values; component props always override.
import { NavaIconProvider } from '@whydrf/nava-icon-react'
<NavaIconProvider size={20} color="gray" strokeWidth={1.5}>
<HomeIcon /> {/* inherits all defaults */}
</NavaIconProvider>NavaIconConfig
| Property | Type | Description |
|---|---|---|
| size | number | string | Default width and height |
| color | string | Default SVG stroke/fill color |
| strokeWidth | number | Default stroke width |
| className | string | Default CSS class name |
Shared type from @whydrf/nava-icon-core.
IconMode
| Value | Description |
|---|---|
| "regular" | Stroke-based outline (default) |
| "filled" | Solid fill variant |
Package Exports
| Package | Key Exports |
|---|---|
| @whydrf/nava-icon-core | NavaIconConfig type |
| @whydrf/nava-icon-react | Icon, NavaIconProvider, useNavaIconConfig |
| @whydrf/nava-icon-vue | NavaIcon, NavaIconPlugin, useNavaIconConfig |
| @whydrf/nava-icon-angular | IconComponent, NAVA_ICON_CONFIG |
| @whydrf/nava-icon-web-components | setNavaIconConfig, getNavaIconConfig |