Skip to content

feat(web): animate Kubai icons from their parent button - #280

Merged
suiramdev merged 1 commit into
devfrom
feat/animate-kuba-icons-on-hover
Nov 13, 2026
Merged

suiramdev merged 1 commit into
devfrom
feat/animate-kuba-icons-on-hover

Conversation

@suiramdev

Copy link
Copy Markdown
Owner

Summary

Every Kubai icon inside a control now animates from the control: hovering or focusing the whole button plays it, and a real change to the button's toggled ARIA state (aria-pressed, -checked, -selected, -expanded, -current) plays it once. Start with HostAnimatedKubaiIcon in apps/web/src/shared/lib/kubai-icon.tsx.

Motivation

  • Icons only moved when the pointer was over the glyph itself, so most hovers on a button showed nothing.
  • Toggling a control (navigating, picking a theme) gave the icon no feedback.

Drawbacks

  • The 460 ms motion length is copied from kubai-icons, which does not export it.
  • Losing a toggled state also plays the icon, so the row being left animates too.

Prior art

  • The library's trigger="parent" binds hover only and needs a data-kubai-trigger attribute on hosts inside vendored @freenary/ui primitives; rejected in favour of driving its controlled hover prop.

Notes

  • Visual change: icon motion on button hover, focus and toggle.
  • No tests added; verified in the browser on the login page's Theme button.
  • apps/fumadocs: none — no page describes icon motion. docs/engineering/web-ui.md and apps/web/AGENTS.md updated.

@suiramdev
suiramdev enabled auto-merge (squash) November 13, 2026 13:56
@github-actions github-actions Bot added the type: feature A new capability, or an improvement to an existing one label Nov 13, 2026
@suiramdev
suiramdev merged commit 9b8ffa6 into dev Nov 13, 2026
4 checks passed
@suiramdev
suiramdev deleted the feat/animate-kuba-icons-on-hover branch November 13, 2026 13:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: feature A new capability, or an improvement to an existing one

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant