Updated
Streaming Chat
ProCustomize
Speed22w/s
Blur4px
Installation
ProStreaming Chat is a Pro component
Sign in to see the source, or install it with a license key. The live preview and props above are free to explore.
Buying? Use the email you'll sign in with. Your license is tied to it.
Install with a key
- Add the Pro registry to
components.json:components.json { "registries": { "@uibrik-pro": { "url": "https://uibrik.com/r/pro/{name}.json", "headers": { "Authorization": "Bearer ${UIBRIK_LICENSE}" } } } } - Put your key in
.env.localand add that file to.gitignore:.env.local UIBRIK_LICENSE=your-license-key - Install it:
Terminal npx shadcn@latest add @uibrik-pro/streaming-chat
Loading your installation…
Usage
import { StreamingChat } from "@/components/uibrik/streaming-chat/streaming-chat";const suggestions = ["Why does streaming jitter?", "Write a debounce function", "Explain the steps"];const thinkingLabels = ["Thinking", "Working through it", "Weighing the details", "Putting it together"];<StreamingChat voice attach speed={22} blur={4} placeholder="Ask anything" accept="" maxFiles={6} maxFileSizeMb={10} suggestions={suggestions} thinkingLabels={thinkingLabels} // respond={(prompt, signal, files) => {}}/>Where to use Streaming Chat
AI assistants
The input morphing into your bubble and a reply streaming in word by word feels instant.
Pairs with Prompt Input
Customer support chat
Live markdown renders formatted answers as they arrive.
Docs Q&A bots
Voice dictation and attachments let users ask in the way that suits them.
Pairs with Context Meter
Props
StreamingChat- voice
- Type boolean
- true
- Dictation button. It only shows in browsers that support speech recognition.
- attach
- Type boolean
- true
- File button, drag and drop, and paste.
- speed
- Type number
- 22
- Words per second for the built-in demo model.
- blur
- Type number
- 4
- Blur a new word starts with. 0 turns the blur off.
- placeholder
- Type string
- "Ask anything"
- Hint shown in the empty input.
- respond
- Type (prompt: string, signal: AbortSignal, files: File[]) => AsyncIterable<string>
- –
- Where replies come from. Yield text pieces as they arrive. Leave out to use the built-in demo model.
- accept
- Type string
- ""
- Which files to take, as an <input accept> string such as "image/*,.pdf". Empty takes any.
- maxFiles
- Type number
- 6
- Most files one message can carry.
- maxFileSizeMb
- Type number
- 10
- Largest single file, in MB.
- suggestions
- Type string[]
- 3 prompts
- Prompts offered before the first message. Pass [] to hide them.
- thinkingLabels
- Type string[]
- 4 labels
- Shown in turn, a few seconds apart, while waiting for the first word. The last one holds.
- className
- Type string
- –
- Size the chat by giving it a height, e.g. h-[640px] max-w-2xl.