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

@goddard-ai/ui-primitives

v0.1.4

Published

Unstyled Preact overlay primitives for Goddard UI packages: modal dialogs, anchored popovers, menus, tooltips, portals, and floating positioning.

Readme

@goddard-ai/ui-primitives

Unstyled Preact overlay primitives for Goddard UI packages: modal dialogs, anchored popovers, menus, tooltips, portals, and floating positioning.

Fit

Use this package when you need:

  • Preact components that own overlay behavior but leave styling to the app.
  • Signal-driven open state with @preact/signals.
  • Accessible focus, dismissal, portal, and keyboard behavior for common overlays.
  • Floating UI placement without adopting a full component system.

Do not use it when you need:

  • Styled widgets or design tokens.
  • React components; the package targets Preact.
  • Server-only rendering; these primitives use DOM APIs, focus, portals, pointer events, and layout measurement.
  • A general-purpose overlay framework with arbitrary root names or extension hooks.

Requirements and tradeoff

Hard requirements:

  • Preact 10 or newer as a peer dependency.
  • Browser DOM APIs.
  • @preact/signals state for controlled overlay visibility.
  • Host applications must configure portal roots before overlays render.

Primary tradeoff: the package keeps behavior centralized and styling external. You get predictable shared overlay mechanics, but callers must provide markup labels, CSS classes, app-specific layout, and state ownership.

Minimal proof

This example demonstrates the core contract: configure portal roots once, own open as a signal, anchor the overlay to a DOM element, and style externally.

import { Popover, setOverlayPortalRoots } from "@goddard-ai/ui-primitives"
import { signal } from "@preact/signals"

setOverlayPortalRoots({
  dialog: () => document.getElementById("dialog-root"),
  menu: () => document.getElementById("overlay-root"),
})

const open = signal(false)
let button: HTMLButtonElement | null = null

export function ExamplePopover() {
  return (
    <>
      <button ref={(element) => (button = element)} onClick={() => (open.value = true)}>
        Open
      </button>
      <Popover
        open={open}
        anchor={() => button}
        ariaLabel="Example actions"
        class="popover"
        placement="bottom-start"
      >
        <button onClick={() => (open.value = false)}>Close</button>
      </Popover>
    </>
  )
}

Documentation map

  • docs/agent-reference.md: compact API and usage reference optimized for coding agents.
  • docs/context.md: concepts, lifecycle rules, invariants, and API-selection guidance.
  • examples/: copyable component patterns for portal setup, popovers, modals, menus, and tooltips.
  • Generated declarations in dist/index.d.ts: exact published signatures after build.

Public entrypoint

Import all public API from the package root:

import { Menu, MenuItem, Modal, Popover, Tooltip } from "@goddard-ai/ui-primitives"