feat(a2ui): render real Material Symbols icons (not the name as text)#720
feat(a2ui): render real Material Symbols icons (not the name as text)#720blove wants to merge 2 commits into
Conversation
… the name as text) Aligns the a2ui catalog Icon with the canonical A2UI renderer: the icon name is a Material Symbols ligature rendered via the Material Symbols Outlined font (currentColor, size prop). The library injects no web font; the a2ui demos load the Material Symbols stylesheet in index.html and the README documents the requirement for consumers. Unknown/unloaded names fall back gracefully.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Claude finished @blove's task in 1m 54s —— View job Code Review
The implementation is correct and well-structured. Two findings: Missing tests (medium) — The spec doc (
Everything else looks good: |
| line-height: 1; | ||
| letter-spacing: normal; | ||
| text-transform: none; | ||
| white-space: nowrap; |
There was a problem hiding this comment.
word-wrap is a deprecated alias; the standard property is overflow-wrap. Functionally equivalent today but worth aligning with the spec.
| white-space: nowrap; | |
| overflow-wrap: normal; |
| <span | ||
| class="a2ui-icon material-symbols-outlined" | ||
| [style.font-size]="size() ? size() + 'px' : '1.125rem'" | ||
| [attr.aria-label]="name" |
There was a problem hiding this comment.
The span has both visible text content ({{ name }}) and aria-label. Per the ARIA spec, aria-label overrides text content for role="img", so screen readers announce the icon name cleanly without speaking the ligature text — this is correct. Just noting it explicitly since it can look redundant at first glance.
Summary
The a2ui catalog
Iconcomponent rendered the icon name as literal text (a spec withIcon { name: "trending_up" }showed the string "trending_up"). This makes it render the actual glyph, aligned with the canonical A2UI renderer, which uses Material Symbols — thenameis a Material Symbols ligature.Changes
a2ui-iconnow outputs the name into amaterial-symbols-outlined-classed span and carries the Material Symbols Outlined font rules in its own styles (so it depends only on the@font-face, not a global helper class).currentColor(theme-aware) + size viafont-size. Renders nothing when there's no name.<head>of the 4 a2ui demos (examples/chat,examples/ag-ui,cockpit/chat/a2ui,cockpit/ag-ui/a2ui). The library injects no web font —libs/chat/README.mddocuments the requirement for consumers (standard for icon fonts).Verification
nx run-many -t test lint build --projects=chat— green.Spec:
docs/superpowers/specs/2026-06-20-a2ui-material-symbols-icons-design.md🤖 Generated with Claude Code