Mods: let a Button show an icon (an Svg) instead of a text label
What I'm building
session-usage-band, a mod that draws a usage band above the prompt. On the desktop's Code tab it draws its icons and meters with Svg. The band has a disclosure toggle that opens and closes an expanded view.
The problemButton is the only element that takes a press, and it accepts nothing but a text label. Box and Svg have no onPress. So a mod that draws every other icon as an SVG has to draw its buttons as text glyphs (▿ / ▵). Those don't match the rest of the band, and glyph metrics vary by font: ⌄ sits about 5px low, and ⌃ reads as the Ctrl key.
!The band on the desktop: every icon is an Svg except the expand toggle, a text glyph, circled in red
What would help (any one of these)
- An
iconprop onButtontaking SVG markup, with thelabelkept as the accessible name. Surfaces without Svg would draw the label. - Allow one
Svgchild in aButtonon surfaces that draw Svg, with the label as the fallback. onPressonBox, with the same focus, hotkey and Enter handling aButtongets.
Option 1 keeps the terminal, keyboard focus and screen readers working as they do now.
Environment
Claude Code 2.1.295 (CLI) and the desktop app's bundled 2.1.289, macOS.