@gfazioli/mantine-split-pane 4.0.4 → 4.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +57 -11
- package/package.json +12 -7
package/README.md
CHANGED
|
@@ -17,26 +17,37 @@
|
|
|
17
17
|
|
|
18
18
|
## Overview
|
|
19
19
|
|
|
20
|
+
A Mantine 9 React component for resizable split pane layouts with 7 resizer variants, context-based prop inheritance, responsive orientation, and dynamic pane generation.
|
|
21
|
+
|
|
20
22
|
This component is created on top of the [Mantine](https://mantine.dev/) library.
|
|
21
23
|
It requires **Mantine 9.x** and **React 19**.
|
|
22
24
|
|
|
23
|
-
|
|
24
|
-
[Mantine Split](https://gfazioli.github.io/mantine-split-pane/) 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.
|
|
25
|
-
|
|
26
|
-
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.
|
|
27
|
-
|
|
28
|
-
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.
|
|
29
|
-
|
|
30
25
|
> [!note]
|
|
31
26
|
>
|
|
32
27
|
> → [Demo and Documentation](https://gfazioli.github.io/mantine-split-pane/) → [Youtube Video](https://www.youtube.com/playlist?list=PL85tTROKkZrWyqCcmNCdWajpx05-cTal4) → [More Mantine Components](https://mantine-extensions.vercel.app/)
|
|
33
28
|
|
|
29
|
+
## Features
|
|
30
|
+
|
|
31
|
+
- Separate `Split.Pane` (content) and `Split.Resizer` (drag handle) architecture
|
|
32
|
+
- 7 resizer variants: `default`, `filled`, `outline`, `transparent`, `gradient`, `dotted`, `dashed`
|
|
33
|
+
- Initial sizes in pixels or percentages with min/max constraints
|
|
34
|
+
- `grow` property to let specific panes expand to fill available space
|
|
35
|
+
- Horizontal and vertical orientation, including responsive breakpoints
|
|
36
|
+
- Context-based prop inheritance: resizer props set on `Split` cascade to all children
|
|
37
|
+
- Per-resizer overrides for full control
|
|
38
|
+
- Snap points for common pane sizes during drag and keyboard resizing
|
|
39
|
+
- `autoResizers` mode to automatically insert resizers between panes
|
|
40
|
+
- `Split.Dynamic` helper to generate panes from a configuration array
|
|
41
|
+
- Resize lifecycle events (`onResizeStart`, `onResizing`, `onResizeEnd`) on both pane and resizer
|
|
42
|
+
- Keyboard accessible: focusable resizer with configurable `step` and `shiftStep`
|
|
43
|
+
- Container resize tracking with drag ratio preservation
|
|
44
|
+
|
|
34
45
|
## Installation
|
|
35
46
|
|
|
36
47
|
```sh
|
|
37
48
|
npm install @gfazioli/mantine-split-pane
|
|
38
49
|
```
|
|
39
|
-
or
|
|
50
|
+
or
|
|
40
51
|
|
|
41
52
|
```sh
|
|
42
53
|
yarn add @gfazioli/mantine-split-pane
|
|
@@ -77,7 +88,7 @@ function Demo() {
|
|
|
77
88
|
|
|
78
89
|
### Auto Resizers
|
|
79
90
|
|
|
80
|
-
|
|
91
|
+
Use the `autoResizers` prop to automatically insert resizers between panes:
|
|
81
92
|
|
|
82
93
|
```tsx
|
|
83
94
|
import { Split } from '@gfazioli/mantine-split-pane';
|
|
@@ -108,6 +119,41 @@ function Demo() {
|
|
|
108
119
|
}
|
|
109
120
|
```
|
|
110
121
|
|
|
122
|
+
### Snap Points
|
|
123
|
+
|
|
124
|
+
Use `snapPoints` and `snapTolerance` to snap a resizer to common pane sizes in pixels while dragging or using the keyboard:
|
|
125
|
+
|
|
126
|
+
```tsx
|
|
127
|
+
import { Split } from '@gfazioli/mantine-split-pane';
|
|
128
|
+
import { Paper } from '@mantine/core';
|
|
129
|
+
|
|
130
|
+
function Demo() {
|
|
131
|
+
return (
|
|
132
|
+
<Split autoResizers snapPoints={[200, 400, 600]} snapTolerance={20}>
|
|
133
|
+
<Split.Pane initialWidth={240}>
|
|
134
|
+
<Paper withBorder w="100%" mih="100%">
|
|
135
|
+
<h1>Pane 1</h1>
|
|
136
|
+
</Paper>
|
|
137
|
+
</Split.Pane>
|
|
138
|
+
|
|
139
|
+
<Split.Pane initialWidth={320}>
|
|
140
|
+
<Paper withBorder w="100%" mih="100%">
|
|
141
|
+
<h1>Pane 2</h1>
|
|
142
|
+
</Paper>
|
|
143
|
+
</Split.Pane>
|
|
144
|
+
|
|
145
|
+
<Split.Pane grow>
|
|
146
|
+
<Paper withBorder w="100%" mih="100%">
|
|
147
|
+
<h1>Pane 3</h1>
|
|
148
|
+
</Paper>
|
|
149
|
+
</Split.Pane>
|
|
150
|
+
</Split>
|
|
151
|
+
);
|
|
152
|
+
}
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
`snapPoints` and `snapTolerance` are also available on `Split.Resizer` for per-divider overrides. With `autoResizers`, the generated resizers inherit these values from `Split`.
|
|
156
|
+
|
|
111
157
|
### Dynamic Panes
|
|
112
158
|
|
|
113
159
|
You can also use `Split.Dynamic` to create panes from a configuration array:
|
|
@@ -160,14 +206,14 @@ Your support helps me:
|
|
|
160
206
|
- Keep the project actively maintained with timely bug fixes and security updates
|
|
161
207
|
- Add new features, improve performance, and refine the developer experience
|
|
162
208
|
- Expand test coverage and documentation for smoother adoption
|
|
163
|
-
- Ensure long
|
|
209
|
+
- Ensure long-term sustainability without relying on ad hoc free time
|
|
164
210
|
- Prioritize community requests and roadmap items that matter most
|
|
165
211
|
|
|
166
212
|
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.
|
|
167
213
|
|
|
168
214
|
Your help truly matters.
|
|
169
215
|
|
|
170
|
-
💚 [Become a sponsor](https://github.com/sponsors/gfazioli?o=esc) today and help me keep this project reliable, up
|
|
216
|
+
💚 [Become a sponsor](https://github.com/sponsors/gfazioli?o=esc) today and help me keep this project reliable, up-to-date, and growing for everyone.
|
|
171
217
|
|
|
172
218
|
---
|
|
173
219
|
https://github.com/user-attachments/assets/2e45af2b-60c7-4cb3-9b9a-6cf0e710af1c
|
package/package.json
CHANGED
|
@@ -1,20 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gfazioli/mantine-split-pane",
|
|
3
|
-
"version": "4.0.
|
|
4
|
-
"description": "A React component
|
|
3
|
+
"version": "4.0.6",
|
|
4
|
+
"description": "A Mantine 9 React component for resizable split pane layouts with 7 resizer variants, context-based prop inheritance, responsive orientation, and dynamic pane generation.",
|
|
5
5
|
"homepage": "https://gfazioli.github.io/mantine-split-pane/",
|
|
6
|
-
"packageManager": "yarn@4.0
|
|
6
|
+
"packageManager": "yarn@4.13.0",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"author": "Giovambattista Fazioli <giovambattista.fazioli@gmail.com>",
|
|
9
9
|
"keywords": [
|
|
10
|
-
"extension",
|
|
11
10
|
"mantine",
|
|
12
|
-
"
|
|
11
|
+
"mantine-ui",
|
|
12
|
+
"mantine-v9",
|
|
13
13
|
"react",
|
|
14
14
|
"react-component",
|
|
15
|
-
"
|
|
15
|
+
"typescript",
|
|
16
|
+
"extension",
|
|
17
|
+
"component",
|
|
16
18
|
"split",
|
|
17
|
-
"
|
|
19
|
+
"pane",
|
|
20
|
+
"resizer",
|
|
21
|
+
"split-pane",
|
|
22
|
+
"resizable"
|
|
18
23
|
],
|
|
19
24
|
"main": "./dist/cjs/index.cjs",
|
|
20
25
|
"module": "./dist/esm/index.mjs",
|