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

@agentkit-react/core

v0.1.0

Published

Ship AI chat in 10 lines of React. Drop-in hooks and components for streaming AI interfaces.

Readme

AgentKit

Ship AI chat in 10 lines of React.

npm version bundle size license

Drop-in hooks and components for streaming AI interfaces. Works with Claude, GPT, Vercel AI SDK, or any LLM. So simple an AI agent can write it for you.

Install

npm install @agentkit-react/core

10-Line Chat

import { useChat, ChatContainer, Message, InputBar } from '@agentkit-react/core'
import { anthropic } from '@agentkit-react/core/adapters'
import '@agentkit-react/core/theme'

function Chat() {
  const chat = useChat({
    adapter: anthropic({ apiKey: 'your-key', model: 'claude-sonnet-4-6' }),
  })
  return (
    <ChatContainer>
      {chat.messages.map(msg => <Message key={msg.id} message={msg} />)}
      <InputBar chat={chat} />
    </ChatContainer>
  )
}

That's it. Streaming, auto-scroll, keyboard handling, light/dark theme — all included.

Why AgentKit?

| | AgentKit | Vercel AI SDK | assistant-ui | |---|---------|--------------|-------------| | API surface | 3 hooks | Full toolkit | 50+ components | | Setup | 10 lines | ~30 lines | ~50 lines | | Headless | Yes | No UI included | Opinionated | | Agent-friendly | Entire API fits in 2K tokens | Large docs surface | Large docs surface | | Bundle | <5KB | ~30KB | ~80KB |

Swap providers in one line

import { anthropic, openai, vercelAI, generic } from '@agentkit-react/core/adapters'

// Claude
useChat({ adapter: anthropic({ apiKey, model: 'claude-sonnet-4-6' }) })

// GPT
useChat({ adapter: openai({ apiKey, model: 'gpt-4o' }) })

// Vercel AI SDK (route handler)
useChat({ adapter: vercelAI({ api: '/api/chat' }) })

// Any ReadableStream
useChat({ adapter: generic({ send: async (msgs) => fetch('/api', { body: JSON.stringify(msgs) }).then(r => r.body!) }) })

Works everywhere

Next.js (App Router)

// app/chat/page.tsx
'use client'
import { useChat, ChatContainer, Message, InputBar } from '@agentkit-react/core'
import { anthropic } from '@agentkit-react/core/adapters'
import '@agentkit-react/core/theme'

export default function ChatPage() {
  const chat = useChat({ adapter: anthropic({ apiKey: process.env.NEXT_PUBLIC_API_KEY!, model: 'claude-sonnet-4-6' }) })
  return (
    <ChatContainer>
      {chat.messages.map(msg => <Message key={msg.id} message={msg} />)}
      <InputBar chat={chat} />
    </ChatContainer>
  )
}

Vite

// src/App.tsx
import { useChat, ChatContainer, Message, InputBar } from '@agentkit-react/core'
import { openai } from '@agentkit-react/core/adapters'
import '@agentkit-react/core/theme'

function App() {
  const chat = useChat({ adapter: openai({ apiKey: import.meta.env.VITE_OPENAI_KEY, model: 'gpt-4o' }) })
  return (
    <ChatContainer>
      {chat.messages.map(msg => <Message key={msg.id} message={msg} />)}
      <InputBar chat={chat} />
    </ChatContainer>
  )
}

Remix

// app/routes/chat.tsx
import { useChat, ChatContainer, Message, InputBar } from '@agentkit-react/core'
import { vercelAI } from '@agentkit-react/core/adapters'
import '@agentkit-react/core/theme'

export default function Chat() {
  const chat = useChat({ adapter: vercelAI({ api: '/api/chat' }) })
  return (
    <ChatContainer>
      {chat.messages.map(msg => <Message key={msg.id} message={msg} />)}
      <InputBar chat={chat} />
    </ChatContainer>
  )
}

TanStack Start

// src/routes/chat.tsx
import { useChat, ChatContainer, Message, InputBar } from '@agentkit-react/core'
import { anthropic } from '@agentkit-react/core/adapters'
import '@agentkit-react/core/theme'

export default function Chat() {
  const chat = useChat({ adapter: anthropic({ apiKey: 'your-key', model: 'claude-sonnet-4-6' }) })
  return (
    <ChatContainer>
      {chat.messages.map(msg => <Message key={msg.id} message={msg} />)}
      <InputBar chat={chat} />
    </ChatContainer>
  )
}

The entire API

3 Hooks

// Stream any async source
const { text, status, error, stop } = useStream(source)

// Reactive state (proxy-based, minimal re-renders)
const state = useReactive({ count: 0 })

// Full chat session
const chat = useChat({ adapter })

7 Components

<ChatContainer>         {/* scrollable chat layout */}
<Message message={m} /> {/* chat bubble with streaming */}
<InputBar chat={chat} /> {/* input + send */}
<Markdown content={s} /> {/* markdown renderer */}
<CodeBlock code={s} language="ts" copyable />
<ToolCallView toolCall={tc} />
<ThinkingIndicator visible />

Headless + Optional Theme

Components ship unstyled with data-ak-* attributes. Import the theme for instant polish:

import '@agentkit-react/core/theme' // light/dark, CSS custom properties

Override any token:

:root {
  --ak-color-bubble-user: #10b981;
  --ak-radius: 16px;
}

For AI Agents

The entire API fits in under 2,000 tokens. See the agent-friendly reference — paste it into your LLM context and start generating chat UIs.

Credits

Inspired by Arrow.js — the first UI framework for the agentic era.

License

MIT