npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@edux-design/tooltips

v0.2.4

Published

Original Edux tooltip primitives with shared overlay behaviour, motion and colours. Provides `TooltipProvider`, `Tooltip`, `TooltipTrigger`, and `TooltipContent`.

Readme

@edux-design/tooltips

Original Edux tooltip primitives with shared overlay behaviour, motion and colours. Provides TooltipProvider, Tooltip, TooltipTrigger, and TooltipContent.

Token contracts

TooltipContent uses the shared --motion-distance-sm token for its 8px placement nudge on every side. This keeps tooltip motion aligned with the popover and overlay primitives without duplicating numeric offsets.


Installation

pnpm add @edux-design/tooltips @edux-design/utils
# or
npm install @edux-design/tooltips @edux-design/utils

Peer deps: react@^19.1.0, react-dom@^19.1.0.


Usage

import {
  TooltipProvider,
  Tooltip,
  TooltipTrigger,
  TooltipContent,
} from "@edux-design/tooltips";

export function IconWithTooltip() {
  return (
    <TooltipProvider>
      <Tooltip>
        <TooltipTrigger asChild>
          <button className="p-2 rounded-md hover:bg-bg-subtle">?</button>
        </TooltipTrigger>
        <TooltipContent side="bottom" sideOffset={6}>
          Helpful hint goes here.
        </TooltipContent>
      </Tooltip>
    </TooltipProvider>
  );
}

TooltipContent accepts Edux placement props (side, sideOffset) plus className. It automatically renders the arrow and uses a subtle fade/translate animation via Tailwind classes.


Development

pnpm --filter @edux-design/tooltips lint
pnpm --filter @edux-design/tooltips check-types
pnpm --filter @edux-design/tooltips build

Story: src/demos/Tooltip.stories.jsx.


Notes

  • Always wrap tooltips in TooltipProvider so hover/focus delay groups behave as expected.
  • TooltipTrigger forwards native props through the Edux trigger, so you can use asChild to keep DOM output clean.
  • For accessible labeling, ensure the trigger already has descriptive text or connect it with aria-label.

Public props, refs and portal ownership

The package exports TooltipProps, TooltipProviderProps, TooltipTriggerProps and TooltipContentProps. Root and Provider retain controlled/default state and shared delay behaviour. Trigger accepts native button attributes/events and forwards an HTMLButtonElement ref; use asChild when composing your own native button. Content forwards an HTMLDivElement ref and accepts native div attributes/events, placement/collision settings and cancellable onEscapeKeyDown/onPointerDownOutside handlers.

TooltipContent already renders its portal and arrow. Render it directly inside Tooltip; an outer Portal is redundant. The content inherits the nearest Edux theme/brand scope while escaping clipped ancestors. Existing caller style overrides, including z-index, are preserved.

See DS-26 acceptance for the historical public baseline. Original-engine behaviour is checked in Tooltip.original.test.tsx and the shared installed-consumer browser suite.

Content owns its surface and arrow, so asChild belongs on Trigger. forceMount keeps both the portal and content mounted when closed; callers using it manage closed-state visibility for their animation. Closed content is aria-hidden and inert, so retained animation DOM cannot be announced or receive focus. When an ancestor overlay closes, explicitly force-mounted content is retained as a hidden draft (hidden, display: none, and inert); ordinary content unmounts. Neither draft performs positioning, theme observation, delay or layer work. Scoped theme and brand classes, CSS variable overrides and later class/style changes follow the source scope. Caller-provided content styles take precedence.

Overlay interoperability

Tooltips, Modals, Drawers and Popovers use the same original @edux-design/overlays foundation. Keep one compatible installed foundation so Escape dismisses the tooltip first and preserves its parent layer. Package resolution should be checked from actual component importers, before fixture aliases or bundler configuration.

The foundation is an ordinary dependency; consumers keep the same four Tooltip exports. Trigger and content refs remain native button/div refs, and caller cancellation is honoured. Tooltip Content inherits source theme/brand scope through its active portal; closed ordinary tooltips allocate no theme observer, geometry listener or animation loop. forceMount explicitly retains the content DOM for host-controlled animation visibility.