Skip to content

feat(kit): share one hover card and move it between triggers - #150

Merged
riccardoperra merged 3 commits into
feat/upgrade-solid2-kobaltefrom
feat/hovercard-shared-host
Nov 28, 2026
Merged

riccardoperra merged 3 commits into
feat/upgrade-solid2-kobaltefrom
feat/hovercard-shared-host

Conversation

@riccardoperra

Copy link
Copy Markdown
Owner

What

Hover cards on a page now share one card. When the pointer moves to another trigger while a card is open, or within 400ms of it closing, the card moves there instead of closing and popping a second one. It slides to the new trigger, resizes to the new content, and fades the new content in.

  • Moving to a nearby trigger: the move happens at once, without openDelay.
  • Pointer on its way to the open card: another trigger it crosses takes the card only after 150ms of rest.
  • Keyboard (Tab): the card swaps its content in place, with no motion (Inkstone §7.3).
  • Reduced motion: the card stays in place and only the new content fades in.
  • Grouping: HoverCardGroup gives a set of triggers their own card (skipDelayDuration). shared={false} gives one card its own; forceMount implies it. A card uses the nearest group, otherwise the page card.

Motion

  • Timing: 200ms (--cui-motion-duration-panel) with --cui-motion-ease-out.
  • Slide: a transform transition on Kobalte's positioner. Floating UI recomputes x/y from the new anchor.
  • Resize: width and height animate through WAAPI on the card. A scale would stretch the text; this is the same exception Inkstone makes for the accordion's height. The proposed --cui-motion-ease-in-out token isn't adopted here.
  • Retargeting: the next move starts from the card's current size.

API changes

  • HoverCardContent is no longer polymorphic.
    • class, classes, style, ref, mount and the dismiss handlers go on the card.
    • Other attributes and handlers go on a display: contents wrapper around the children, because Kobalte reads a spread only once.
  • HoverCardProps drops Kobalte's id.
  • The trigger no longer uses a Kobalte popover anchor. It still sets data-expanded/data-closed.
  • utils/open-source also records pointerover. The browser fires it before the pointermove that crosses into an element, so overlays opened from pointerenter count as pointer-initiated.

Docs

  • The hover-card page gets "Moving between cards" and "Groups" sections, the HoverCardGroup API, the shared prop, keyboard, motion and SSR notes.
  • New demos: hover-card/shared and hover-card/group.
  • New Storybook stories: "Moving between rows" and "Two groups".
  • DESIGN.md §9.5 and the design patterns page are updated.
  • Changeset included.

Checks

  • Kit:
    • Browser tests: 675 pass, including 9 new ones in hover-card-shared.test.tsx.
    • SSR: 34 pass. Hydration: 41 pass.
    • Typecheck, api:check, docs:lint and docs:coverage pass.
  • Storybook in Chromium: with a real mouse, from row 1 to row 3 the card's top goes 112→134→144px in about 200ms, as one element. A real Tab moves it in place, with no motion, and it stays open.
  • Not run: docs:check-llms needs a running docs site.

🤖 Generated with Claude Code

Hover cards on a page share one surface. Moving the pointer to another
trigger while a card is open, or within 400ms of it closing, slides the
card to the new trigger and resizes it to the new content in 200ms
instead of closing one card and popping another. Keyboard moves swap in
place; reduced motion keeps only the content fade.

HoverCardGroup gives a set of triggers their own surface, and
shared={false} gives one card its own. The input tracker also records
pointerover, so an overlay opened from pointerenter sees that pointer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@changeset-bot

changeset-bot Bot commented Nov 28, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: a534066

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@codeui/kit Minor
@codeui/styles Minor
@codeui/storybook-playground Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-actions

github-actions Bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

CodeUI package preview

Built from a534066.

npm install https://pkg.pr.new/riccardoperra/codeui/@codeui/kit@a5340668cca2e644d1c2966e72f2231028026f15

The kit installs matching previews of @codeui/styles and @codeui/inkstone.

@github-actions

github-actions Bot commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

Docs preview deployed to Cloudflare Pages.

Built from a534066.

… beside them

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A hover card inside another card's content gets a surface of its own.
The outer card stays open while the pointer is on the inner card and
until it closes; a press on the inner card no longer dismisses it, and
Escape closes the inner card first.

An `a` trigger gets a dotted underline in the hint tone that takes the
text colour on hover and while open, so hover-card links read as such
in running text. Button and row triggers keep their own look.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@riccardoperra
riccardoperra merged commit 5bd7447 into feat/upgrade-solid2-kobalte Nov 28, 2026
5 of 6 checks passed

This branch was successfully deployed

1 active deployment
docs-preview — a5340668 Deployed Nov 28, 2026 by riccardoperra via Deploy to Cloudflare Pages #162
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant