Hiyve Components - v1.0.0
    Preparing search index...

    Props for the QAPanel component.

    The QAPanel displays an interactive Q&A interface where participants can ask questions, upvote, and receive answers from the host.

    Features:

    • Real-time question posting and sync
    • Upvoting with duplicate prevention
    • Host-only answering capability
    • Sort by newest, most votes, or unanswered
    • Pin questions to top
    • Delete questions (owner only)
    • Late-joiner state sync

    Basic usage inside HiyveProvider:

    import { QAPanel } from '@hiyve/react-collaboration';

    function QASidebar() {
    return <QAPanel title="Q&A" maxHeight={500} />;
    }

    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)}
    />
    interface QAPanelProps {
        allowAnonymous?: boolean;
        autoSaveInterval?: number;
        colors?: Partial<QAPanelColors>;
        disabled?: boolean;
        enableAutoSave?: boolean;
        fileLocation?: string;
        icons?: Partial<QAPanelIcons>;
        initialFileId?: string;
        initialQuestions?: Question[];
        labels?: Partial<QAPanelLabels>;
        maxHeight?: string | number;
        onAutoSave?: (fileId: string) => void;
        onAutoSaveError?: (error: Error) => void;
        onNewQuestion?: (question: Question) => void;
        onQuestionAnswered?: (question: Question) => void;
        onQuestionPosted?: (question: Question) => void;
        onQuestionsChange?: (questions: Question[]) => void;
        ownerOnlyModerate?: boolean;
        readOnly?: boolean;
        renderProps?: QAPanelRenderProps;
        showHeader?: boolean;
        styles?: Partial<QAPanelStyles>;
        sx?: SxProps<Theme>;
        title?: string;
    }
    Index

    Properties

    allowAnonymous?: boolean

    Allow anonymous questions - hides author names (default: false)

    autoSaveInterval?: number

    Auto-save interval in milliseconds (default: 3000)

    colors?: Partial<QAPanelColors>

    Custom colors

    disabled?: boolean

    Whether the panel is disabled

    enableAutoSave?: boolean

    Enable auto-save to file storage (default: false)

    fileLocation?: string

    File storage location (default: '/Questions')

    icons?: Partial<QAPanelIcons>

    Custom icons

    initialFileId?: string

    Initial file ID for resuming auto-save to existing file

    initialQuestions?: Question[]

    Initial questions for pre-populating the panel

    labels?: Partial<QAPanelLabels>

    Custom labels for i18n support

    maxHeight?: string | number

    Maximum height before scrolling

    onAutoSave?: (fileId: string) => void

    Callback after successful auto-save

    onAutoSaveError?: (error: Error) => void

    Callback on auto-save error

    onNewQuestion?: (question: Question) => void

    Callback when a new remote question arrives

    onQuestionAnswered?: (question: Question) => void

    Callback when a question is answered

    onQuestionPosted?: (question: Question) => void

    Callback when a new question is posted locally

    onQuestionsChange?: (questions: Question[]) => void

    Callback when questions change (for persistence)

    ownerOnlyModerate?: boolean

    Only room owner can answer and delete questions (default: true)

    readOnly?: boolean

    Read-only mode - hides question input, disables upvoting/answering (for viewing saved sessions)

    renderProps?: QAPanelRenderProps

    Render props for advanced customization

    showHeader?: boolean

    Show the header (default: true)

    styles?: Partial<QAPanelStyles>

    Custom styles

    sx?: SxProps<Theme>

    MUI sx styling prop

    title?: string

    Title for the Q&A header (default: 'Q&A')