Quick Reply
manifest-ui/quick-replyFreeBlock
Quick reply buttons for common chat responses.
Install it
npx shadcn@latest add https://ui.manifest.build/r/quick-reply.jsonSource
1'use client'23import { cn } from '@/lib/utils'4import { demoQuickReplies } from './demo/selection'56/**7 * Represents a quick reply option.8 * @interface QuickReply9 * @property {string} id - Unique identifier for the reply10 * @property {string} label - Display text for the reply button11 * @property {React.ReactNode} [icon] - Optional icon displayed before the label12 */13export interface QuickReply {14 label?: string15 icon?: React.ReactNode16}1718/**19 * ═══════════════════════════════════════════════════════════════════════════20 * QuickReplyProps21 * ═══════════════════════════════════════════════════════════════════════════22 *23 * Props for the QuickReply component, which displays predefined response24 * options as pill-shaped buttons for chat interfaces.25 */26export interface QuickReplyProps {27 data?: {28 /** Array of quick reply options to display as buttons. */29 replies?: QuickReply[]30 }31 actions?: {32 /** Called when a user selects a quick reply option. */33 onSelectReply?: (reply: QuickReply) => void34 }35}363738/**39 * A quick reply button set for chat interfaces.40 * Displays predefined response options as pill-shaped buttons.41 *42 * Features:43 * - Pill-shaped action buttons44 * - Optional icons45 * - Hover state visual feedback46 * - Compact responsive design47 *48 * @component49 * @example50 * ```tsx51 * <QuickReply52 * data={{53 * replies: [54 * { id: "1", label: "Yes, confirm" },55 * { id: "2", label: "No thanks" },56 * { id: "3", label: "I have a question" }57 * ]58 * }}59 * actions={{60 * onSelectReply: (reply) => console.log("Selected:", reply.label)61 * }}62 * />63 * ```64 */65export function QuickReply({ data, actions }: QuickReplyProps) {66 const resolved: NonNullable<QuickReplyProps['data']> = data ?? { replies: demoQuickReplies }67 const replies = resolved.replies ?? []68 const onSelectReply = actions?.onSelectReply69 return (70 <div className="w-full bg-card rounded-lg p-4">71 <div className="flex flex-wrap gap-2">72 {replies.map((reply, index) => (73 <button74 key={index}75 onClick={() => onSelectReply?.(reply)}76 className={cn(77// … truncated
Files it writes
More from Manifest UI
All 32 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Amount Inputamount-input | Manifest UI | Blocks | Free | 1 dep · 2 files | |
| Chat Conversationchat-conversation | Manifest UI | Blocks | Free | 1 dep · 3 files | |
| Contact Formcontact-form | Manifest UI | Blocks | Free | 1 dep · 3 files | |
| Date & Time Pickerdate-time-picker | Manifest UI | Blocks | Free | 1 dep · 2 files | |
| Event Cardevent-card | Manifest UI | Blocks | Free | 1 dep · 2 files | |
| Event Confirmationevent-confirmation | Manifest UI | Blocks | Free | 1 dep · 2 files | |
| Event Detailevent-detail | Manifest UI | Blocks | Free | 3 deps · 2 files | |
| Event Listevent-list | Manifest UI | Blocks | Free | 3 deps · 2 files |
