Collapse
Organize long explanations into collapsible topics so users can find what they need.
Usage guide
#Use for content opened when needed, such as FAQs or supplementary settings.
Compare multiple sections
Use the default mode to keep several panels expanded together.
Focus on one section
Use accordion to expand one panel at a time.
- Panel structure
- Place
sy-collapse-panelinsidesy-collapseand put the title in theheaderslot. Set the initial state withactive, arrow visibility witharrow, and interaction availability withdisabled.openPanel()andclosePanel()use zero-based indices.
Examples
#Feature examples
#Choose a feature from 8 topics. Explore property settings, method calls, event results, and slot layouts through live examples and code.
No matching features.
API reference
#Hover over a name or focus it with the keyboard to see the code. On touch screens, tap the name.
<sy-collapse>
Properties
| Attribute / Property | Type | Default | Description |
|---|---|---|---|
boolean | false | Expand only one panel at a time. | |
boolean | false | Hide the default border. | |
boolean | false | Block user interaction and keyboard focus. | |
boolean | false | Use a layout that fills the available height. | |
boolean | false | Minimize background and border styling. |
Methods
| Method | Returns | Description |
|---|---|---|
Promise<void> | Expand all panels. In accordion mode, keep only one panel open. | |
Promise<void> | Collapse all panels. | |
Promise<void> | Expand the panel at the specified index. | |
Promise<void> | Collapse the panel at the specified index. |
Slots
| Slot | Description |
|---|---|
| Component body or child items. |
<sy-collapse-panel>
Properties
| Attribute / Property | Type | Default | Description |
|---|---|---|---|
boolean | false | Expand the panel body. | |
boolean | false | Show the expansion arrow. | |
boolean | false | Block user interaction and keyboard focus. | |
boolean | false | Minimize background and border styling. | |
boolean | false | Fill the available height. |
Events
| Event | Detail | Description |
|---|---|---|
CustomEvent<CollapsePanelChangeDetail> | Emitted when the value or selection state changes. |
Methods
| Method | Returns | Description |
|---|---|---|
Promise<void> | Toggle the current expansion state. | |
Promise<void> | Open the file chooser. Call within a user click handler. | |
Promise<void> | Close the open panel. |
Slots
| Slot | Description |
|---|---|
| Content displayed in the header area. | |
| Component body or child items. |