Skip to content

HySplitterPanel ​

Usage examples on this page are written for Lit / plain HTML (<hy-splitter-panel>). The same component ships as HySplitterPanel in @whitespaceux/harmony-react (native React 19), with typed wrappers for Angular, Solid, Svelte, and Vue. The API reference below applies to all frameworks.

Used inside <hy-splitter> — it only means something as part of it.

A content panel within an hy-splitter group. Wraps content and provides size constraints for the parent splitter's resize logic. Supports collapsible behavior.

This component is not designed to be used standalone - it must be a direct child of hy-splitter.

Accessibility: your part ​

  • Do not leave a control people need only inside a panel that can collapse without collapsible to reopen it.

Examples ​

Basic panel ​

html
<hy-splitter-panel default-size="50">
  <p>Panel content</p>
</hy-splitter-panel>

With constraints ​

html
<hy-splitter-panel default-size="25" min-size="15" max-size="40">
  <nav>Sidebar</nav>
</hy-splitter-panel>

Collapsible ​

html
<hy-splitter-panel default-size="25" min-size="15" collapsible collapsed-size="0">
  <nav>Sidebar</nav>
</hy-splitter-panel>

API ​

Properties ​

PropertyAttributeTypeDefaultDescription
currentSize—number0Current computed size (managed by parent splitter)
defaultSizedefault-sizenumber0Initial size as a percentage (0-100). If omitted, remaining space is distributed equally.
minSizemin-sizenumber0Minimum allowed size as a percentage (0-100).
maxSizemax-sizenumber100Maximum allowed size as a percentage (0-100).
collapsiblecollapsiblebooleanfalseWhether this panel can be collapsed below its min-size.
collapsedSizecollapsed-sizenumber0Size when collapsed, as a percentage (0-100).
collapsedcollapsedbooleanfalseWhether the panel is currently collapsed. Set it in markup to start collapsed: the parent splitter lays the panel out at its collapsed-size on first render (its neighbor takes the rest) and restores its default size on expand. Pair it with collapsible so the user can reopen it (Enter on the handle, or a drag past min-size).

Events ​

EventDetailDescription
collapse—Fired when collapse state changes. Detail: { collapsed: boolean }

Slots ​

SlotDescription
defaultPanel content

CSS Parts ​

PartDescription
panelThe panel wrapper element

Methods ​

collapse() ​

Collapses the panel to its collapsed-size.

expand() ​

Expands the panel to its previous size (before collapse).

getSize() ​

Gets the current computed size of the panel.

resize() ​

Sets the panel size programmatically.

Built with Lit. Documented with VitePress.