Skip to content

Splitter

Resizable panels with handles between them, following the WAI-ARIA Window Splitter pattern: every handle is a focusable separator you drag or move with the keyboard. Sizes are percentages you can bind, constrain, collapse, nest and save.

Styled with CSS Tailwind

Two panels

Each BitBhSplitterHandle is a role="separator" with aria-valuenow - the size in percent of the panel before it, which it names in aria-controls - and the range it can give that panel in aria-valuemin / aria-valuemax. Drag it, or focus it and press ← / → (5 points; Shift: 20), Home / End. The panels get flex: <size> 1 0px inline, so the handle's own width doesn't count: this one draws a 1px line and a grip inside a 24px hit area that overlaps the panels.

Navigation

At least 20%.

Content

At least 30%.

Sizes: 30% / 70%

Three panels, collapsible

MinSize and MaxSize bound a panel; when a resize reaches a panel's minimum, the next panel gives way. A Collapsible panel collapses to its CollapsedSize when dragged past half its minimum, with Home, with a second arrow step at its minimum, or with Enter on a handle next to it - and Enter again restores it. A panel collapsed to nothing is inert; style it with [data-collapsed] / data-state="collapsed", and follow it with OnCollapsedChange.

Explorer

Collapsible, at least 15%.

Editor

At least 30%.

Outline

Collapsible, 12% to 35%.

Explorer: open · Outline: open

Vertical and nested

Orientation="BitBhOrientation.Vertical" stacks the panels: the handle is a horizontal bar (aria-orientation="horizontal") moved with ↑ / ↓. A splitter nests in a panel of another; each handle belongs to its own splitter. In a right-to-left page (Dir or a BitBhDirectionProvider) the first panel is on the right and ← / → mirror.

Files

Program.cs, App.razor, appsettings.json

Editor

Press ↑ / ↓ on the bar below.

Terminal

dotnet watch

Bound, saved and driven from code

@bind-Sizes takes one percentage per panel; OnSizesCommit fires once a drag ends or a key resizes - the place to save. AutoSaveId saves the layout in localStorage on every commit and restores it when the page comes back (resize, then reload). Panels also take commands: CollapseAsync, ExpandAsync and ResizeAsync.

Sidebar

Document

Preview

Sizes: 25% / 50% / 25% · Commits: 0

An unhandled error has occurred. Reload 🗙