"> <% if as == :button %> <%# Wrap the trigger icon in a focusable ` <% else %> <%# `as: :span` — used when the tooltip is rendered inside an already-focusable interactive ancestor (``, ``, …), where nested interactive content is forbidden or undesirable. Keyboard reveal is wired in the controller, which also binds `focusin/focusout/keydown` on the closest `a`/`summary` ancestor — because `focusin` only bubbles UP, a listener on this descendant span would never fire when the ancestor receives focus. Pass `html_class:` (e.g. size-full) when the wrapper should fill an icon-only link's hit target. %> <%= helpers.icon icon_name, size: size, color: color %> <% end %>