AI Components

Production-ready React components built specifically for AI products. Chat interfaces, streaming text renderers, and code blocks designed to work seamlessly with LLM APIs like OpenAI, Anthropic, and open-source models.

Streaming-first

Every component handles token-by-token streaming without layout shifts.

Model-agnostic

No assumptions about your LLM provider. Wire up any streaming API.

Dark mode ready

Chat and code block look great in dark mode — no extra config.

Wiring up a streaming response

The AI components are designed to work with the Web Streams API. Here's how to connect them to a standard Next.js Route Handler that streams an LLM response:

app/api/chat/route.ts
import { StreamingText } from "@animui/ui";

// In your component
const [text, setText] = useState("");

const handleStream = async () => {
  const res = await fetch("/api/chat", { method: "POST" });
  const reader = res.body!.getReader();
  const decoder = new TextDecoder();

  while (true) {
    const { done, value } = await reader.read();
    if (done) break;
    setText((prev) => prev + decoder.decode(value));
  }
};

// Render the streaming response
<StreamingText text={text} speed={30} cursor />
© 2026 Steal Shadow. MIT License.Report an issue