FAQ

The FodFaq component displays frequently asked questions in an accordion format. It supports API-driven mode for fetching FAQs from a service, manual mode with data collections, and compound pattern mode with declarative FodFaqItem children. Built-in search filtering, loading states, and customizable templates provide a complete FAQ solution.

Basic Usage

A simple FAQ section using the Items collection to provide FAQ data. Each FaqItem defines a question and answer with multilingual support.

Basic FAQ with Title

Frequently Asked Questions

Answers to the most common questions about the platform.

razor
<FodFaq Title="Frequently Asked Questions"
        Subtitle="Answers to common questions"
        Items="@_faqItems"
        ShowSearch="false" />

@code {
    private List<FaqItem> _faqItems =
    [
        new FaqItem
        {
            Id = "1",
            Question = new MultilingualText { ["en"] = "What is FodFaq?" },
            Answer = new MultilingualText { ["en"] = "FodFaq displays FAQs in accordion format." },
            Order = 1
        }
    ];
}

Section Header

FodFaq includes a built-in header section with Title, Subtitle, and custom HeaderContent for complete FAQ section layouts.

Title and Subtitle

Frequently Asked Questions

Answers to the most common questions.

Custom Header Content

Frequently Asked Questions

Answers to the most common questions about the platform.

Need Help?

Browse our knowledge base

razor

@* Title and Subtitle *@
<FodFaq Title="Getting Started"
        Subtitle="Everything you need to know"
        Items="@_items" />



@* Custom Header Content *@
<FodFaq Items="@_items">
    <HeaderContent>
        <div class="custom-header">
            <FodIcon Icon="IconName.Help" />
            <h2>Need Help?</h2>
        </div>
    </HeaderContent>
</FodFaq>

Items Collection Mode

Use the Items parameter to provide FAQ data programmatically. FaqItem objects support multilingual content via MultilingualText.

FAQ from Items Collection

Frequently Asked Questions

Answers to the most common questions about the platform.

razor
<FodFaq Items="@_faqItems" />

@code {
    private List<FaqItem> _faqItems =
    [
        new FaqItem
        {
            Id = "1",
            Question = new MultilingualText { ["en"] = "Question?" },
            Answer = new MultilingualText { ["en"] = "Answer." },
            Order = 1
        }
    ];
}

Search Functionality

Enable search to allow users to filter FAQ items by question text and keywords. The search uses debounced input for optimal performance.

FAQ with Search

Try searching for "blazor", "component", or "search".

Frequently Asked Questions

Answers to the most common questions about the platform.

razor
<FodFaq Items="@_faqItems"
        ShowSearch="true"
        SearchPlaceholder="Search FAQs..."
        OnSearchPerformed="HandleSearch" />

@code {
    private void HandleSearch(string query)
    {
        Console.WriteLine($"Search: {query}");
    }
}

Accordion Modes

FodFaq inherits accordion behavior with Single (one expanded at a time) or Multiple (many expanded) modes.

Single Mode (Default)

Expanding one FAQ automatically collapses others.

Frequently Asked Questions

Answers to the most common questions about the platform.

Multiple Mode

Multiple FAQs can be expanded simultaneously.

Frequently Asked Questions

Answers to the most common questions about the platform.

razor

@* Single Mode - only one FAQ expanded at a time *@
<FodFaq Items="@_items" Mode="AccordionMode.Single" />



@* Multiple Mode - multiple FAQs can be expanded *@
<FodFaq Items="@_items" Mode="AccordionMode.Multiple" />

Loading State

FodFaq displays skeleton placeholders while loading data. Use SkeletonCount to control the number of placeholder items.

Simulated Loading State

Frequently Asked Questions

Answers to the most common questions about the platform.

razor

@* Loading state is automatic when using ServiceId *@
<FodFaq ServiceId="my-service-id" SkeletonCount="5" />



@* SkeletonCount controls placeholder quantity *@
<FodFaq ServiceId="service" SkeletonCount="3" />

Empty State

When no FAQ items are available, FodFaq displays an empty state. Customize it with EmptyStateMessage or EmptyStateTemplate.

Default Empty State

Frequently Asked Questions

Answers to the most common questions about the platform.

No FAQs available

There are currently no FAQs available for this service.

With Subtext

Frequently Asked Questions

Answers to the most common questions about the platform.

No FAQs available

There are currently no FAQs available for this service.

Custom Empty State Template

Frequently Asked Questions

Answers to the most common questions about the platform.

No FAQs available

There are currently no FAQs available for this service.

razor

@* Simple message *@
<FodFaq Items="@emptyList" EmptyStateMessage="No FAQs found." />



@* Message with subtext *@
<FodFaq Items="@emptyList"
        EmptyStateMessage="No results found"
        EmptyStateSubtext="Try adjusting your search." />



@* Custom template *@
<FodFaq Items="@emptyList">
    <EmptyStateTemplate>
        <div class="custom-empty-state">
            <FodIcon Icon="IconName.Help" />
            <p>No FAQs available yet.</p>
        </div>
    </EmptyStateTemplate>
</FodFaq>

Custom Answer Template

Use AnswerTemplate to customize how FAQ answers are rendered. Access the FaqItem context for dynamic content.

Rich Answer Content

Frequently Asked Questions

Answers to the most common questions about the platform.

razor
<FodFaq Items="@_items">
    <AnswerTemplate Context="faqItem">
        <div class="custom-answer">
            <p>@faqItem.Answer.GetLocalized()</p>
            @if (faqItem.Keywords?.Any() == true)
            {
                
<div class="keywords">
    @foreach (var keyword in faqItem.Keywords)
                        
    {
                            
    <span class="keyword">@keyword</span>
                        
    }
</div>
            }
        </div>
    </AnswerTemplate>
</FodFaq>

Events

FodFaq provides events for tracking user interactions: OnFaqExpanded fires when an FAQ is opened, OnSearchPerformed fires on search.

Interactive FAQ with Events

Frequently Asked Questions

Answers to the most common questions about the platform.

Event Log

Expand an FAQ or search to see events...
razor
<FodFaq Items="@_items"
        OnFaqExpanded="HandleExpanded"
        OnSearchPerformed="HandleSearch" />

@code {
    private void HandleExpanded(FaqItem item)
    {
        Console.WriteLine($"Expanded: {item.Question}");
    }

    private void HandleSearch(string query)
    {
        Console.WriteLine($"Search: {query}");
    }
}

API-Driven Mode

Use ServiceId to fetch FAQ data from the Info Portal API. The component handles loading states and error handling automatically.

Live API Demo (ServiceId: "EVOweb home")

EVO Web FAQ

Frequently asked questions fetched from Info Portal API

razor

@* API-driven mode - fetches from Info Portal *@
<FodFaq ServiceId="EVOweb home"
        Title="EVO Web FAQ"
        Subtitle="Frequently asked questions fetched from Info Portal API"
        SkeletonCount="5"
        ShowSearch="true"
        SearchPlaceholder="Search EVO questions..." />



@* The component handles:
   - Loading state with skeletons
   - Error handling (shows empty state on failure)
   - Multilingual content based on current culture
   - Search filtering on fetched data *@

API Reference - FodFaq

FodFaq component parameters for configuring FAQ display and behavior.

No properties defined.

API Reference - FodFaqItem

FodFaqItem child component for declarative FAQ definition.

No properties defined.

Rejoining the server...

Rejoin failed... trying again in seconds.

Failed to rejoin.
Please retry or reload the page.

The session has been paused by the server.

Failed to resume the session.
Please reload the page.