Accordion Blazor API

Accordion Properties

NameTypeDefaultDescription
DataSourceIEnumerable<object>N/ADetermines the data source that will be loaded to the Accordion.
DisabledboolfalseEnables or disables the accordion. Disabled elements can not be interacted with.
ExpandedIndexesint[]new int[]{}Sets or gets the expanded item indexes. Using this property items can be expanded by passing in their indexes. The number of expanded items is limited by the expandMode.
ExpandModeAccordionExpandModeAccordionExpandMode.SingleFitHeightSets or gets the expand mode. Expand mode determines how the items will expand or collapse.
Localestring"en"Sets or gets the language. Used in conjunction with the property messages.
MessagesobjectN/ASets or gets an object specifying strings used in the widget that can be localized. Used in conjunction with the property locale.
ReadonlyboolfalseDetermines if the element is readonly or not. If the element true, users cannot interact with it.
ReorderboolfalseEnables or disables accordion reordering.
RightToLeftboolfalseSets or gets the value indicating whether the element is aligned to support locales using right-to-left fonts.
Themestring""Determines the theme. Theme defines the look of the element
UnfocusableboolfalseDetermines whether the element can be focused or not.

Accordion Methods

NameTypeArgumentsDescription
Collapsevoidint positionCollapses an item at a specified index.Args: int position - The index of the collapsed item.
Expandvoidint positionExpands an item at a specified index.Args: int position - The index of the expanded item.
GetDataSourceAsync()Task<IEnumerable<object>>'N/A'Gets the &quot;DataSource&quot; property as Task&lt;IEnumerable&lt;object&gt;&gt;.
Insertvoidint index, object itemInserts a new item at a specified index.Args: int index - The index where the item must be inserted.,object item - An object containing the values for the properties of the new item to be inserted.
Refreshvoid'N/A'Refreshes the Blazor Component. Performs a layout of the HTML Elements and recalculates the measurements.
RemoveAtvoidint positionRemoves an item at a specified index.Args: int position - The index of the item to be removed.
Rendervoid'N/A'Re-renders the Blazor Component. This method will make a full re-render.
StateHasChangedvoid'N/A'Refreshes the state and Re-renders the Blazor Component, if necessary.
Updatevoidint index, object settingsUpdates an item from the element.Args: int index - The index of the item to be updated.,object settings - An object containing the values for the properties of the item that will be updated.

Accordion Events

NameTypeDescriptionEvent Detail
OnCollapseEventCallback<Event>This event is triggered when an item is collapsed.dynamic content- The content of the item., int index- The index of the item., string label- The label of the item
Collapsedevent AccordionCollapsedEventHandlerThis event is triggered when an item is collapsed.AccordionCollapsedEventArgs
OnCollapsingEventCallback<Event>This event is triggered when an item is going to be collapsed.dynamic content- The content of the item., int index- The index of the item., string label- The label of the item
Collapsingevent AccordionCollapsingEventHandlerThis event is triggered when an item is going to be collapsed.AccordionCollapsingEventArgs
OnDragEndEventCallback<Event>This event is triggered when a reordering operation is completed.dynamic position- The current top and left position of the item that was dragged., dynamic target- The item that was dragged., dynamic content- The content of the item., int index- The index of the item., string label- The label of the item.
DragEndedevent AccordionDragEndedEventHandlerThis event is triggered when a reordering operation is completed.AccordionDragEndedEventArgs
OnDragStartEventCallback<Event>This event is triggered when a reordering operation is started.dynamic position- The current top and left position of the item that is about to be dragged., dynamic target- The item that is about to be dragged., dynamic content- The content of the item., int index- The index of the item., string label- The label of the item.
DragStartedevent AccordionDragStartedEventHandlerThis event is triggered when a reordering operation is started.AccordionDragStartedEventArgs
OnExpandEventCallback<Event>This event is triggered when an item is expanded.dynamic position- The current top and left position of the item., dynamic target- The item that was dragged., dynamic content- The content of the item., int index- The index of the item., string label- The label of the item.
Expandedevent AccordionExpandedEventHandlerThis event is triggered when an item is expanded.AccordionExpandedEventArgs
OnExpandingEventCallback<Event>This event is triggered when an item is going to be expanded.dynamic content- The content of the item., int index- The index of the item., string label- The label of the item
Expandingevent AccordionExpandingEventHandlerThis event is triggered when an item is going to be expanded.AccordionExpandingEventArgs

Enums

AccordionExpandMode

AccordionExpandMode.Single
AccordionExpandMode.SingleFitHeight
AccordionExpandMode.Multiple
AccordionExpandMode.Toggle
AccordionExpandMode.None