# Quick Reply

> Quick reply buttons for common chat responses.

A shadcn/ui block from the [@manifest](https://ui.manifest.build) registry, listed on [shadcn.exchange](https://shadcn.exchange/r/manifest/quick-reply).

- Page, with a live preview: https://shadcn.exchange/r/manifest/quick-reply
- Screenshot: https://abzjhwgwpdpz7ua5.public.blob.vercel-storage.com/shots/manifest/quick-reply-light-09f7df2705e3a291.png
- Registry item: https://ui.manifest.build/r/quick-reply.json
- Categories: selection
- Listed: 2026-10-13, source last changed 2026-10-13

## Install

```bash
npx shadcn@latest add https://ui.manifest.build/r/quick-reply.json
```

Run it in a project that has shadcn/ui set up. It adds the files below and installs what they depend on.

## Files

### `registry/selection/quick-reply.tsx`

````tsx
'use client'

import { cn } from '@/lib/utils'
import { demoQuickReplies } from './demo/selection'

/**
 * Represents a quick reply option.
 * @interface QuickReply
 * @property {string} id - Unique identifier for the reply
 * @property {string} label - Display text for the reply button
 * @property {React.ReactNode} [icon] - Optional icon displayed before the label
 */
export interface QuickReply {
  label?: string
  icon?: React.ReactNode
}

/**
 * ═══════════════════════════════════════════════════════════════════════════
 * QuickReplyProps
 * ═══════════════════════════════════════════════════════════════════════════
 *
 * Props for the QuickReply component, which displays predefined response
 * options as pill-shaped buttons for chat interfaces.
 */
export interface QuickReplyProps {
  data?: {
    /** Array of quick reply options to display as buttons. */
    replies?: QuickReply[]
  }
  actions?: {
    /** Called when a user selects a quick reply option. */
    onSelectReply?: (reply: QuickReply) => void
  }
}


/**
 * A quick reply button set for chat interfaces.
 * Displays predefined response options as pill-shaped buttons.
 *
 * Features:
 * - Pill-shaped action buttons
 * - Optional icons
 * - Hover state visual feedback
 * - Compact responsive design
 *
 * @component
 * @example
 * ```tsx
 * <QuickReply
 *   data={{
 *     replies: [
 *       { id: "1", label: "Yes, confirm" },
 *       { id: "2", label: "No thanks" },
 *       { id: "3", label: "I have a question" }
 *     ]
 *   }}
 *   actions={{
 *     onSelectReply: (reply) => console.log("Selected:", reply.label)
 *   }}
 * />
 * ```
 */
export function QuickReply({ data, actions }: QuickReplyProps) {
  const resolved: NonNullable<QuickReplyProps['data']> = data ?? { replies: demoQuickReplies }
  const replies = resolved.replies ?? []
  const onSelectReply = actions?.onSelectReply
  return (
    <div className="w-full bg-card rounded-lg p-4">
      <div className="flex flex-wrap gap-2">
        {replies.map((reply, index) => (
          <button
            key={index}
            onClick={() => onSelectReply?.(reply)}
            className={cn(
              'inline-flex items-center gap-1 sm:gap-1.5 rounded-full border border-border bg-background px-2.5 sm:px-3 py-1 sm:py-1.5 text-xs sm:text-sm text-foreground transition-colors cursor-pointer',
              'hover:bg-foreground hover:text-background hover:border-foreground'
            )}
          >
            {reply.icon}
            {reply.label && <span>{reply.label}</span>}
          </button>
        ))}
      </div>
    </div>
  )
}
````

### `registry/selection/demo/selection.ts`

```ts
// Demo data for Selection category components
// This file contains sample data used for component previews and documentation

import type { Option } from '../types'

// Default options for OptionList
export const demoOptions: Option[] = [
  { label: 'Standard shipping', description: '3-5 business days' },
  { label: 'Express shipping', description: '1-2 business days' },
  { label: 'Store pickup', description: 'Available in 2h' },
]

// Quick reply options
export const demoQuickReplies = [
  { label: 'Yes, please' },
  { label: 'No, thanks' },
  { label: 'Tell me more' },
]

// Tag select options
export const demoTags: { id: string; label: string; color: 'red' | 'yellow' | 'green' }[] = [
  { id: '1', label: 'Important', color: 'red' },
  { id: '2', label: 'In Progress', color: 'yellow' },
  { id: '3', label: 'Done', color: 'green' },
]
```
