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

@tambo-ai/react

v1.2.5

Published

React client package for Tambo AI

Readme


What is Tambo?

Tambo is a React toolkit for building agents that render UI (also known as generative UI).

Register your components with Zod schemas. The agent picks the right one and streams the props so users can interact with them. "Show me sales by region" renders your <Chart>. "Add a task" updates your <TaskBoard>.

Installation

npm create tambo-app my-tambo-app
cd my-tambo-app
npx tambo init      # choose cloud or self-hosted
npm run dev

Or add to an existing project:

npm install @tambo-ai/react
npx tambo init

Quick Start

import { TamboProvider, useTambo, useTamboThreadInput } from "@tambo-ai/react";
import { z } from "zod/v4";

// 1. Register components with Zod schemas
const components = [
  {
    name: "Graph",
    description: "Displays data as charts",
    component: Graph,
    propsSchema: z.object({
      data: z.array(z.object({ name: z.string(), value: z.number() })),
      type: z.enum(["line", "bar", "pie"]),
    }),
  },
];

// 2. Wrap your app
function App() {
  return (
    <TamboProvider
      apiKey={process.env.NEXT_PUBLIC_TAMBO_API_KEY!}
      userKey={currentUserId} // Required: identifies thread owner
      components={components}
    >
      <ChatInterface />
    </TamboProvider>
  );
}

// 3. Use hooks
function ChatInterface() {
  const { messages, isStreaming } = useTambo();
  const { value, setValue, submit, isPending } = useTamboThreadInput();

  return (
    <form
      onSubmit={async (e) => {
        e.preventDefault();
        await submit();
      }}
    >
      {messages.map((msg) => (
        <Message key={msg.id} message={msg} />
      ))}
      {isStreaming && <LoadingIndicator />}
      <input value={value} onChange={(e) => setValue(e.target.value)} />
      <button disabled={isPending}>Send</button>
    </form>
  );
}

Key Hooks

| Hook | Description | | -------------------------------------------------------------------------------------------------- | ----------------------------------------------------------- | | useTambo() | Primary hook - messages, streaming state, thread management | | useTamboThreadInput() | Handle user input, image uploads, and message submission | | useTamboThread() | Fetch a single thread by ID (React Query) | | useTamboThreadList() | Fetch thread list with filtering and pagination | | useTamboStreamStatus() | Monitor prop-level streaming status for progressive loading | | useTamboSuggestions() | Generate contextual suggestions | | useTamboComponentState() | Bidirectional component state synced with the backend | | useTamboVoice() | Voice input and transcription |

Features

MCP Dependency Note

@modelcontextprotocol/sdk is included automatically when you install @tambo-ai/react.

If you import from @tambo-ai/react/mcp and use features that require schema validation (like component prop schemas via propsSchema, or tool schemas via inputSchema/outputSchema), install the optional peer dependencies:

Zod 3 (^3.25.76) and Zod 4 (^4) are both supported. We recommend Zod 4 for new projects. zod-to-json-schema@^3.25.1 is tested and known to support both.

Install exactly one of the following (do not install both Zod 3 and Zod 4):

# Recommended (Zod 4)
npm install zod@^4 zod-to-json-schema@^3.25.1

# Or, for existing projects using Zod 3
npm install zod@^3.25.76 zod-to-json-schema@^3.25.1

Learn More

  • GitHub - Full documentation, examples, and ⭐ star us!
  • Docs - Guides and API reference
  • UI Library - Pre-built components
  • Discord - Community and support

License

MIT - see LICENSE


For AI/LLM agents: docs.tambo.co/llms.txt