@fragiola/splitter · React · Vue · Angular
Resizable split views, without a single line of CSS from us.
Panels side by side or stacked, resized by pointer, keyboard or code, collapsible and nested, with a typed model and a JSON layout. It ships the behaviour and the accessibility. Every pixel is yours.
What it ships
Behaviour and accessibility, nothing to restyle
Three primitives over a framework-free core: everything that is not rendering lives in the core.
Resizing
Pointer drags with pointer capture (mouse, touch and pen), the Window Splitter keys, a double click to reset, and commands from code.
Constraints in any unit
Minimums, maximums and defaults in
%,px,em,rem,vhorvw, and panels that keep their pixels when the group resizes.Collapsing
Panels that snap shut past a threshold, come back at the size they had, and expose
data-collapsedfor their content.Nested groups
Groups inside panels share one model: one JSON document saves the whole layout, and every part has a path.
A typed model
Every change is a command with a JSON Schema, which middleware can veto or rewrite and an assistant can call.
RTL and server rendering
Right-to-left is a mirror, and the server HTML already has every panel's size.
What stays yours
What it never ships
CSSCursorsIconsTextA design system
The state is exposed as data-* attributes and ARIA, so any styling works: Tailwind, plain CSS,
CSS modules, CSS-in-JS. The examples use Fragiola UI and its palettes.
Start
Three primitives
import { Splitter } from "@fragiola/splitter-react";
export function Editor() {
return (
<Splitter.Group className="h-96">
<Splitter.Panel id="files" defaultSize="25%" minSize="10%" collapsible>
…
</Splitter.Panel>
<Splitter.Separator aria-label="Resize files" className="w-1.5 bg-gray-200" />
<Splitter.Panel id="editor">…</Splitter.Panel>
</Splitter.Group>
);
}