Skip to content

Commit 7741b98

Browse files
committed
Enhance mobile support: responsive layouts, touch-friendly dividers, and improved accessibility adjustments across examples.
1 parent da39150 commit 7741b98

4 files changed

Lines changed: 21 additions & 17 deletions

File tree

examples/BasicExample.tsx

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,13 @@ export function BasicExample() {
4343
</div>
4444
<div className="example-content">
4545
<SplitPane direction={direction}>
46-
<Pane minSize={80} defaultSize={direction === 'vertical' ? '40%' : '30%'}>
46+
<Pane
47+
minSize={80}
48+
defaultSize={direction === 'vertical' ? '40%' : '30%'}
49+
>
4750
<div className="pane-content sidebar">
4851
<h2>Sidebar</h2>
49-
<p>
50-
Min size: 80px. Drag the divider to resize.
51-
</p>
52+
<p>Min size: 80px. Drag the divider to resize.</p>
5253
<div className="file-tree">
5354
<div className="file-tree-item folder">src</div>
5455
<div
@@ -71,9 +72,7 @@ export function BasicExample() {
7172
<Pane minSize={100}>
7273
<div className="pane-content editor">
7374
<h2>Main Content</h2>
74-
<p>
75-
Use arrow keys when focused for keyboard control.
76-
</p>
75+
<p>Use arrow keys when focused for keyboard control.</p>
7776
<div className="code-block">
7877
<code>
7978
{`import { SplitPane, Pane } from 'react-split-pane';

examples/NestedExample.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@ export function NestedExample() {
1212
<div className="example-container">
1313
<div className="example-info">
1414
<h2>Nested Split Panes</h2>
15-
<p>
16-
Create complex layouts by nesting split panes. IDE-style layout.
17-
</p>
15+
<p>Create complex layouts by nesting split panes. IDE-style layout.</p>
1816
</div>
1917
<div className="example-content">
2018
<SplitPane direction={isMobile ? 'vertical' : 'horizontal'}>

examples/TouchExample.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ import { SplitPane, Pane } from '../src';
44
export function TouchExample() {
55
const [resizeSource, setResizeSource] = useState<string | null>(null);
66
const [sizes, setSizes] = useState<number[]>([]);
7-
const [direction, setDirection] = useState<'horizontal' | 'vertical'>('horizontal');
7+
const [direction, setDirection] = useState<'horizontal' | 'vertical'>(
8+
'horizontal'
9+
);
810

911
// Use vertical layout on mobile for better touch experience
1012
useEffect(() => {
@@ -18,12 +20,11 @@ export function TouchExample() {
1820
<div className="example-container">
1921
<div className="example-info">
2022
<h2>Touch Support</h2>
21-
<p>
22-
Full touch support for mobile. Drag the divider with your finger!
23-
</p>
23+
<p>Full touch support for mobile. Drag the divider with your finger!</p>
2424
{resizeSource && (
2525
<p className="size-display">
26-
Via: <strong className={`source-${resizeSource}`}>{resizeSource}</strong>
26+
Via:{' '}
27+
<strong className={`source-${resizeSource}`}>{resizeSource}</strong>
2728
{sizes.length > 0 && (
2829
<span> | {sizes.map((s) => Math.round(s)).join('/')}px</span>
2930
)}

examples/index.html

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,15 @@
22
<html lang="en">
33
<head>
44
<meta charset="UTF-8" />
5-
<meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover, user-scalable=no" />
5+
<meta
6+
name="viewport"
7+
content="width=device-width, initial-scale=1.0, viewport-fit=cover, user-scalable=no"
8+
/>
69
<meta name="apple-mobile-web-app-capable" content="yes" />
7-
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
10+
<meta
11+
name="apple-mobile-web-app-status-bar-style"
12+
content="black-translucent"
13+
/>
814
<meta name="theme-color" content="#1a1a2e" />
915
<title>React Split Pane Examples</title>
1016
</head>

0 commit comments

Comments
 (0)