Loading component…
Loading component…
AI chat card with a soft gradient glow, suggestions, streaming replies and live voice dictation
To reuse this local React demo, copy all files from the Code tab into the same folder, then import WritingAssistant from ./writing-assistant.
import { WritingAssistant } from "@/components/ui/writing-assistant";
export function Helper() {
return (
<WritingAssistant
name="Quill"
tagline="Your writing companion."
respond={async (message) => {
const res = await fetch("/api/write", { method: "POST", body: JSON.stringify({ message }) });
return (await res.json()).text;
}}
/>
);
}| Name | Type | Default | Description |
|---|---|---|---|
| name | string | "Quill" | Assistant name on top |
| tagline | string | "Your writing companion." | Line under the name |
| greeting | string | "What should we write?" | Big line on the welcome screen |
| suggestions | string[] | Chips that send themselves as a message | |
| placeholder | string | "Ask anything…" | Placeholder of the prompt field |
| respond | (message) => string \| Promise<string> | Your answer for a message; a sample writer is used by default | |
| speech | "auto" \| "simulate" | "auto" | auto uses the browser's speech recognition when available, simulate always plays a sample take |
| dictation | string | Sentence used for simulated dictation | |
| className | string | Extra class on the root |
Fills its container up to 380px wide
Dictation uses the Web Speech API (Chrome, Edge, Safari) with the page language; elsewhere a short simulated take plays
Dark mode built in: switches when an ancestor (usually <html>) has the class dark or data-theme="dark"