Skip to main content

Accordion

About 1454 wordsAbout 5 min

Accordion

Installation

import { FgAccordion, FgAccordionItem, FgAccordionHead, FgAccordionBody } from 'fadgram-vue'

Props

PropTypeDefaultDescription
modesingle | multiplesingleControls open behavior: one or many items can be open.
multiplebooleanfalseAlternative to mode if true, forces multiple mode.
storageKeystringfg-accordionKey used in localStorage for persisting open state.
persistbooleantrueIf true, open state is saved/restored from localStorage.

Available components

  • FgAccordion
  • FgAccordionItem
  • FgAccordionHead
  • FgAccordionBody

Basic Example

Preview

Multiple

Preview

Persist

Tips

This accordion will remember the opened items using storageKey to see the feature open an item and refresh the page

Preview

Accordion Item

Props

PropTypeRequiredDefaultDescription
idstringNoauto-generatedUnique ID for the accordion item.
titlestringNoundefinedTitle text shown in the accordion head.
iconstringNoundefinedOptional icon name to show beside the title.

Shortness accordion item head

Tips

you can add the title and title icon directly to the accordion item and it will create accordion head automatically

Example

Preview