Shadcn.io is not affiliated with official shadcn/ui
React AI Branch
React AI branch component with message versioning and navigation for chat regeneration workflows
Ever regenerate an AI response and want to flip between versions? That's what Branch does. When users hit "regenerate," you don't have to throw away the old response—store both and let them navigate with Previous/Next buttons. Shows "1 of 3" so they know how many versions exist. The selector only appears when there's more than one branch, so it stays hidden for normal single-response messages. Wraps around your existing Message components without changing their structure. Great for chat apps where users might want to compare different AI responses or go back to an earlier version.
Branch preview
Installation
Related Components
React AI Message
Chat message bubbles
React AI Conversation
Chat container
React AI Reasoning
AI thinking display
React AI Suggestion
Quick reply buttons
React AI Prompt Input
Message input area
React AI Toolbar
Action toolbar