Component props
The rendered QAPanel component
QAPanel automatically connects to the HiyveProvider context for room info
and real-time synchronization. It must be used inside a <HiyveProvider>.
Key Features:
User Roles:
Answer Modes:
Sort Modes:
newest: Most recently asked questions firstvotes: Questions with most upvotes firstunanswered: Unanswered questions firstBasic usage inside HiyveProvider:
import { HiyveProvider } from '@hiyve/react';
import { QAPanel } from '@hiyve/react-collaboration';
function VideoRoom() {
return (
<HiyveProvider generateRoomToken={generateToken}>
<div className="room-layout">
<VideoGrid />
<aside className="sidebar">
<QAPanel title="Q&A" maxHeight={500} />
</aside>
</div>
</HiyveProvider>
);
}
With customization:
<QAPanel
title="Ask Questions"
labels={{
askPlaceholder: 'What would you like to know?',
emptyState: 'No questions yet. Be the first to ask!',
}}
colors={{
upvoteActive: '#ff9800',
answerBadge: '#4caf50',
}}
onQuestionPosted={(q) => console.log('New question:', q.content)}
onNewQuestion={(q) => playNotificationSound()}
/>
With persistence:
function QAWithPersistence() {
const [savedQuestions, setSavedQuestions] = useLocalStorage('qa-questions', []);
return (
<QAPanel
initialQuestions={savedQuestions}
onQuestionsChange={setSavedQuestions}
/>
);
}
QAPanel provides an interactive Q&A interface for video rooms.