# Accordion Panel

(part of package '[Bootstrap Components](/reference/servoyextensions/packages/ui-component-packages/bootstrap-components.md)')\
Extends designtime/SolutionModel: [JSWebComponent](/reference/servoycore/dev-api/solutionmodel/jswebcomponent.md)\
Extends runtime: [RuntimeWebComponent](/reference/servoycore/dev-api/forms/runtimeform/elements/runtimewebcomponent.md)

The AccordionPanel component is a container similar to a TabPanel, but, instead of having tabs for showing / hiding forms, it has buttons that behave like an accordion, moving one way or the other.

This is a reference page; many components have detailed usage guides [here](https://docs.servoy.com/guides/develop/application-design/ui-components).

## Properties

### activeTabIndex

The index of the currently active tab in the accordion. Type: [Number](/reference/servoycore/dev-api/js-lib/number.md) Default Value: 0

***

### containerStyleClass

The CSS class(es) to be added to container element - parent of the form element. Type: [Styleclass](/reference/servoy-developer/component_and_service_property_types.md#styleclass)

***

### height

Minimum height of the accordion, should be used for responsive forms. Type: [Number](/reference/servoycore/dev-api/js-lib/number.md) Default Value: "500"

***

### styleClass

The CSS class(es) to be added to accordion element. Type: [Styleclass](/reference/servoy-developer/component_and_service_property_types.md#styleclass)

***

### tabIndex

The index used for tab order when setting focus. Type: [Number](/reference/servoycore/dev-api/js-lib/number.md) Default Value: 1

***

### tabSeq

The tab sequence order used during design. Type: [Tabseq](/reference/servoy-developer/component_and_service_property_types.md#tabseq)

***

### tabs

Array of tabs within the accordion component. Type: [Array\<CustomType\<bootstrapcomponents-accordion.tab>>](#tab)

***

### visible

Whether the button is visible or not Type: [Visible](/reference/servoy-developer/component_and_service_property_types.md#visible)

***

## Events

### onChangeMethodID(previousIndex,event,newIndex)

Fired after a different tab is selected

**Parameters:**

> * {[Number](/reference/servoycore/dev-api/js-lib/number.md)} previousIndex The previous tab index
> * {[JSEvent](/reference/servoycore/dev-api/application/jsevent.md)} event The event object associated with the tab change
> * {[Number](/reference/servoycore/dev-api/js-lib/number.md)} newIndex The tab index that is now set

***

## API

### addTab(form,tabText,index)

Adds a tab to this accordion with that form and text on the given index

**Parameters:**

> * {[Form](/reference/servoy-developer/component_and_service_property_types.md#form)} form The form to be added as a new tab in the accordion component.
> * {[Tagstring](/reference/servoy-developer/component_and_service_property_types.md#tagstring)} tabText The text to be displayed on the tab for the added form.
> * {[Number](/reference/servoycore/dev-api/js-lib/number.md)} \[index] Optional. The position at which the tab should be added. If not provided, the tab is added at the end.

**Returns:** [CustomType\<bootstrapcomponents-accordion.tab>](#tab) The newly created tab object that represents the added form in the accordion component.

***

### getTabAt(i)

Return the Tab of the given index.

**Parameters:**

> * {[Number](/reference/servoycore/dev-api/js-lib/number.md)} i The 1-based index of the tab to retrieve from the accordion component.

**Returns:** [CustomType\<bootstrapcomponents-accordion.tab>](#tab) The tab object at the specified index in the accordion component.

***

### removeTabAt(index)

Removes a tab of the given index.\
Return true if this was sucessfull.

**Parameters:**

> * {[Number](/reference/servoycore/dev-api/js-lib/number.md)} index The 1-based position of the tab to be removed from the accordion component.

**Returns:** [Boolean](/reference/servoycore/dev-api/js-lib/boolean.md) True if the tab was successfully removed; false otherwise.

***

### selectTabAt(index)

Select the tab of the given index.\
Return true if this was succesfull.

**@deprecated** use tabIndex property instead.

**Parameters:**

> * {[Number](/reference/servoycore/dev-api/js-lib/number.md)} index

***

## Types

## tab

Defines a tab object for the AccordionPanel component. scripting type: CustomType\<bootstrapcomponents-accordion.tab>

* containedForm
  * The form contained within the tab.
  * **Type**: [form](/reference/servoy-developer/component_and_service_property_types.md#form)
* disabled
  * Whether the tab is disabled.
  * **Type**: [boolean](/reference/servoycore/dev-api/js-lib/boolean.md)
  * **Default Value**: false
* name
  * The unique name identifier of the tab.
  * **Type**: [string](/reference/servoycore/dev-api/js-lib/string.md)
* relationName
  * The relation name associated with the tab used for linking forms.
  * **Type**: [relation](/reference/servoy-developer/component_and_service_property_types.md#relation)
* text
  * The text displayed on the tab.
  * **Type**: [tagstring](/reference/servoy-developer/component_and_service_property_types.md#tagstring)
  * **Default Value**: "tab"

***


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.servoy.com/reference/servoyextensions/ui-components/form-containers/accordionpanel.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
