← Back to Home

Prompt-kit components for building AI-powered chat interfaces.

23 components (21 + 2 primitives)5 SSR/hydration patches

Powered by @repo/ui/ai — based on prompt-kit

Chat & Input

Core building blocks for conversational interfaces

  • PromptInputAuto-sizing textarea with action buttons for user input
  • MessageMessage bubble with avatar, content, and action slots
  • ChatContainerSSRScroll-aware container with sticky-to-bottom behavior
  • ScrollButtonSSRScroll-to-bottom button for chat interfaces
  • SystemMessageStyled system/info messages within a chat
  • PromptSuggestionClickable suggestion chips for guiding user input

Content Display

Render AI-generated content with rich formatting

  • MarkdownFull markdown renderer with syntax highlighting
  • CodeBlockSSRSyntax-highlighted code with copy button and language badge
  • JSXPreviewLive JSX component preview renderer
  • ImageAI-generated image display component
  • StepsStep-by-step visualization with progress tracking

AI-Specific

Components designed for AI interaction patterns

  • ResponseStreamStreaming text display with typewriter effect
  • ReasoningCollapsible reasoning/thinking process display
  • ChainOfThoughtMulti-step reasoning visualization
  • ThinkingBarAnimated thinking/processing indicator
  • TextShimmerShimmering text effect for loading states
  • ToolTool invocation display with status and results
  • SourceSource reference with expandable content
  • Loader13 variants: Dots, Classic, Pulse, PulseDot, Circular, Typing, Wave, Bars, Terminal, TextShimmer, TextDots, TextBlink

Feedback & Utility

User feedback collection and utility components

  • FeedbackBarThumbs up/down feedback with optional text input
  • FileUploadSSRDrag-and-drop file upload with preview

Primitives

Ready-to-use chat interfaces powered by AI SDK

  • ChatbotFull chat interface using useChat from @ai-sdk/react
  • ToolCallingChatbotChat with tool calling support and result display

5 patches applied across 4 components to ensure Next.js App Router compatibility.

ChatContainerchat-container.tsx2 patches

Defers StickToBottom rendering until client mount (Root + Content)

Strategy: Conditional rendering with isMounted state

ScrollButtonscroll-button.tsx

Returns null during SSR to avoid useStickToBottomContext errors

Strategy: Conditional rendering with isMounted state

FileUploadfile-upload.tsx

Guards createPortal(document.body) until client hydration

Strategy: Mounted check before portal creation

CodeBlockcode-block.tsx

Defers async syntax highlighting, renders plain code fallback during SSR

Strategy: Async deferred rendering via useEffect

PromptInput

Auto-sizing textarea with action buttons

PromptSuggestion

Clickable suggestion chips to guide user input

Message

Chat messages with avatar, content, and actions

U
Can you explain how React Server Components work?
AI
React Server Components (RSC) allow you to render components on the server. They reduce the JavaScript bundle sent to the client, enable direct database access, and improve performance. Server Components are the default in Next.js App Router — you only add "use client" when you need interactivity.

SystemMessage

System-level messages within chat

This conversation uses GPT-4o. Your messages may be used to improve the model.

ResponseStream

Streaming text with typewriter effect

TextShimmer

Shimmering text effect for loading states

Generating response...

ThinkingBar

Animated thinking/processing indicator

Thinking

FeedbackBar

Collect user feedback on AI responses

Was this response helpful?

Loader

13 loader variants for AI processing states

Loading
DotsLoader
Loading
ClassicLoader
Loading
PulseLoader
Loading
PulseDotLoader
Loading
CircularLoader
Loading
TypingLoader
Loading
WaveLoader
Loading
BarsLoader
>Loading
TerminalLoader
Thinking
TextShimmerLoader
Thinking...
TextDotsLoader
TextBlinkLoader
// Import AI components from the shared UI package
import {
  PromptInput,
  PromptInputTextarea,
  PromptInputActions,
  PromptInputAction,
  Message,
  MessageAvatar,
  MessageContent,
  ResponseStream,
  ThinkingBar,
  DotsLoader,
  FeedbackBar,
  // ... and more
} from "@repo/ui/ai"
6
Chat & Input
5
Content Display
8
AI-Specific
2
Feedback & Utility
2
Primitives
5
SSR Patches