Skip to main content

Blazor Split View

The Blazor Bootstrap Split View component arranges two panes with a draggable divider so users can resize the layout interactively. It supports horizontal and vertical orientations, percentage-based sizing, nested layouts, live resize events, and Bootstrap-aligned divider theming.

Parameters

NameTypeDefaultRequiredDescriptionAdded Version
ColorSplitViewColorSplitViewColor.NoneGets or sets the divider color.4.0.0
CustomColorstring?nullGets or sets a custom divider color. Accepts any valid CSS color expression, including CSS variables.4.0.0
IsDisabledboolfalseGets or sets a value indicating whether user interaction is disabled.4.0.0
MinimumPaneSizedouble0Gets or sets the minimum pane size as a percentage.4.0.0
OrientationSplitViewOrientationSplitViewOrientation.HorizontalGets or sets the SplitView orientation.4.0.0
Pane1RenderFragmentnull✔️Gets or sets the first pane content.4.0.0
Pane2RenderFragmentnull✔️Gets or sets the second pane content.4.0.0
PrimaryPaneSizedouble50Gets or sets the primary pane size as a percentage.4.0.0

Callback Events

EventDescriptionAdded Version
OnResizeEndedFired when resizing ends.4.0.0
OnResizedFired while the divider is being dragged.4.0.0
OnResizeStartedFired when resizing starts.4.0.0
PrimaryPaneSizeChangedFired when the primary pane size changes.4.0.0

Enums

SplitViewColor

NameDescription
NoneUses the shared SplitView CSS variable defaults.
PrimaryUses the Bootstrap primary color token.
SecondaryUses the Bootstrap secondary color token.
SuccessUses the Bootstrap success color token.
DangerUses the Bootstrap danger color token.
WarningUses the Bootstrap warning color token.
InfoUses the Bootstrap info color token.
LightUses the Bootstrap light color token.
DarkUses the Bootstrap dark color token.
BodyUses the Bootstrap body background token.
BodySecondaryUses the Bootstrap secondary body background token.
BodyTertiaryUses the Bootstrap tertiary body background token.
BlackUses the Bootstrap black token.
WhiteUses the Bootstrap white token.
TransparentUses a transparent divider color.

SplitViewOrientation

NameDescription
HorizontalArranges panes side by side with a vertical divider.
VerticalArranges panes top to bottom with a horizontal divider.

Examples

Pane content

<SplitView Style="height: 360px;">
<Pane1>
<div class="p-4">Pane1 content</div>
</Pane1>
<Pane2>
<div class="p-4">Pane2 content</div>
</Pane2>
</SplitView>

See demo here.

Orientation

<SplitView Orientation="SplitViewOrientation.Vertical"
MinimumPaneSize="20"
PrimaryPaneSize="35"
Style="height: 420px;">
<Pane1>
<div class="p-4">Summary</div>
</Pane1>
<Pane2>
<div class="p-4">Details</div>
</Pane2>
</SplitView>

See demo here.

PrimaryPaneSizeChanged

<SplitView @bind-PrimaryPaneSize="primaryPaneSize"
Style="height: 380px;">
<Pane1>
<div class="p-4">Primary pane</div>
</Pane1>
<Pane2>
<div class="p-4">Secondary pane</div>
</Pane2>
</SplitView>
@code {
private double primaryPaneSize = 50;
}

See demo here.

Semantic Color

<SplitView Color="SplitViewColor.Primary"
Style="height: 320px;">
<Pane1>
<div class="p-4">Filters</div>
</Pane1>
<Pane2>
<div class="p-4">Results</div>
</Pane2>
</SplitView>

Hover and dragging states are derived automatically in shared CSS from the resolved base divider color.

See demo here.

CustomColor

<SplitView CustomColor="rgba(var(--bs-info-rgb), 0.85)"
Style="height: 320px;">
<Pane1>
<div class="p-4">Pane1</div>
</Pane1>
<Pane2>
<div class="p-4">Pane2</div>
</Pane2>
</SplitView>

See demo here.

Resize events

<SplitView OnResizeStarted="OnResizeStarted"
OnResized="OnResized"
OnResizeEnded="OnResizeEnded"
Style="height: 340px;">
<Pane1>
<div class="p-4">Primary pane</div>
</Pane1>
<Pane2>
<div class="p-4">Secondary pane</div>
</Pane2>
</SplitView>
@code {
private void OnResizeStarted(SplitViewResizeEventArgs args)
{
}

private void OnResized(SplitViewResizeEventArgs args)
{
}

private void OnResizeEnded(SplitViewResizeEventArgs args)
{
}
}

See demo here. See demo here. See demo here.

Nested layouts

SplitView supports nested layouts, which is useful for editors, dashboards, and multi-pane administration tools.

<SplitView PrimaryPaneSize="28" Style="height: 460px;">
<Pane1>
<div class="p-4">Explorer</div>
</Pane1>
<Pane2>
<SplitView Orientation="SplitViewOrientation.Vertical"
PrimaryPaneSize="62"
Style="height: 100%;">
<Pane1>
<div class="p-4">Editor</div>
</Pane1>
<Pane2>
<div class="p-4">Preview</div>
</Pane2>
</SplitView>
</Pane2>
</SplitView>

See demo here.

App shell layout

You can combine multiple SplitView instances to build an app shell with navigation, content, and inspector panes.

See demo here.