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

@copilotkit/web-components

v1.62.3

Published

Framework-agnostic shadow-DOM web components for CopilotKit - includes the <copilotkit-threads-drawer> threads drawer element

Readme

@copilotkit/web-components

Framework-agnostic, shadow-DOM Lit custom elements for CopilotKit.

This package currently ships <copilotkit-threads-drawer> — a public, self-contained, controlled threads drawer. It is a pure VIEW: domain data flows in as properties and user intent flows out as DOM CustomEvents. It imports no React, Angular, or @copilotkit/core code and renders correctly in any host page, surviving hostile host CSS (all: unset, Tailwind preflight !important).

Install

npm install @copilotkit/web-components lit

lit is a peer/runtime dependency so the host dedupes a single Lit runtime.

Usage

import { defineCopilotKitThreadsDrawer } from "@copilotkit/web-components/threads-drawer";

defineCopilotKitThreadsDrawer(); // registers <copilotkit-threads-drawer> (idempotent)
<copilotkit-threads-drawer active-thread-id="t-123"></copilotkit-threads-drawer>
<script>
  const drawer = document.querySelector("copilotkit-threads-drawer");
  drawer.threads = [
    {
      id: "t-123",
      name: "My thread",
      archived: false,
      createdAt: "...",
      updatedAt: "...",
    },
  ];
  drawer.addEventListener("thread-selected", (e) => open(e.detail.threadId));
  drawer.addEventListener("new-thread", () => createThread());
</script>

Inbound properties (DOMAIN state — owned by the consumer)

| property | type | notes | | ---------------- | ---------------- | ----------------------------------------------- | | threads | DrawerThread[] | the element re-orders + filters authoritatively | | loading | boolean | initial-fetch loading | | error | string \| null | initial-fetch error → actionable Retry | | activeThreadId | string \| null | drives selection highlight | | licensed | boolean | false → upsell replaces the list | | fetchingMore | boolean | in-flight pagination | | fetchMoreError | string \| null | inline "couldn't load more — retry" | | open | boolean | externally controllable (mobile coordination) | | collapsed | boolean | desktop collapse-to-rail |

Outbound events (INTENT — bubbling + composed CustomEvents)

thread-selected, archive, unarchive, delete (after in-element confirm), new-thread, filter-change, open-change, retry ({ scope }), upsell.

The element owns VIEW state: open/collapsed, the Active/All filter, the confirm-delete dialog, and per-row entry/reveal animations.

Theming (hybrid)

  • CSS variables pierce the shadow boundary — set --cpk-drawer-* (-bg, -fg, -surface, -accent, -primary, -danger, -border, -ring, -radius, -width, -font-family, …) from the host.
  • ::part() hooks on structural nodes (root, header, list, row, row-name, confirm-dialog, backdrop, …).
  • Named slots: header, footer, empty, upsell, memories, plus a per-row slot row:{id} that projects wrapper-provided row content while the element keeps the selection/archived/animation chrome around it.

The built-in default skin's token values are derived at build time from react-core's canonical theme (packages/react-core/src/v2/styles/globals.css) by scripts/generate-tokens.ts, which writes the checked-in src/threads-drawer/generated-tokens.ts. Run pnpm run gen:tokens to regenerate; generated-tokens.test.ts fails if the checked-in values drift from react-core.

Mobile + a11y

At/below 768px the drawer is an off-canvas modal overlay with backdrop, Escape close, scroll-lock, and a focus trap (mobile only) that operates over the composed/flattened tree so slotted rows are included. On desktop it is an in-flow region with collapse-to-rail — not a modal (no focus trap, no scroll-lock).