Repository navigation
Description
✨ Summary
EuiIcon still causes user-perceivable rendering issues in Kibana (load fade-in → extra document layers). Invalid or removed glyph names fail silently at runtime (<img src>). Closing IconType is not the path: it is a consumer-wide type migration and does not fix tree-shaking, layers, or the class-component/cache debt.
Direction: ship tree-shakeable icon components in a separate package, migrate Kibana and Cloud UI onto them, then remove icons from @elastic/eui. Keep EuiIcon only as deprecated compat until that cutover. Unknown string names on the old API get an empty placeholder + console warning in the meantime.
❗ Problem or Opportunity
1. Fade-in loading creates extra document layers
First-load fade-in puts each EuiIcon on its own layer, which slows graphics (not React) re-renders — especially scrollable EuiDataGrid (e.g. Alerts). New icon components must not repeat this.
2. Not tree-shakeable / webpack-only Partial
icon_map.ts uses explicit () => import('./assets/foo'). Unused SVGs are code-split; Vite/Rollup/esbuild work (#5463, #7982, #7852).
String type still ships the full name map with every EuiIcon import. True tree-shaking needs imported components (same idea as @elastic/eui-illustrations).
3. Invalid glyph names fail silently
IconType is EuiIconType | string | ComponentType, so | string makes the union string. tsc does not catch typos or removed names. Runtime treats unknown strings as URLs → broken image. ESLint no-deprecated-icon-aliases is only warn and only known aliases.
Closing IconType (#9940, closed) was evaluated and not taken: ~700 Kibana type errors, TS2590 on button ExclusiveUnion, Cloud UI the same class of work. Plugin registries (euiIconType, iconClass) are runtime strings and would never fully type-check as a closed glyph union.
🎯 Value
- DataGrid / Alerts: no extra layers on the new components.
- Unused glyphs drop out of the bundle.
- Missing names fail at import (and CI), not as broken
<img>s. - Can evolve glyphs (e.g. adaptive color) without fighting
EuiIcon.
Urgency
Broken leftover aliases in Kibana are already renamed. No rush to close IconType. Runtime empty+warn is the small immediate gap. The package + migration is the real initiative.
🧠 Feasibility & Direction
Do not rewrite EuiIcon in place (class component, cache, onIconLoad, string map). New package + new components; deprecate EuiIcon; migrate consumers; then delete icons from @elastic/eui.
Custom URLs / data URIs / SVG components stay on EuiIcon until those call sites have an explicit story (or stay as <img> / raw SVG). Glyph names move to imported components.
❓ Open Questions to answer
- Package name:
@elastic/eui-icons(#8909) vs@elastic/eui-glyphs(thread). - One
<EuiGlyph type={Warning} />wrapper vs dedicated<Warning />components (or both). - Adaptive / CSS-variable glyphs (kibana#206540) — in scope for the new package, not for
EuiIcon. - How long
EuiIconstays in@elastic/euiafter #9980; what remains allowed (custom assets only vs full deprecation).
📐 Definition
Proposed Solution
- #9967 —
EuiIcon: unknown glyph-shaped strings → empty placeholder +console.error/warn. Do not treat them as<img src>. Real asset URLs and components unchanged. - #9979 —
no-deprecated-icon-aliases→error; fix remaining hits. - #8909 —
@elastic/eui-icons: assets + generated components; deprecateEuiIconin favor of imports. - #9980 — Kibana + Cloud UI: codemods / ESLint / agent skills; migrate straightforward
EuiIconglyph usage; codeowners for the rest. Starts afterEuiIconis deprecated. - #9981 — breaking: remove icon bundling from
@elastic/euionce consumers are off it; communicate.
Later: escalate remaining string-glyph usage (console + ESLint) to errors so new EuiIcon glyph usage cannot land.
Out of scope / closed: #9940 closed IconType; #8910 onIconLoad, #8911 FC rewrite, #8912 cache — die with old EuiIcon, not rewritten in place.
Acceptance criteria
- Unknown
EuiIconglyph names do not render the browser broken-image icon. - Icons are importable, tree-shakeable components from a dedicated package.
- Kibana and Cloud UI have migrated straightforward glyph usage; remaining cases tracked with owners.
-
@elastic/euino longer ships the icon map/assets (breaking, after migration). - Docs: import components, not string
type, for glyphs.
Definition of done
Package published, consumers migrated (or explicitly excepted), icons removed from @elastic/eui, changelog + upgrade email/docs.
Documentation needs
Consuming-EUI + Icons docs: new imports, deprecation of string type / EuiIcon for glyphs, custom asset guidance, upgrade guide for #9981.
Impact scope
Breaking when icons leave @elastic/eui. Until then: additive package + deprecation. Kibana and Cloud UI are the migration surface (large, mechanical + some registries/custom renderers).
Rollout plan
EUI-only 9967 / 9979 → publish icons package + deprecate EuiIcon → Kibana/Cloud UI PRs per team → breaking removal. No closed-IconType EUI bump as the migration vehicle.
Goals
Refactor EuiIcon to not rely on webpack magic stringsDone- Switch glyph usage from string
typeto imported components for tree-shaking and valid names in CI - Prefer sync component imports; keep async only where needed
- New components must not use the load fade-in / extra layer
Activity
[-][Meta] Refactor EuiIcon for performance and enhanced bundler support[/-][+][Epic] Refactor EuiIcon for performance and enhanced bundler support[/+]tkajtoch commentedon Jul 11, 2025
Prioritizing this as "should" on the next quarter roadmap due to the recently found performance bottleneck caused by icon load animations, which needs a refactor of the loading logic to get it fixed.
onIconLoadprop #8910github-actions commentedon May 11, 2026
👋 Hi there - this issue hasn't had any activity in 6 months. If the EUI team has not explicitly expressed that this is something on our roadmap, it's unlikely that we'll pick this issue up. We would sincerely appreciate a PR/community contribution if this is something that matters to you! If not, and there is no further activity on this issue for another 6 months (i.e. it's stale for over a year), the issue will be auto-closed.
2 remaining items
clintandrewhall commentedon Aug 28, 2026
@weronikaolejniczak We could consider naming the package
@elastic/eui-glyphs, and a newEuiGlyphcomponent, leavingEuiIconin it's current state, (perhaps even deprecated, usingEuiGlyphunder the hood, etc). ThenEuiIconcan continue to support base64, urls, etc, whereasEuiGlyphwould purely for the glyphs we support. Then the rollout can be gradual, and enforced by a goodeslintrule: "you're using a pre-defined glyph,EuiGlyphis more appropriate"). Would that help? Seems like it would.weronikaolejniczak commentedon Aug 28, 2026
@clintandrewhall yes, the best course of action IMHO is to not touch that
EuiIconand wrestle with Kibana and Cloud UI usage but deprecate and move towards a new solution. SoEuiGlyphandeui-glyphsworks perfectly 👍🏻 It's a similar idea to what I wrote above (imported SVG modules/dedicated icon components; we can even do both if we'd like, for those non-React usages).clintandrewhall commentedon Aug 28, 2026
Yeah, re-reading, I think I just restated your approach with component names. 😆 Glad to be aligned! Seems like a huge benefit with work we've done before. Would love to also explore the adaptive illustrations approach with the glyphs, if that's workable, now that we're closer to switching light/dark/high-contrast without refreshing the page.
sphilipse commentedon Aug 28, 2026
I worry that leaving EuiIcon in place is going to mean we will ~never move off of it, because consumers are going to keep using it regardless of eslint warns, deprecated annotations etc. It's going to remain a pain in everyone's butt.
Also from a consumer point of view, just typing a string is a much nicer experience than needing to import it explicitly from a package.
If we do build a new package as a migration target, we should put in effort to:
Otherwise we have just created a second maintenance burden for ourselves without meaningfully improving the existing situation.
[-][Epic] Refactor EuiIcon for performance and enhanced bundler support[/-][+][Epic] Refactor EuiIcon for type-safety and performance[/+]weronikaolejniczak commentedon Aug 31, 2026
@sphilipse I understand the concern, thanks for sharing your thoughts 🙏🏻
I would argue that separating this into a library does meaningfully improve the existing situation. Icons would be tree-shakeable, we would be able to modify them for e.g. adaptive color scheme just like we did with illustrations, we would reliably be able to tell consumers when icons don't exist without them being able to simply override types on their side, and we wouldn't drag behind the tech-debt that accumulated around icons (class component, cache registry,
onIconLoad, slowing down performance).This way I'm proposing a meaningful refactor to icons as a whole, not only targeted fix for the string and calling it a day. Aligning
EuiIconto what I wrote above ☝🏻 would come with a lot of fighting the component and potential issues to be resolved on consumer side. Much more effort, both on EUI and Kibana/Cloud UI side, than starting anew and migrating offEuiIconusage. Most cases we would be able to migrate with the initiative. The trickier cases like custom rendering we would raise with code-owners.That being said, I'm happy to continue #9940 but I want to say:
sphilipse commentedon Aug 31, 2026
After discussing synchronously, let's do this:
EuiIconto dedicated components #9980[-][Epic] Refactor EuiIcon for type-safety and performance[/-][+][Epic] Improve icons[/+]