• Items (DataSource) ObservableList<AccordionItem>


    AccordionItem fields:

    • ToggleObject GameObject Click on this object open or close ContentObject.

    • ContentObject GameObject

    • Open bool Default state of the ContentObject.

  • Only One Open bool

    Only one item can be open at the same time.

  • All Items Can Be Closed bool

    Allow to close all items; otherwise at least one item always will be opened.

  • Animate bool

    Animate open and close.

  • Animation Duration float

    Animation Duration.

  • Unscaled Time bool

    Run animation with unscaled time.

  • Direction AccordionDirection

    • Horizontal

    • Vertical

  • Resize Method ResizeMethods

    • Size - change width or height of the ContentObject.

    • Flexible - change LayoutElement flexibleWidth or flexibleHeight of the ContentObject.

  • Disable Closed bool

    Disable closed ContentObjects.


  • OnToggleItem UnityEvent<AccordionItem>

  • OnStartToggleAnimation UnityEvent<AccordionItem>

  • OnDataSourceChanged UnityEvent


AccordionHighlight is a separate component to highlight ToggleObjects of the opened item.

Open item


Close item


Toggle item


Set items

Accordion.DataSource = new ObservableList<AccordionItem>()
   new AccordionItem()
      ToggleObject = Header1,
      ContentObject = Content1,
      Open = true,
   new AccordionItem()
      ToggleObject = Header2,
      ContentObject = Content2,
      Open = false,
   new AccordionItem()
      ToggleObject = Header3,
      ContentObject = Content3,
      Open = false,