A shadcn-style splitter component built with Ark UI primitives.

Panel A

Panel B

Installation

npx shadcn@latest add @ark-cn/splitter

Usage

import * as Splitter from "@/components/ui/splitter"

Read exported parts in src/components/ui/splitter.tsx and compose the primitive according to the Ark UI pattern for this component.

Examples

Vertical

Top

Bottom

Collapsible panels

Collapsible sidebar

Content

Multiple panels

Nav

Main

Aside (collapsible)

Nested

Left

Right · Top

Right · Bottom

Context

Dragging: false

Sizes: 50 / 50

SplitterContext exposes the API (e.g. dragging + getSizes()) under the Root.

API reference

This component mirrors the upstream Ark UI primitive. All props and DOM behavior are defined by Ark unless you see an ark-cn-only row below.

SplitterResizeTrigger

PropTypeDescription
withHandle?booleanRenders a centered indicator handle.
indicatorClassName?stringClass on the indicator when withHandle is true.

See the ARK UI documentation for the full API.

Accessibility

See the Ark UI documentation for clarification.