JSPM

@assistant-ui/react

0.0.23
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 37739
  • Score
    100M100P100Q147220F
  • License MIT

React components for AI chat.

Package Exports

  • @assistant-ui/react

Readme

@assistant-ui/react

@assistant-ui/react is a set of React components for AI chat.

Documentation

Minimal Example with Vercel AI SDK

npx @assistant-ui/shadcn add thread
"use client";

import { useChat } from "@ai-sdk/react";
import { AssistantRuntimeProvider,  useVercelAIRuntime } from "@assistant-ui/react";
import { Thread } from "@/components/ui/assistant-ui/thread";

const MyApp = () => {
  const chat = useChat({ 
    api: "/api/chat" // your backend route
  });
  const runtime = useVercelAIRuntime(chat);

  return (
    <AssistantRuntimeProvider runtime={runtime}>
      <Thread />
    </AssistantRuntimeProvider>
  );
}