Portal Community

Minimal Example

{
  "id": "faq-accordion",
  "type": "accordion",
  "order": 1,
  "width": "full",
  "settings": {
    "allowMultiple": false,
    "items": [
      { "id": "item-personal",   "label": "Personal Information",  "sectionId": "sec-personal",   "defaultOpen": true },
      { "id": "item-address",    "label": "Address Details",       "sectionId": "sec-address" },
      { "id": "item-employment", "label": "Employment History",    "sectionId": "sec-employment" }
    ]
  }
}

Settings Reference

SettingTypeDefaultDescription
itemsAccordionItem[]Array of accordion panel definitions
allowMultiplebooleanfalseAllow more than one panel open simultaneously
variantdefault | flush | bordereddefaultVisual style of accordion borders and separators
iconPositionleft | rightrightPosition of the expand/collapse chevron
animateHeightbooleantrueAnimate height transition on expand/collapse

Accordion Item Schema

interface AccordionItem {
  id: string;           // Unique item identifier
  label: string;        // Panel header text
  sectionId: string;    // Form section to display when expanded
  defaultOpen?: boolean; // Start expanded
  disabled?: boolean;   // Prevent expanding
  icon?: string;        // FontAwesome class in header
  badge?: string;       // Badge text (e.g., "Required")
}

Multi-Expand Mode

Use allowMultiple: true for reference forms where users need to consult multiple sections simultaneously:

{
  "id": "policy-sections",
  "type": "accordion",
  "settings": {
    "allowMultiple": true,
    "items": [
      { "id": "section-a", "label": "Section A: General Conditions",  "sectionId": "sec-a", "defaultOpen": true },
      { "id": "section-b", "label": "Section B: Coverage Details",    "sectionId": "sec-b" },
      { "id": "section-c", "label": "Section C: Exclusions",          "sectionId": "sec-c" },
      { "id": "section-d", "label": "Section D: Claims Procedure",    "sectionId": "sec-d" }
    ]
  }
}

Accordion Variants

VariantAppearanceBest For
defaultCard-style panels with outer border and shadowStandard forms with clear visual separation
flushNo outer border or shadow; items separated by divider line onlyCompact inline sections, settings pages
borderedEach item has a border; more distinct separationData entry forms with clearly separated categories

With Status Badges

{
  "id": "onboarding-accordion",
  "type": "accordion",
  "settings": {
    "allowMultiple": false,
    "items": [
      { "id": "step-1", "label": "Basic Information",  "sectionId": "sec-basic",   "badge": "Required", "defaultOpen": true },
      { "id": "step-2", "label": "Verification",       "sectionId": "sec-verify",  "badge": "Required" },
      { "id": "step-3", "label": "Preferences",        "sectionId": "sec-prefs",   "badge": "Optional" }
    ]
  }
}

Accordion vs Tabs vs Stepper

Use accordion whenUse tabs whenUse stepper when
All section headings should be visibleOne section at a time; topic navigationSequential steps; each step validates before advancing
Users may skip to any sectionUsers jump between topics freelyLinear progression with validation gates
Sections vary significantly in lengthSections are similar in sizeSteps are short and ordered