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

@timoconnellaus/ai-ui-annotate-nextjs

v0.0.1

Published

Next.js plugin for AI UI Annotate - add inline annotations to your React components during development.

Readme

@timoconnellaus/ai-ui-annotate-nextjs

Next.js plugin for AI UI Annotate - add inline annotations to your React components during development.

Installation

npm install @timoconnellaus/ai-ui-annotate-nextjs
# or
yarn add @timoconnellaus/ai-ui-annotate-nextjs
# or
pnpm add @timoconnellaus/ai-ui-annotate-nextjs
# or
bun add @timoconnellaus/ai-ui-annotate-nextjs

Requirements

  • Next.js 13.0.0 or later
  • React 18.0.0 or later

Usage

1. Configure next.config.js

Wrap your Next.js configuration with withAiUiAnnotate:

// next.config.js (or next.config.ts)
import { withAiUiAnnotate } from '@timoconnellaus/ai-ui-annotate-nextjs'

export default withAiUiAnnotate({
  hotkey: 'alt',  // optional, default: 'alt'
  port: 8234,     // optional, default: 8234
})({
  // your existing Next.js config
  reactStrictMode: true,
})

2. Add the Script Component

Add the AiUiAnnotateScript component to inject the runtime.

App Router (Next.js 13+)

// app/layout.tsx
import { AiUiAnnotateScript } from '@timoconnellaus/ai-ui-annotate-nextjs'

export default function RootLayout({
  children,
}: {
  children: React.ReactNode
}) {
  return (
    <html>
      <body>
        {children}
        <AiUiAnnotateScript hotkey="alt" port={8234} />
      </body>
    </html>
  )
}

Pages Router

// pages/_app.tsx
import type { AppProps } from 'next/app'
import { AiUiAnnotateScript } from '@timoconnellaus/ai-ui-annotate-nextjs'

export default function MyApp({ Component, pageProps }: AppProps) {
  return (
    <>
      <Component {...pageProps} />
      <AiUiAnnotateScript hotkey="alt" port={8234} />
    </>
  )
}

Configuration Options

| Option | Type | Default | Description | |--------|------|---------|-------------| | hotkey | string | "alt" | The key to hold for enabling annotation mode. Supported: alt, option, ctrl, meta, shift | | port | number | 8234 | WebSocket server port (must be 1024-65535) | | outputDir | string | ".ai-ui-annotate" | Directory for storing annotation data |

How It Works

  1. Build Transform: During development, the webpack loader transforms your JSX/TSX files to inject data-component and data-source attributes on React elements.

  2. WebSocket Server: A WebSocket server starts automatically when you run next dev, enabling real-time communication for annotations.

  3. Runtime Script: The AiUiAnnotateScript component initializes the annotation UI when you hold the configured hotkey.

Development Only

This plugin is designed for development use only:

  • The config wrapper returns a pass-through in production (NODE_ENV=production)
  • The script component renders nothing in production
  • No annotation code is included in production builds

Troubleshooting

Port Already in Use

If you see "port already in use", either:

  1. Stop the process using that port
  2. Configure a different port in both the config wrapper and script component
// Use a different port
withAiUiAnnotate({ port: 8235 })({ /* config */ })
<AiUiAnnotateScript port={8235} />

SSR Hydration Errors

The AiUiAnnotateScript component uses 'use client' and only renders after client-side mount to prevent hydration mismatches. If you encounter issues, ensure you're using the component correctly in your layout.

Transform Not Working

Ensure your files have .js, .jsx, .ts, or .tsx extensions. The loader skips node_modules automatically.

License

MIT