API reference
Properties
| Property | Attribute | Description | Type | Default |
|---|---|---|---|---|
| description | description | Specifies a description for the component. | string | |
| expanded | expanded | When true, expands the component and its contents. | boolean | false |
| heading | heading | Specifies heading text for the component. | string | |
| headingLevel | heading-level | Specifies the heading level of the component's heading for proper document structure, without affecting visual styling. | 1 | 2 | 3 | 4 | 5 | 6 | |
| iconEnd | icon-end | Specifies an icon to display at the end of the component. | string | |
| iconFlipRtl | icon-flip-rtl | Displays the iconStart and/or iconEnd as flipped when the element direction is right-to-left ("rtl"). | "both" | "end" | "start" | |
| iconStart | icon-start | Specifies an icon to display at the start of the component. | string | |
| messageOverrides | Use this property to override individual strings used by the component. | Record<string, unknown> |
Slots
| Name | Description |
|---|---|
| default (unnamed) | A slot for adding custom content, including nested calcite-accordion-items. |
| actions-end | A slot for adding calcite-actions or content to the end side of the component's header. |
| actions-start | A slot for adding calcite-actions or content to the start side of the component's header. |
| content-end | A slot for adding non-actionable elements after the component's header text. |
| content-start | A slot for adding non-actionable elements before the component's header text. |
Styles
| Name | Description |
|---|---|
| --calcite-accordion-border-color | Specifies the component's border color. |
| --calcite-accordion-background-color | Specifies the component's background color. |
| --calcite-accordion-text-color | Specifies the component's text color. |
| --calcite-accordion-text-color-hover | Specifies the component's main text color on hover. |
| --calcite-accordion-text-color-press | Specifies the component's main text color when pressed. |
| --calcite-accordion-item-background-color | --calcite-accordion-background-color. Specifies the component's background color. |
| --calcite-accordion-item-border-color | --calcite-accordion-border-color. Specifies the component's border color. |
| --calcite-accordion-item-content-space | Specifies the component's padding. |
| --calcite-accordion-item-end-icon-color | Specifies the component's iconEnd color. Falls back to --calcite-accordion-item-icon-color or current color. |
| --calcite-accordion-item-expand-icon-color | Specifies the component's expand icon color. |
| --calcite-accordion-item-header-background-color | Specifies the component's heading background color. |
| --calcite-accordion-item-header-background-color-hover | Specifies the component's heading background color when hovered. |
| --calcite-accordion-item-header-background-color-press | Specifies the component's heading background color when pressed. |
| --calcite-accordion-item-heading-text-color | Specifies the component's heading text color. |
| --calcite-accordion-item-icon-color | --calcite-icon-color. Specifies the component's default icon color. |
| --calcite-accordion-item-start-icon-color | Specifies the component's iconStart color. Falls back to --calcite-accordion-item-icon-color or current color. |
| --calcite-accordion-item-text-color | --calcite-accordion-text-color. Specifies the component's text color. |
| --calcite-accordion-item-text-color-hover | --calcite-accordion-text-color-hover. Specifies the component's text color on hover. |
| --calcite-accordion-item-text-color-press | --calcite-accordion-text-color-press. Specifies the component's text color on press. |
Events
| Name | Description | Behavior |
|---|---|---|
| calciteAccordionItemCollapse | Fires when the component's content area is collapsed. | |
| calciteAccordionItemExpand | Fires when the component's content area is expanded. |
Methods
| Name | Description | Signature |
|---|---|---|
| componentOnReady | Create a promise that resolves once component is fully loaded. | componentOnReady(): Promise<void> |
| setFocus | Sets focus on the component. | setFocus(options?: FocusOptions): Promise<void> |