Appearance
Accordions β
There are 3 types of accordions:
- Display Accordion
- Text Accordion
- Data Accordion
INFO
These components are partially adopted from PrimeVue. Its full documentation can be found here. In case there are missing features of the XerAccordion
component, please contact the Codey team.
Display Accordion β
The display accordion is a simple accordion that can be used to display extra information.
ts
import { XerDisplayAccordion } from "@xerius/codey-components";
Showcases β
With Content Object β
With Slots β
With Slots Custom Html β
Props β
Name | Type | Default | Required | Description |
---|---|---|---|---|
accordionContent | DisplayAccordionContent | { header: 'Header', panelText: 'Panel text'} | false | The accordion content (header and panel) |
dataAutomationId | String | "accordion" | false | The data automation id used for testing |
In addition, all props from PrimeVue's Accordion component are supported. See the PrimeVue Accordion documentation for details.
Types β
ts
type DisplayAccordionContent = {
header: string;
panelText: string;
};
Slots β
Name | Purpose |
---|---|
xer-accordion-header | The accordion header |
xer-accordion-panel | The accordion panel |
INFO
When provided, the slots will overrule the accordionContent
prop.
Events β
All events from PrimeVue's Accordion component are supported. See the PrimeVue Accordion documentation for details.
Automation Ids β
The component includes the following automation IDs for testing:
Element | Automation Id |
---|---|
Main accordion | {dataAutomationId} |
Header | {dataAutomationId}-header |
Panel | {dataAutomationId}-panel |
Text Accordion β
The text accordion is intended to give more pure text information about different topics.
ts
import { XerTextAccordion, XerAccordionTab } from "@xerius/codey-components";
Showcases β
Default Text Accordion β
Props β
All props from PrimeVue's Accordion component are supported. See the PrimeVue Accordion documentation for details.
Slots β
Name | Purpose |
---|---|
default | Where to place your XerAccordionTabs |
Events β
All events from PrimeVue's Accordion component are supported. See the PrimeVue Accordion documentation for details.
Data Accordion β
The data accordion is intended for data display. A row template XerDataAccordionContentRow
is provided to display data within the XerAccordionTab
.
ts
import {
XerDataAccordion,
XerAccordionTab,
XerDataAccordionContentRow,
} from "@xerius/codey-components";
Showcases β
Default Data Accordion β
With Dynamic Tabs β
With Click Handler β
With Custom Root Element β
Props β
All props from PrimeVue's Accordion component are supported. See the PrimeVue Accordion documentation for details.
XerDataAccordionContentRow β
When a @click
event is set, the rootElement
of the component will be changed to a button
element when no is
is specified.
Name | Type | Default | Required | Description |
---|---|---|---|---|
is | keyof HTMLElementTagNameMap | div | false | The root element used. |
Slots β
Name | Purpose |
---|---|
default | Where to place your XerAccordionTabs |
Events β
All events from PrimeVue's Accordion component are supported. See the PrimeVue Accordion documentation for details.