Skip to content

Conversation

@Newbie012
Copy link
Contributor

@Newbie012 Newbie012 commented Dec 16, 2025

Adds Popover.Context, a render-prop component providing access to the popover context, including new onOpen. This allows custom state control while still using built-in components. I also Included documentation and a test case for hover behavior.

Example:

<Popover>
  <Popover.Target>
    <Popover.Context>
      {({ onOpen, onClose }) => (
        <button type="button" onMouseEnter={onOpen} onMouseLeave={onClose}>
          test-target
        </button>
      )}
    </Popover.Context>
  </Popover.Target>

  <Popover.Dropdown>
    <div>test-dropdown</div>
  </Popover.Dropdown>
</Popover>

Adds `Popover.Context`, a render-prop component providing access to the popover context, including new `onOpen`. This allows custom state control while still using built-in components. Includes documentation and a test case for hover behavior.
@Newbie012 Newbie012 changed the title FEAT feat: Introduce Popover.Context and onOpen handler feat: Introduce Popover.Context and onOpen handler Dec 16, 2025
Removed section on `onOpen` and `onClose` callbacks from popover documentation.
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