Panel
Panel
A titled container that can collapse behind its header.
WAI-ARIA tested
Import
main.ts
import { Panel } from '@vitral/vue';Basic
Header
A panel groups content under a header. Without `toggleable` the header is plain text.
Toggleable (Expander)
Press the header, or Tab to it and press Enter or Space, to collapse this content.
Custom toggle icon, starting collapsed
API
Read from packages/vue/src/components/Panel/types.ts, so it says what the component actually accepts.
Props
| Name | Type | Description |
|---|---|---|
| header | string | The header's text. |
| toggleable | boolean | Makes the header a button that shows and hides the content. |
| toggleIcon | IconProp | Replaces the chevron. The chevron turns over when open; a custom icon stays as it is. |
Plus pt, dt and unstyled from BaseProps, see pass-through and unstyled mode.
Emits
| Event | Payload | Description |
|---|---|---|
| toggle | event: PanelToggleEvent | — |
Slots
| Name | Slot props | Description |
|---|---|---|
| header | — | Replaces the `header` text. Inside the toggle button when toggleable, so it must not hold controls of its own. |
| icons | — | Actions at the end of the header; kept outside the toggle button. |
| toggleicon | (props: { collapsed: boolean }) | — |
| default | — | — |
| footer | — | — |