Splitter

Splitter with collapsible panels, drag handle, and smooth animations.

Build with ScrollX AI

Describe your website idea and let AI generate a layout.

Your Website Preview

Once you generate, the website preview will appear here.

loading..

Installation

npx shadcn@latest add https://scrollxui.dev/registry/splitter.json 

Usage

import { Splitter, SplitterPanel } from "@/components/ui/splitter";
<Splitter>
  <SplitterPanel className="bg-muted/40 border-r">
  </SplitterPanel>
  <SplitterPanel className="bg-background flex items-center justify-center">
  </SplitterPanel>
</Splitter>

API Reference

Splitter

Splitter with collapsible panels, drag handle, and smooth animations.

Props

PropertyTypeDefaultDescription
childrenReactNoderequired
Two SplitterPanel components and optionally a SplitterHandle.
onResize(leftSize: number, rightSize: number) => voidundefined
Callback fired when panels are resized, returns left and right widths in %.
allowFullCollapsebooleantrue
Allow panels to collapse completely to 0% or 100%.
minSizenumber0
Minimum percentage width of the left panel.
maxSizenumber100
Maximum percentage width of the left panel.
defaultSizenumber50
Initial percentage width of the left panel.
snapThresholdnumber5
Percentage threshold to snap panels fully collapsed.
smoothTransitionbooleantrue
Enable smooth animated transitions when resizing.
classNamestring-
Additional CSS classes for styling the root Splitter.
styleReact.CSSProperties-
Inline styles applied to the root Splitter.

Built withby Ahdeetai.