-
Notifications
You must be signed in to change notification settings - Fork 4
Description
🧩 Icon path inconsistency between Sanity schema and UI component
Problem:
The Sanity icon schema currently saves only the raw Lucide icon name (e.g. "Activity"),
but the Icon component expects the full path format required by [ic0n.dev](https://github.com/nuotsu/ic0n.dev), including the icon set prefix and component name:
<img src="https://ic0n.dev/lu/LuActivity" alt="" />Because of this mismatch, components like Feature.tsx must manually build the full ic0n value:
const icon: Sanity.Icon = {
_type: "icon",
ic0n: `lu/Lu${iconName}?hex=FFFFFF`,
size: "32px",
};This workaround introduces redundant logic and breaks consistency between Sanity data and the Icon component.
Reference:
https://github.com/nuotsu/ic0n.dev
<img src="https://ic0n.dev/<ICON_SET>/<ICON_NAME>" alt="" />
Improvement idea:
- Add a color field (e.g.
"color"or"hex") to the Sanity schema to control icon color. - Add a prefix (icon set) option or logic inside
Iconto automatically prependlu/Luto short icon names (e.g."Activity"→"lu/LuActivity").
Expected:
-
Schema and UI both use compatible
ic0nformats. -
Editors can choose icon color and optionally icon set.
-
The
Iconcomponent correctly builds URLs like:<img src="https://ic0n.dev/lu/LuActivity?hex=FFFFFF" alt="" />
Files affected:
src/sanity/schemaTypes/objects/icon.tsxsrc/ui/Icon.tsxsrc/ui/modules/Feature.tsx