LevelChatDocs
Docs
QAPanel

Components

QAPanel

Audience Q&A queue with upvote-driven sort + host answer actions.

QAPanel is the audience Q&A surface — question feed sorted by upvotes, with a composer at the bottom for asking and host-only "mark answered live" / "type answer" actions. Composes useQA.

Install

pnpm add @levelchat/react-components @levelchat/web

Basic usage

import { QAPanel } from '@levelchat/react-components';

<QAPanel isHost={isHost} className="h-full w-80" />

Sorting + status

The server returns questions sorted by (status='open' ? 0 : 1, upvotes desc, createdAt asc). The burning, well-upvoted question lands at the top; answered ones drop to the bottom but stay visible.

Three status states:

  • open — awaiting an answer.
  • answered-live — host marked answered live (they spoke it).
  • answered-text — host typed a written response, attached.

Host actions

  • "Mark answered live" — flips the status to answered-live.
  • "Type answer" — opens an inline textarea; submitting attaches the text + flips to answered-text.

Accessibility

  • role="region" + aria-label="Q and A" on the panel.
  • Upvote buttons are aria-pressed for toggle semantics.
  • Question list is <ul role="feed">.

Props

PropTypeDefaultNotes
isHostbooleanfalseShow host-only mark-answered / type-answer actions.
hideComposerbooleanfalseHide the ask composer.
placeholderstring"Ask a question…"Composer placeholder.
QAPanel — LevelChat Docs