Panel

A titled container with optional header actions and footer that can collapse its body. Use it for dashboard sections and settings groups that users may want to fold away.

  • vig-panel
  • [vigPanelActions]
  • [vigPanelFooter]
Import
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

Three orders shipped and one was returned since yesterday.

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.

Status, owner and date range filters.

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"]

Panel styling hooks
Part Element data-state
root The vig-panel host. open, closed
header The header row: heading and [vigPanelActions] . —
heading The h2 – h6 of heading . —
trigger The disclosure button of a collapsible panel ( aria-expanded ). open, closed
indicator The chevron of the trigger. —
label The heading text inside the trigger. —
actions Wrapper of the [vigPanelActions] slot. —
content The collapsible part: body and footer ( hidden="until-found" while collapsed); data-state only when collapsible. open, closed
body The padded body. —
footer Wrapper of the [vigPanelFooter] slot. —

Accessibility

  • The heading is a native <h2>–<h6>; when collapsible, a <button> inside it carries aria-expanded and aria-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. Where interpolate-size is supported the height animates, except with reduced motion.

API

Panel

vig-panel component

A titled container: a heading (a real h2–h6, headingLevel), header actions ([vigPanelActions]), the projected body and a footer ([vigPanelFooter]).

Example :
<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.

Panel props
Name Type Default Description
collapsed model booleanfalse

Whether the body is collapsed; two-way bindable. Ignored unless collapsible.

collapsiblebooleanfalse

Turns the heading into a button that collapses and expands the body.

headingstring | undefinedundefined

Title text, rendered as a real heading. Needed for collapsible.

headingLevelPanelHeadingLevel3

Level of the h2–h6 heading.

Templates and directives

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).

Are you sure?