# Support inbox

A controlled two-pane support inbox with ticket search, status filtering, selected conversation and reply composer surfaces.

Access: pro. Category: Blocks. Kind: composite.

## When to use

- Use it when a page needs a controlled two-pane support inbox with ticket search, status filtering, selected conversation and reply composer surfaces.
- Choose it inside an authenticated product surface when the host application owns routing, persistence, and service calls.

## Alternatives

- Choose empty-state instead when empty collections, search results and errors with a clear next action is the actual interface need, rather than support inbox.

## Setup for agents

Use React 19 and TypeScript. Initialize shadcn for your framework, then merge this exact entry into components.json:

```json
{
  "registries": {
    "@tidal-pro": {
      "url": "https://tidalui.com/r/pro/{name}.json",
      "headers": {
        "Authorization": "Bearer ${TIDALUI_TOKEN}"
      }
    }
  }
}
```

The namespace must be named **@tidal-pro** because transitive Pro dependencies use that namespace. Obtain an agent key from your active Pro account at https://tidalui.com/account. Keep TIDALUI_TOKEN in your local environment, never in components.json, client code, Git or logs.

```sh
export TIDALUI_TOKEN='your-private-agent-key'
npx shadcn@latest add @tidal-pro/waitlist-form
npx shadcn@latest add https://tidalui.com/r/tidal-button.json
```

Free command: `npx shadcn@latest add https://tidalui.com/r/<name>.json`.
Pro command: `npx shadcn@latest add @tidal-pro/<name>`.

Import the base stylesheet and every stylesheet listed on the installed item's metadata. For example:

```tsx
import "./components/ui/tidal.css";
import "./components/ui/hero-section.css";
// Place installed components inside this wrapper:
<div className="tidal-scope" data-theme="dark">...</div>
```

Omit data-theme for the default light theme. Put the attribute on the same tidal-scope element for dark mode. Every component installs the shared free tidal-base dependency. After upgrading, run `npx shadcn@latest add https://tidalui.com/r/tidal-base.json --overwrite` to receive current tokens. Review local modifications before overwriting.

Vite: Use React + TypeScript. Map @/* to ./src/* in paths and Vite resolve.alias. Import tidal.css and each component stylesheet in your application entry.

Next.js 15 App Router: Next.js App Router: import tidal.css and component CSS in app/layout.tsx. Interactive examples belong in a client component with "use client". Map @/* to ./* or ./src/* to match your project.

TypeScript 6: use paths without baseUrl:

```json
{
  "compilerOptions": {
    "paths": {
      "@/*": [
        "./src/*"
      ]
    }
  }
}
```

Pro registry requests are server/CLI-only. Use the same-origin account interface in a browser; cross-origin Authorization preflights are intentionally unsupported.


## Install Support inbox

```sh
npx shadcn@latest add @tidal-pro/support-inbox
```

Stylesheets: `components/ui/tidal.css`, `components/ui/support-inbox.css`.

## Minimal example

```tsx
import"./components/ui/tidal.css";
import"./components/ui/support-inbox.css";
import{TidalSupportInbox}from"./components/ui/support-inbox";
export default(p:Parameters<typeof TidalSupportInbox>[0])=><div className="tidal-scope"><TidalSupportInbox {...p}/></div>;
```

## Structured props

- `TidalSupportInbox.draftValue: string`: Required draft value value accepted by this exported component.
- `TidalSupportInbox.onDraftValueChange: (value: string, event: ChangeEvent<HTMLTextAreaElement>) => void`: Callback invoked when the draft value change interaction is proposed.
- `TidalSupportInbox.onSearchValueChange: (value: string, event: ChangeEvent<HTMLInputElement>) => void`: Callback invoked when the search value change interaction is proposed.
- `TidalSupportInbox.onStatusFilterChange: (value: string, event: ChangeEvent<HTMLSelectElement>) => void`: Callback invoked when the status filter change interaction is proposed.
- `TidalSupportInbox.onTicketSelect: (ticket: TidalSupportTicket, event: ReactMouseEvent<HTMLButtonElement>) => void`: Callback invoked when the ticket select interaction is proposed.
- `TidalSupportInbox.searchValue: string`: Required search value value accepted by this exported component.
- `TidalSupportInbox.statusFilterValue: string`: Required status filter value value accepted by this exported component.
- `TidalSupportInbox.statusOptions: ReadonlyArray<TidalSupportStatusOption>`: Required status options value accepted by this exported component.
- `TidalSupportInbox.tickets: ReadonlyArray<TidalSupportTicket>`: Required tickets value accepted by this exported component.
- `TidalSupportInbox.title: ReactNode`: Required title value accepted by this exported component.
- `TidalSupportInbox.actionsLabel?: string | undefined` (default "Conversation actions"): Optional actions label value accepted by this exported component.
- `TidalSupportInbox.composerLabel?: string | undefined` (default "Reply draft"): Optional composer label value accepted by this exported component.
- `TidalSupportInbox.composerPlaceholder?: string | undefined` (default "Write a local reply"): Optional composer placeholder value accepted by this exported component.
- `TidalSupportInbox.conversationActions?: ReadonlyArray<TidalSupportAction> | undefined` (default []): Optional conversation actions value accepted by this exported component.
- `TidalSupportInbox.conversationHeadingLevel?: "h3" | "h4" | "h5" | undefined`: Optional conversation heading level value accepted by this exported component.
- `TidalSupportInbox.description?: ReactNode`: Optional description value accepted by this exported component.
- `TidalSupportInbox.emptyConversationMessage?: ReactNode` (default "Choose a ticket to read the conversation."): Optional empty conversation message value accepted by this exported component.
- `TidalSupportInbox.emptyMessagesMessage?: ReactNode` (default "This conversation has no messages yet."): Optional empty messages message value accepted by this exported component.
- `TidalSupportInbox.emptyTicketsMessage?: ReactNode` (default "No tickets match these controls."): Optional empty tickets message value accepted by this exported component.
- `TidalSupportInbox.eyebrow?: ReactNode` (default "Support inbox"): Optional eyebrow value accepted by this exported component.
- `TidalSupportInbox.footer?: ReactNode`: Optional footer value accepted by this exported component.
- `TidalSupportInbox.formProps?: Omit<FormHTMLAttributes<HTMLFormElement>, "children"> | undefined`: Optional form props value accepted by this exported component.
- `TidalSupportInbox.formRef?: Ref<HTMLFormElement> | undefined`: Optional form ref value accepted by this exported component.
- `TidalSupportInbox.headingLevel?: "h2" | "h3" | "h4" | undefined` (default "h2"): Optional heading level value accepted by this exported component.
- `TidalSupportInbox.messagesLabel?: string | undefined` (default "Conversation messages"): Optional messages label value accepted by this exported component.
- `TidalSupportInbox.onReplySubmit?: ((ticket: TidalSupportTicket, event: FormEvent<HTMLFormElement>) => void) | undefined`: Callback invoked when the reply submit interaction is proposed.
- `TidalSupportInbox.replyDisabled?: boolean | undefined` (default false): Optional reply disabled value accepted by this exported component.
- `TidalSupportInbox.searchInputProps?: Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "value"> | undefined`: Optional search input props value accepted by this exported component.
- `TidalSupportInbox.searchInputRef?: Ref<HTMLInputElement> | undefined`: Optional search input ref value accepted by this exported component.
- `TidalSupportInbox.searchLabel?: string | undefined` (default "Search tickets"): Optional search label value accepted by this exported component.
- `TidalSupportInbox.selectedTicketId?: string | undefined`: Optional selected ticket id value accepted by this exported component.
- `TidalSupportInbox.statusFilterLabel?: string | undefined` (default "Filter by status"): Optional status filter label value accepted by this exported component.
- `TidalSupportInbox.statusSelectProps?: Omit<SelectHTMLAttributes<HTMLSelectElement>, "value" | "children"> | undefined`: Optional status select props value accepted by this exported component.
- `TidalSupportInbox.statusSelectRef?: Ref<HTMLSelectElement> | undefined`: Optional status select ref value accepted by this exported component.
- `TidalSupportInbox.submitButtonProps?: Omit<ButtonHTMLAttributes<HTMLButtonElement>, "children"> | undefined`: Optional submit button props value accepted by this exported component.
- `TidalSupportInbox.submitButtonRef?: Ref<HTMLButtonElement> | undefined`: Optional submit button ref value accepted by this exported component.
- `TidalSupportInbox.submitLabel?: ReactNode` (default "Add reply"): Optional submit label value accepted by this exported component.
- `TidalSupportInbox.textareaProps?: Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, "value"> | undefined`: Optional textarea props value accepted by this exported component.
- `TidalSupportInbox.textareaRef?: Ref<HTMLTextAreaElement> | undefined`: Optional textarea ref value accepted by this exported component.
- `TidalSupportInbox.ticketsLabel?: string | undefined` (default "Tickets"): Optional tickets label value accepted by this exported component.
- `TidalSupportInbox.unreadLabel?: ((count: number, ticket: TidalSupportTicket) => string) | undefined` (default (count) => `${count} unread messages`): Optional unread label value accepted by this exported component.

## Complete usage example

[Source](https://tidalui.com/examples/support-inbox.tsx) | [Manifest](https://tidalui.com/examples/support-inbox.json). Install the listed additional dependencies. Consumer fixture: TypeScript pass; Vite pass. This fixture check is distinct from the actual shadcn install receipt.

```tsx
import "./components/ui/tidal.css";

import { useMemo, useRef, useState, type FormEvent } from "react";

import { TidalSupportInbox, type TidalSupportAction, type TidalSupportStatusOption, type TidalSupportTicket } from "./components/ui/support-inbox";

import "./components/ui/support-inbox.css";

function tidalExampleAvatarDataUri(seed: unknown) {
  const text = String(seed).replace(/[^a-z0-9]/gi, "").slice(-2) || "UI";
  const palette = ["#333333", "#555555", "#777777", "#999999", "#bbbbbb"];
  const color = palette[Array.from(text).reduce((sum, character) => sum + character.charCodeAt(0), 0) % palette.length];
  const svg = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 96 96"><rect width="96" height="96" rx="48" fill="${color}"/><circle cx="48" cy="38" r="17" fill="white" fill-opacity=".92"/><path d="M18 92c3-22 15-34 30-34s27 12 30 34" fill="white" fill-opacity=".92"/></svg>`;
  return `data:image/svg+xml,${encodeURIComponent(svg)}`;
}

function tidalExampleImageDataUri(label: string) {
  const safeLabel = label.replace(/[<>&]/g, "").slice(0, 28) || "Sample image";
  const svg = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 675"><defs><linearGradient id="g" x1="0" x2="1" y1="0" y2="1"><stop stop-color="#171717"/><stop offset="1" stop-color="#555555"/></linearGradient></defs><rect width="1200" height="675" fill="url(#g)"/><circle cx="950" cy="100" r="260" fill="white" fill-opacity=".08"/><text x="80" y="570" fill="white" font-family="system-ui,sans-serif" font-size="64" font-weight="700">${safeLabel}</text></svg>`;
  return `data:image/svg+xml,${encodeURIComponent(svg)}`;
}

const tidalExampleStyles = ".tidal-scope .support-inbox-demo,\n.tidal-scope .support-inbox-demo * {\n  box-sizing: border-box;\n}\n\n.tidal-scope .support-inbox-demo {\n  width: 100%;\n  max-width: 1160px;\n  min-width: 0;\n  padding: 20px;\n  border: 1px solid var(--t-border);\n  border-radius: 22px;\n  background:\n    linear-gradient(var(--t-border) 1px, transparent 1px),\n    linear-gradient(90deg, var(--t-border) 1px, transparent 1px),\n    var(--t-subtle);\n  background-size: 22px 22px;\n  container: support-demo / inline-size;\n}\n\n@container support-demo (max-width: 430px) {\n  .tidal-scope .support-inbox-demo {\n    padding: 8px;\n  }\n}";

const INITIAL_TICKETS: readonly TidalSupportTicket[] = [
  {
    id: "ava-export",
    customerName: "Ava Chen",
    subject: "Export includes an extra blank page",
    preview: "The PDF is correct except for the final page.",
    timestamp: "12 min",
    avatarSrc: tidalExampleAvatarDataUri("01"),
    status: "open",
    statusLabel: "Open",
    unreadCount: 2,
    messages: [
      {
        id: "ava-1",
        authorName: "Ava Chen",
        avatarSrc: tidalExampleAvatarDataUri("01"),
        side: "customer",
        timestamp: "9:12 AM",
        body: "The sample export looks right, but it adds one blank page at the end.",
      },
      {
        id: "ava-2",
        authorName: "Eli Park",
        avatarSrc: tidalExampleAvatarDataUri("04"),
        side: "agent",
        timestamp: "9:18 AM",
        body: "Thanks. I can reproduce that in this fictional thread and will check the final section break.",
      },
    ],
  },
  {
    id: "noah-members",
    customerName: "Noah Reed",
    subject: "Where do I review invited members?",
    preview: "Looking for the sample member list.",
    timestamp: "34 min",
    avatarSrc: tidalExampleAvatarDataUri("02"),
    status: "pending",
    statusLabel: "Pending",
    messages: [
      {
        id: "noah-1",
        authorName: "Noah Reed",
        avatarSrc: tidalExampleAvatarDataUri("02"),
        side: "customer",
        timestamp: "8:46 AM",
        body: "Where can I see the people already invited to the sample workspace?",
      },
    ],
  },
  {
    id: "mila-copy",
    customerName: "Mila Stone",
    subject: "Update the confirmation copy",
    preview: "The current line needs a clearer next step.",
    timestamp: "Yesterday",
    avatarSrc: tidalExampleAvatarDataUri("03"),
    status: "resolved",
    statusLabel: "Resolved",
    messages: [
      {
        id: "mila-1",
        authorName: "Mila Stone",
        avatarSrc: tidalExampleAvatarDataUri("03"),
        side: "customer",
        timestamp: "Yesterday",
        body: "Could the confirmation explain what happens after the local draft is created?",
      },
      {
        id: "mila-2",
        authorName: "Eli Park",
        avatarSrc: tidalExampleAvatarDataUri("04"),
        side: "agent",
        timestamp: "Yesterday",
        body: "The revised fictional copy now points to the review step.",
      },
    ],
  },
];

const STATUS_OPTIONS: readonly TidalSupportStatusOption[] = [
  { value: "all", label: "All statuses" },
  { value: "open", label: "Open" },
  { value: "pending", label: "Pending" },
  { value: "resolved", label: "Resolved" },
];

function filterTickets(
  tickets: readonly TidalSupportTicket[],
  search: string,
  status: string,
) {
  const query = search.trim().toLocaleLowerCase();
  return tickets.filter((ticket) => {
    const matchesStatus = status === "all" || ticket.status === status;
    const matchesSearch =
      !query ||
      `${ticket.customerName} ${ticket.subject}`
        .toLocaleLowerCase()
        .includes(query);
    return matchesStatus && matchesSearch;
  });
}

export function SupportInboxDemo() {
  const [tickets, setTickets] = useState(INITIAL_TICKETS);
  const [selectedId, setSelectedId] = useState("ava-export");
  const [search, setSearch] = useState("");
  const [status, setStatus] = useState("all");
  const [draft, setDraft] = useState("");
  const [message, setMessage] = useState(
    "This fictional inbox uses only local preview state.",
  );
  const localReplyNumber = useRef(0);
  const textareaRef = useRef<HTMLTextAreaElement>(null);

  const visibleTickets = useMemo(
    () => filterTickets(tickets, search, status),
    [search, status, tickets],
  );

  function reconcileSelection(nextTickets: readonly TidalSupportTicket[]) {
    if (nextTickets.some((ticket) => ticket.id === selectedId)) return;
    setSelectedId(nextTickets[0]?.id ?? "");
    setDraft("");
  }

  const selectedTicket = tickets.find((ticket) => ticket.id === selectedId);
  const conversationActions = useMemo<readonly TidalSupportAction[]>(
    () =>
      selectedTicket
        ? [
            {
              kind: "button" as const,
              id: "toggle-pending",
              label:
                selectedTicket.status === "pending"
                  ? "Mark open"
                  : "Mark pending",
              onAction: () => {
                const nextStatus =
                  selectedTicket.status === "pending" ? "open" : "pending";
                setStatus("all");
                setTickets((current) =>
                  current.map((ticket) =>
                    ticket.id === selectedTicket.id
                      ? {
                          ...ticket,
                          status: nextStatus,
                          statusLabel:
                            nextStatus === "open" ? "Open" : "Pending",
                        }
                      : ticket,
                  ),
                );
                setMessage(
                  `${selectedTicket.subject} marked ${nextStatus} in the local sample. The status filter returned to All statuses so the selected thread stays open.`,
                );
              },
            },
          ]
        : [],
    [selectedTicket],
  );

  function addLocalReply(
    ticket: TidalSupportTicket,
    event: FormEvent<HTMLFormElement>,
  ) {
    event.preventDefault();
    const body = draft.trim();
    if (!body) {
      setMessage("Write a local reply before adding it.");
      textareaRef.current?.focus({ preventScroll: true });
      return;
    }
    localReplyNumber.current += 1;
    const replyId = `local-reply-${localReplyNumber.current}`;
    setTickets((current) =>
      current.map((currentTicket) =>
        currentTicket.id === ticket.id
          ? {
              ...currentTicket,
              messages: [
                ...currentTicket.messages,
                {
                  id: replyId,
                  authorName: "Eli Park",
                  avatarSrc: tidalExampleAvatarDataUri("04"),
                  side: "agent" as const,
                  timestamp: "Just now",
                  body,
                },
              ],
            }
          : currentTicket,
      ),
    );
    setDraft("");
    setMessage(`A fictional reply was added locally to ${ticket.subject}.`);
    textareaRef.current?.focus({ preventScroll: true });
  }

  return (
    <div className="support-inbox-demo">
      <TidalSupportInbox
        title="Support inbox"
        eyebrow={null}
        description="Search sample tickets and add a local reply."
        tickets={visibleTickets}
        selectedTicketId={selectedId}
        onTicketSelect={(ticket) => {
          setSelectedId(ticket.id);
          setDraft("");
          setMessage(`${ticket.subject} selected.`);
        }}
        searchValue={search}
        onSearchValueChange={(value) => {
          setSearch(value);
          reconcileSelection(filterTickets(tickets, value, status));
        }}
        searchInputProps={{ placeholder: "Search name or subject" }}
        statusFilterValue={status}
        statusOptions={STATUS_OPTIONS}
        onStatusFilterChange={(value) => {
          setStatus(value);
          reconcileSelection(filterTickets(tickets, search, value));
        }}
        conversationActions={conversationActions}
        draftValue={draft}
        onDraftValueChange={setDraft}
        onReplySubmit={addLocalReply}
        composerLabel="Local reply draft"
        composerPlaceholder="Write a fictional reply"
        submitLabel="Add local reply"
        textareaRef={textareaRef}
        submitButtonProps={{ disabled: !draft.trim() }}
        footer={
          <span>
            <span role="status" aria-live="polite">
              {message}
            </span>{" "}
            No reply is sent, stored, or connected to a support service.
          </span>
        }
      />
    </div>
  );
}

export default function AgentExample() {
  return (
    <div className="tidal-scope" data-theme="light" dir="ltr">
      <style>{tidalExampleStyles}</style>
      <SupportInboxDemo />
    </div>
  );
}

```

## Gotchas

- The host application owns data, validation, persistence, navigation, and service side effects described by this API.

## Theme and accessibility

{"tokens":["--t-accent","--t-border","--t-border-strong","--t-canvas","--t-danger","--t-display","--t-ease-out","--t-ease-spring","--t-faint","--t-font","--t-ink","--t-line","--t-muted","--t-primary","--t-primary-contrast","--t-radius-card","--t-radius-control","--t-radius-overlay","--t-radius-panel","--t-ring","--t-shadow-lg","--t-shadow-soft","--t-soft","--t-subtle","--t-surface","--t-wash"],"darkMode":true}

{"keyboard":["Tab and Shift+Tab follow the component's native focus order.","Arrow-key behavior follows the exported composite-control implementation."],"aria":"The component wires labels and relationships from consumer-provided visible text or ARIA props; preserve those labels in production.","notes":"Verify focus visibility, text alternatives, contrast, and reduced motion in the final composition."}

title, typed consumer-owned tickets/messages, onTicketSelect, controlled search/status filter values and callbacks, controlled draft value and callback are required. selectedTicketId controls the pressed selection and selected conversation. Native search/select/textarea/form/submit/ticket attributes and refs pass through with consumer handlers running before component callbacks; preventDefault suppresses higher selection, filter, draft or reply callbacks. Optional typed conversation links/buttons preserve native destinations/types/refs and disabled behavior. Heading levels, control/list/message/action labels, unread formatter, placeholders, submit label, actions, empty states and footer are consumer-owned. Consumers supply filtered tickets and own reply results, announcements, requests and persistence; the component performs no send, fetch, storage or backend work.
