Build beautiful, streaming AI chat interfaces with fine-grained control. MelonyProvider manages state, hooks give you access to messages and status, and flexible parts system supports any message structure.
Everything you need to build modern streaming AI chat experiences
Everything you need for modern AI chat interfaces
Built-in support for streaming responses with automatic text delta handling
Full type safety with custom message types and extensible part system
Complete control over UI with flexible hooks and components
Works seamlessly with AI SDK and other streaming libraries
Basic chat component with streaming support
"use client";
import {
MelonyProvider,
useMelonyMessages,
useMelonySend,
useMelonyStatus,
} from "melony";
function ChatMessages() {
const messages = useMelonyMessages();
const send = useMelonySend();
const status = useMelonyStatus();
return (
<div>
{messages.map((message) => (
<div key={message.id}>
<strong>{message.role}:</strong>
{message.parts.map((part, i) => (
<div key={i}>{part.type === "text" && part.text}</div>
))}
</div>
))}
<button onClick={() => send("Hello!")} disabled={status === "streaming"}>
{status === "streaming" ? "Sending..." : "Send"}
</button>
</div>
);
}
export default function Chat() {
return (
<MelonyProvider endpoint="/api/chat">
<ChatMessages />
</MelonyProvider>
);
}
Join developers using melony to create beautiful, streaming AI chat experiences with full TypeScript support and complete control.
Start Building Now