Icon
Semantic icon primitive for rendering the SDK's shared icon slots through EnadProvider.
Best for
Import
import { Icon } from "@enadhq/enad-react-sdk/client/icons"When to use it
Use Icon when application code wants the same semantic icon language that the SDK uses internally. It is the fastest path for rendering things like search icons, trust badges, cart chrome, and small decorative affordances without coupling your code to a specific icon library.
Reach for useIcon() instead when you are building your own composed component and need the resolved icon component directly.
Slot strategy
The icon system has three layers:
IconSlotMapdefines the complete semantic contract.EnadProviderreceives the active slot map throughicons.IconanduseIcon()read from that provider and render the resolved component.
If you do not pass icons, EnadProvider uses phosphorIcons by default.
For most apps, pick one of the shipped curated adapters for the whole tree:
phosphorIconslucideIconshugeIconscarbonIcons
If a brand wants full control, supply a complete custom IconSlotMap.
If you only need to replace a subset of slots, use createIconifyIcons({ names }). That lets the app keep the SDK's semantic slot contract while sourcing selected icons from Iconify.
State and theming guidance
Icons inherit their visual tone from normal classes like size-*, text-*, and layout utilities. Keep decorative icons aria-hidden, and give icon-only buttons their own accessible label on the interactive parent.
For Iconify-backed setup, keep the mapping explicit and use the standard prefix:name format shown by Icones. Any slot you leave out falls back to Phosphor unless you pass a different fallback map, so partial migrations are safe and incremental.
Use adapter overrides when a curated family is almost right and you only need to swap a couple of slots. Use a full custom IconSlotMap when the product has its own icon library and every slot should be owned locally.
Examples
Live examples you can edit directly in the sandbox.
Render semantic slots directly
Use Icon when app code wants the same slot names the SDK uses internally, without importing library-specific SVG components.
Switch to a curated adapter
Pass a shipped adapter into EnadProvider when the whole app should use a different icon family.
Compose with useIcon()
Use the hook when your own component needs the resolved icon component instead of rendering through the Icon wrapper.
Override selected slots with Iconify
Map only the slots you care about to Iconify names. Unmapped slots still work through the fallback adapter.
Component Sets
Preview the first example across the available component-set presets to compare tone, spacing, and structural defaults.