Panel
vig-panel [vigPanelActions] [vigPanelFooter]
import { Panel, PanelActions, PanelFooter } from '@vigdx/ui/panel';Basic
heading renders a real heading; [vigPanelActions] content sits beside it and [vigPanelFooter] content below the body.
Recent activity
Collapsible
collapsible turns the heading into a disclosure button; [(collapsed)] holds the state, so it can be preset or changed from outside. headingLevel (2–6, default 3) fits the heading into the page outline.
Styling hooks
Internal elements carry a stable data-part and the component's data-scope; both are public API, so removing one is a breaking change. Select a part by both, e.g. [data-scope="panel"][data-part="root"] { … }: the pair stays within this component when kit components nest, and also reaches parts in overlay panels, which render outside the host. State is exposed through aria-* and, where listed, a data-state; literal values are checked by the API gate, values computed from the component's state follow its documented types. Other data-* attributes listed below (such as data-opening while an overlay animates) are API too. See Customizing.
Scope: [data-scope="panel"]
| Part | Element | data-state |
|---|---|---|
root | vig-panel host. | open, closed |
header | [vigPanelActions] . | — |
heading | h2 – h6 of heading . | — |
trigger | collapsible panel ( aria-expanded ). | open, closed |
indicator | — | |
label | — | |
actions | [vigPanelActions] slot. | — |
content | hidden="until-found" while collapsed); data-state only when collapsible. | open, closed |
body | — | |
footer | [vigPanelFooter] slot. | — |
Accessibility
- The heading is a native
<h2>–<h6>; when collapsible, a<button>inside it carriesaria-expandedandaria-controls, so heading navigation still finds the panel. Header actions are separate buttons next to it, never inside it. - Not a native
<details>: a<summary>cannot hold a heading (screen readers drop it) or the action buttons. - A collapsed body (with its footer) stays in the DOM as
hidden="until-found": skipped by screen readers and the tab order, but find-in-page and text-fragment links reveal it, which expands the panel. Whereinterpolate-sizeis supported the height animates, except with reduced motion.
API
Panel
vig-panelA titled container: a heading (a real h2–h6, headingLevel), header
actions ([vigPanelActions]), the projected body and a footer
([vigPanelFooter]).
<vig-panel heading="Activity" collapsible [(collapsed)]="closed">
<vig-button vigPanelActions variant="ghost" ariaLabel="Refresh">…</vig-button>
Recent events…
</vig-panel>collapsible turns the heading into a disclosure button (inside the
heading, so heading navigation still finds it) with aria-expanded and
aria-controls; the actions stay outside it. A collapsed body stays in
the DOM as hidden="until-found": find-in-page and text-fragment links
reveal it, which expands the panel (browsers without until-found treat
it as plain hidden). Not a native <details>: a summary cannot hold
the heading or the action buttons.
| Name | Type | Default | Description |
|---|---|---|---|
collapsed | boolean | false | Whether the body is collapsed; two-way bindable. Ignored unless |
collapsible | boolean | false | Turns the heading into a button that collapses and expands the body. |
heading | string | undefined | undefined | Title text, rendered as a real heading. Needed for |
headingLevel | PanelHeadingLevel | 3 | Level of the |
| Name | Payload | Description |
|---|---|---|
collapsedChange | boolean | Whether the body is collapsed; two-way bindable. Ignored unless |
| Signature | Description |
|---|---|
toggle(): void | Collapses an expanded panel or expands a collapsed one. |
Templates and directives
| Selector | Export | Description |
|---|---|---|
[vigPanelActions] | PanelActions | Marks projected content as the panel's header actions (buttons beside the heading). |
[vigPanelFooter] | PanelFooter | Marks projected content as the panel's footer (collapses with the body). |