@gfazioli/mantine-split-pane
v2.7.1
Published
A React component that manages split panes allows users to divide and resize content areas within a layout efficiently.
Maintainers
Readme
Mantine Split Pane Component
❤️ If this component has been useful to you or your team, please consider becoming a sponsor
Overview
This component is created on top of the Mantine library.
Mantine Split extension for building flexible, resizable layouts composed of multiple panes. In v2, the architecture separates pane content (Split.Pane) from the resizing control (Split.Resizer), making the resizer a first-class, customizable element placed between panes.
Developers can define initial sizes in pixels or percentages, enforce min/max constraints, and use the grow property to let specific panes expand to fill available space. Orientation supports horizontal and vertical layouts, including responsive breakpoints, while the resizer can inherit global props from Split or be configured per instance, including a gradient variant with hover styles.
The component exposes resize lifecycle events on both the pane and resizer—delivering current width/height for one or both adjacent panes—enabling persistence of layouts via localStorage and real‑time UI feedback. Accessibility is built in: the resizer is focusable and supports keyboard resizing with configurable step and shiftStep values. Overall, it offers a clear JSX structure and a robust API for multi‑pane, highly controllable split views in Mantine applications.
[!note]
→ Demo and Documentation → Youtube Video → More Mantine Components
Installation
npm install @gfazioli/mantine-split-paneor
yarn add @gfazioli/mantine-split-paneAfter installation import package styles at the root of your application:
import '@gfazioli/mantine-split-pane/styles.css';Usage
import { Split } from '@gfazioli/mantine-split-pane';
import { Paper } from '@mantine/core';
function Demo() {
return (
<Split>
<Split.Pane>
<Paper withBorder w="100%" mih="100%">
<h1>Pane 1</h1>
</Paper>
</Split.Pane>
<Split.Resizer />
<Split.Pane>
<Paper withBorder>
<h1>Pane 2</h1>
</Paper>
</Split.Pane>
</Split>
);
}Auto Resizers
Starting from version 2.6, you can use the autoResizers prop to automatically insert resizers between panes:
import { Split } from '@gfazioli/mantine-split-pane';
import { Paper } from '@mantine/core';
function Demo() {
return (
<Split autoResizers>
<Split.Pane>
<Paper withBorder w="100%" mih="100%">
<h1>Pane 1</h1>
</Paper>
</Split.Pane>
<Split.Pane>
<Paper withBorder>
<h1>Pane 2</h1>
</Paper>
</Split.Pane>
<Split.Pane>
<Paper withBorder>
<h1>Pane 3</h1>
</Paper>
</Split.Pane>
</Split>
);
}Dynamic Panes
You can also use Split.Dynamic to create panes from a configuration array:
import { Split, PaneConfig } from '@gfazioli/mantine-split-pane';
import { Paper } from '@mantine/core';
function Demo() {
const panes: PaneConfig[] = [
{
id: 'sidebar',
initialWidth: 200,
minWidth: 150,
content: (
<Paper withBorder w="100%" h="100%">
<h1>Sidebar</h1>
</Paper>
),
},
{
id: 'main',
grow: true,
content: (
<Paper withBorder w="100%" h="100%">
<h1>Main Content</h1>
</Paper>
),
},
];
return (
<Split>
{Split.Dynamic({ panes })}
</Split>
);
}Sponsor
❤️ If this component has been useful to you or your team, please consider becoming a sponsor
Your support helps me:
- Keep the project actively maintained with timely bug fixes and security updates
- Add new features, improve performance, and refine the developer experience
- Expand test coverage and documentation for smoother adoption
- Ensure long‑term sustainability without relying on ad hoc free time
- Prioritize community requests and roadmap items that matter most
Open source thrives when those who benefit can give back—even a small monthly contribution makes a real difference. Sponsorships help cover maintenance time, infrastructure, and the countless invisible tasks that keep a project healthy.
Your help truly matters.
💚 Become a sponsor today and help me keep this project reliable, up‑to‑date, and growing for everyone.
https://github.com/user-attachments/assets/2e45af2b-60c7-4cb3-9b9a-6cf0e710af1c
