Forms & inputs / Prompt & chat inputs
Agent Chat Side Panel
Dark rounded panel with a 'Desktop' blue chip, prompt bubble, shimmering 'Thinking…' status, and a bottom composer with 'Add follow-up…' field, model selector (GPT) and small icon buttons. Used alongside canvas screenshots.
Rebuilt from framer.com in the Obsidian Canvas style.
npx shadcn@latest add https://justyoink.it/r/obsidian-canvas-cc37fa/blocks/agent-chat-panel.json
Looks exactly like framer.com: brings its fonts and colours, namespaced so your own theme stays untouched.
npx shadcn@latest add https://justyoink.it/r/obsidian-canvas-cc37fa/mine/agent-chat-panel.json
Restyled to your project: uses your shadcn colours, fonts and radius, so it matches the rest of your app. Layout, type sizes and motion stay as designed.
Usage
Props: chipLabel, prompt, status, placeholder, modelName, onSend(value). Renders standalone; type in the composer and press the send button or Enter.
components/agent-chat-panel.tsx
"use client"; import { type CSSProperties, type ReactNode } from "react"; import { useState } from "react"; type Props = { chipLabel?: string; prompt?: string; status?: string; placeholder?: string; modelName?: string; onSend?: (value: string) => void; }; const Icon = ({ d }: { d: string }) => ( <svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" strokeWidth="1.4" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true"> <path d={d} /> </svg> ); export default function AgentChatSidePanel({ chipLabel = "Desktop", prompt = "Create a landing page for a small ceramics studio with a bold hero, a gallery and a contact section.", status = "Thinking…", placeholder = "Add follow-up…", modelName = "GPT", onSend, }: Props) { const [value, setValue] = useState(""); const submit = (e: React.FormEvent) => { e.preventDefault(); onSend?.(value); setValue(""); }; return ( <aside className="flex h-[460px] w-full max-w-[300px] flex-col rounded-xl border border-hairline bg-surface p-3 font-sans shadow-inner-outline" aria-label="Agent chat"> <div className="flex items-center justify-between"> <span className="rounded-full bg-accent-blue-wash px-2.5 py-1 text-caption text-accent-blue">{chipLabel}</span> <button type="button" aria-label="More options" className="rounded-md p-1.5 text-muted transition-colors duration-surface-hover hover:bg-surface-high hover:text-primary focus-visible:outline focus-visible:outline-2 focus-visible:outline-accent-blue"> <Icon d="M3 8h.01M8 8h.01M13 8h.01" /> </button> </div> <div className="mt-4 flex-1 space-y-4 overflow-hidden"> <div className="ml-auto max-w-[90%] rounded-lg bg-surface-raised px-3 py-2 text-ui text-primary">{prompt}</div> <div className="flex items-center gap-2 text-ui text-muted"> <span className="h-2 w-2 rounded-full bg-accent-blue shadow-blue-glow" /> <ShimmerText>{status}</ShimmerText> <span className="h-4 w-px animate-caret-blink bg-accent-blue" /> </div> </div> <form onSubmit={submit} className="rounded-lg border border-hairline bg-surface-raised p-2"> <input value={value} onChange={(e) => setValue(e.target.value)} placeholder={placeholder} aria-label={placeholder} className="w-full bg-transparent px-1 py-1.5 text-ui text-primary placeholder:text-muted focus:outline-none" /> <div className="mt-1 flex items-center justify-between"> <div className="flex items-center gap-1"> <button type="button" className="flex items-center gap-1 rounded-md px-2 py-1 text-caption text-secondary transition-colors duration-surface-hover hover:bg-surface-high hover:text-primary focus-visible:outline focus-visible:outline-2 focus-visible:outline-accent-blue"> {modelName} <Icon d="M4 6l4 4 4-4" /> </button> <button type="button" aria-label="Attach" className="rounded-md p-1.5 text-muted transition-colors duration-surface-hover hover:bg-surface-high hover:text-primary focus-visible:outline focus-visible:outline-2 focus-visible:outline-accent-blue"> <Icon d="M13 7.5l-5 5a3 3 0 01-4-4l5-5a2 2 0 013 3l-5 5" /> </button> </div> <button type="submit" aria-label="Send" className="rounded-full bg-surface-high p-1.5 text-secondary transition-colors duration-surface-hover hover:bg-accent-blue hover:text-primary focus-visible:outline focus-visible:outline-2 focus-visible:outline-accent-blue"> <Icon d="M8 13V3M3.5 7.5L8 3l4.5 4.5" /> </button> </div> </form> </aside> ); } // ---- Yoink motion (inlined, no dependencies): ShimmerText ---- const YK_SHIMMER_CSS = `@keyframes yk-shimmer{0%{background-position:100% 0}60%,100%{background-position:0% 0}} @media (prefers-reduced-motion:reduce){[data-yk-shimmer]{animation:none!important;background:none!important;-webkit-text-fill-color:currentColor!important}}`; /** A band of light that sweeps across text: headlines, badges, button labels. */ function ShimmerText({ children = "Now in early access", duration = 2.8, className, style, }: { children?: ReactNode; /** seconds per sweep (including a short rest) */ duration?: number; className?: string; style?: CSSProperties; }) { // dimmed text with a full-strength band passing over it; follows the text colour in any theme const dim = "color-mix(in oklab, currentColor 55%, transparent)"; return ( <span className={className} style={style}> <style>{YK_SHIMMER_CSS}</style> <span data-yk-shimmer="" style={{ backgroundImage: `linear-gradient(100deg, ${dim} 0%, ${dim} 40%, currentColor 50%, ${dim} 60%, ${dim} 100%)`, backgroundSize: "250% 100%", backgroundClip: "text", WebkitBackgroundClip: "text", WebkitTextFillColor: "transparent", animation: `yk-shimmer ${duration}s ease-in-out infinite`, }} > {children} </span> </span> ); }"use client"; import { type CSSProperties, type ReactNode } from "react"; import { useState } from "react"; type Props = { chipLabel?: string; prompt?: string; status?: string; placeholder?: string; modelName?: string; onSend?: (value: string) => void; }; const Icon = ({ d }: { d: string }) => ( <svg viewBox="0 0 16 16" width="14" height="14" fill="none" stroke="currentColor" strokeWidth="1.4" strokeLinecap="round" strokeLinejoin="round" aria-hidden="true"> <path d={d} /> </svg> ); export default function AgentChatSidePanel({ chipLabel = "Desktop", prompt = "Create a landing page for a small ceramics studio with a bold hero, a gallery and a contact section.", status = "Thinking…", placeholder = "Add follow-up…", modelName = "GPT", onSend, }: Props) { const [value, setValue] = useState(""); const submit = (e: React.FormEvent) => { e.preventDefault(); onSend?.(value); setValue(""); }; return ( <aside className="flex h-[460px] w-full max-w-[300px] flex-col rounded-2xl border border-border bg-card p-3 font-sans shadow-obsidian-inner-outline" aria-label="Agent chat"> <div className="flex items-center justify-between"> <span className="rounded-full bg-primary px-2.5 py-1 text-obsidian-caption text-primary">{chipLabel}</span> <button type="button" aria-label="More options" className="rounded-md p-1.5 text-muted-foreground transition-colors duration-obsidian-surface-hover hover:bg-accent hover:text-foreground focus-visible:outline focus-visible:outline-2 focus-visible:outline-primary"> <Icon d="M3 8h.01M8 8h.01M13 8h.01" /> </button> </div> <div className="mt-4 flex-1 space-y-4 overflow-hidden"> <div className="ml-auto max-w-[90%] rounded-xl bg-secondary px-3 py-2 text-obsidian-ui text-foreground">{prompt}</div> <div className="flex items-center gap-2 text-obsidian-ui text-muted-foreground"> <span className="h-2 w-2 rounded-full bg-primary shadow-obsidian-blue-glow" /> <ShimmerText>{status}</ShimmerText> <span className="h-4 w-px animate-obsidian-caret-blink bg-primary" /> </div> </div> <form onSubmit={submit} className="rounded-xl border border-border bg-secondary p-2"> <input value={value} onChange={(e) => setValue(e.target.value)} placeholder={placeholder} aria-label={placeholder} className="w-full bg-transparent px-1 py-1.5 text-obsidian-ui text-foreground placeholder:text-muted-foreground focus:outline-none" /> <div className="mt-1 flex items-center justify-between"> <div className="flex items-center gap-1"> <button type="button" className="flex items-center gap-1 rounded-md px-2 py-1 text-obsidian-caption text-muted-foreground transition-colors duration-obsidian-surface-hover hover:bg-accent hover:text-foreground focus-visible:outline focus-visible:outline-2 focus-visible:outline-primary"> {modelName} <Icon d="M4 6l4 4 4-4" /> </button> <button type="button" aria-label="Attach" className="rounded-md p-1.5 text-muted-foreground transition-colors duration-obsidian-surface-hover hover:bg-accent hover:text-foreground focus-visible:outline focus-visible:outline-2 focus-visible:outline-primary"> <Icon d="M13 7.5l-5 5a3 3 0 01-4-4l5-5a2 2 0 013 3l-5 5" /> </button> </div> <button type="submit" aria-label="Send" className="rounded-full bg-accent p-1.5 text-primary-foreground transition-colors duration-obsidian-surface-hover hover:bg-primary hover:text-primary-foreground focus-visible:outline focus-visible:outline-2 focus-visible:outline-primary"> <Icon d="M8 13V3M3.5 7.5L8 3l4.5 4.5" /> </button> </div> </form> </aside> ); } // ---- Yoink motion (inlined, no dependencies): ShimmerText ---- const YK_SHIMMER_CSS = `@keyframes yk-shimmer{0%{background-position:100% 0}60%,100%{background-position:0% 0}} @media (prefers-reduced-motion:reduce){[data-yk-shimmer]{animation:none!important;background:none!important;-webkit-text-fill-color:currentColor!important}}`; /** A band of light that sweeps across text: headlines, badges, button labels. */ function ShimmerText({ children = "Now in early access", duration = 2.8, className, style, }: { children?: ReactNode; /** seconds per sweep (including a short rest) */ duration?: number; className?: string; style?: CSSProperties; }) { // dimmed text with a full-strength band passing over it; follows the text colour in any theme const dim = "color-mix(in oklab, currentColor 55%, transparent)"; return ( <span className={className} style={style}> <style>{YK_SHIMMER_CSS}</style> <span data-yk-shimmer="" style={{ backgroundImage: `linear-gradient(100deg, ${dim} 0%, ${dim} 40%, currentColor 50%, ${dim} 60%, ${dim} 100%)`, backgroundSize: "250% 100%", backgroundClip: "text", WebkitBackgroundClip: "text", WebkitTextFillColor: "transparent", animation: `yk-shimmer ${duration}s ease-in-out infinite`, }} > {children} </span> </span> ); }
Quality checks
Automated, in a real browser · 4d ago- Accessible: passedNo serious accessibility problems (axe-core): readable contrast, labelled buttons and images.
- Responsive: passedRenders at phone (390px), tablet (768px) and desktop width without sideways scrolling.
- Dark mode: passedStill readable when installed in your theme and switched to dark mode.
- Themeable: passedUses design tokens rather than hard-coded colours, so it follows your theme cleanly.
- Animates cleanly: not passedKeeps animating when reduced motion is turned on