Skip to content

feat(react): add Popover component#53

Draft
Poafs1 wants to merge 1 commit intomainfrom
feat/popover-component
Draft

feat(react): add Popover component#53
Poafs1 wants to merge 1 commit intomainfrom
feat/popover-component

Conversation

@Poafs1
Copy link
Contributor

@Poafs1 Poafs1 commented Feb 25, 2026

Summary

  • Adds a headless, accessible Popover component with click trigger, FloatingFocusManager focus management, and optional modal mode
  • Follows the same flat, props-driven API pattern as Tooltip, Select, and Combobox
  • Includes usePopover hook wrapping @floating-ui/react with useClick, useDismiss, and useRole("dialog")

Features

  • Click-triggered toggle with controlled and uncontrolled modes
  • Optional modal prop for focus trapping + aria-modal + screen reader isolation
  • FloatingFocusManager with initialFocus and returnFocus props
  • Configurable closeOnEscape and closeOnOutsideClick
  • 12 placement options with collision-aware flip/shift
  • Optional pointing arrow via FloatingArrow
  • Portal rendering (default) with portalRoot option
  • CSS exit animations via data-state attribute and useExitTransition
  • --ck-popover-transform-origin CSS custom property for scale animations
  • forceMount for animation library compatibility
  • maxWidth, className, variantName, ref forwarding

Data Attributes

Attribute Values
data-ck "popover"
data-state "open" | "closed"
data-side "top" | "bottom" | "left" | "right"
data-align "start" | "center" | "end"
data-variant user-defined

Test Plan

  • 37 tests covering rendering, click interactions, controlled mode, content, placement, portal, accessibility, modal mode, forceMount, ref forwarding, className, and maxWidth
  • All 1415 tests pass (no regressions)
  • Build passes
  • Lint passes
  • Pre-existing typecheck errors only (none in popover files)

🤖 Generated with Claude Code

Headless, accessible Popover with click trigger, modal support,
focus management, arrow, portal, and CSS exit animations.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@vercel
Copy link

vercel bot commented Feb 25, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
packages-app Building Building Preview, Comment Feb 25, 2026 11:55am

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