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.

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.

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

Events

EventDetailDescription
collapseFired 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.