Class Accordion
A collapsible content container that allows users to expand and collapse sections of content.
Implements
Inherited Members
Namespace: Unity.AppUI.UI
Assembly: Unity.AppUI.dll
Syntax
[UxmlElement]
public class Accordion : BaseVisualElement, IEventHandler, IResolvedStyle, ITransform, ITransitionAnimations, IExperimentalFeatures, IVisualElementScheduler, IContextOverrideElement, IAdditionalDataHolder
Remarks
The Accordion component is a versatile UI element that organizes content into collapsible sections. Each section consists of a header and content area that can be toggled open or closed. This pattern is particularly useful when you need to present multiple sections of content in a limited space.
The component supports both single-expansion (exclusive) and multi-expansion modes, making it suitable for various use cases such as FAQs, settings panels, or navigation menus.
Note: The Accordion component requires AccordionItem children to function properly. Each AccordionItem represents a collapsible section within the Accordion.
Constructors
Accordion()
Default constructor.
Declaration
public Accordion()
Fields
ussClassName
The Accordion main styling class.
Declaration
public const string ussClassName = "appui-accordion"
Field Value
| Type | Description |
|---|---|
| string |
Properties
isExclusive
The behavior of the Accordion when multiple items are open.
Declaration
[Tooltip("If true, a maximum of one item can be open at a time.")]
[CreateProperty]
[UxmlAttribute]
[Header("Accordion")]
public bool isExclusive { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
Remarks
If true, a maximum of one item can be open at a time.