Splitter

Splitter is utilized to separate and resize panels.


import { SplitterModule } from 'primeng/splitter';

Splitter requires two SplitterPanel components as children which are displayed horizontally by default.

Panel 1
Panel 2


<p-splitter [style]="{ height: '300px' }" styleClass="mb-5">
    <ng-template pTemplate>
        <div class="col flex align-items-center justify-content-center">Panel 1</div>
    </ng-template>
    <ng-template pTemplate>
        <div class="col flex align-items-center justify-content-center">Panel 2</div>
    </ng-template>
</p-splitter>

When no panelSizes are defined, panels are split 50/50, use the panelSizes property to give relative widths e.g. [25, 75].

Panels are displayed as stacked by setting the layout to vertical.

Splitters can be combined to create advanced layouts.

Following is the list of structural style classes, for theming classes visit theming page.

NameElement
p-splitterContainer element.
p-splitterContainer element during resize.
p-splitter-horizontalContainer element with horizontal layout.
p-splitter-verticalContainer element with vertical layout.
p-splitter-panelSplitter panel element.
p-splitter-gutterGutter element to use when resizing the panels.
p-splitter-gutter-handleHandl element of the gutter.
Accessibility guide documents the specification of this component based on WCAG guidelines, the implementation is in progress.

Screen Reader

Splitter bar defines separator as the role with aria-orientation set to either horizontal or vertical.

Keyboard Support

KeyFunction
tabMoves focus through the splitter bar.
down arrowMoves a vertical splitter down.
up arrowMoves a vertical splitter up.
left arrowMoves a vertical splitter to the left.
right arrowMoves a vertical splitter to the right.