Syncfusion React Splitter

syncfusion/react-ui-components-skills/skills/syncfusion-react-splitter

作者 syncfusion6fb1c883a8412b611b95f839e0cb06e1fc8170a8無授權條款收錄於 2026年10月9日更新於 2026年10月9日

Implement Syncfusion React Splitter component for flexible, resizable panel layouts. Guide covers layout configuration, pane sizing, collapse/expand, resize events, content types, accessibility, and RTL support. Use this skill when building multi-panel interfaces with dynamic resizing capabilities.

AI 產生的概覽

指導實作 Syncfusion React Splitter 元件,用於可調整大小、可摺疊的多面板版面配置。

功能
此技能提供實作 Syncfusion React Splitter 元件的說明與參考資料,用於建構可調整大小的面板版面。內容涵蓋安裝、版面方向、面板尺寸與限制、展開/摺疊行為、調整大小事件、面板內容類型、無障礙支援、RTL 支援以及樣式自訂。它產出的是指引與程式碼範例,而非執行指令碼。
適用情境
適用於建構具備動態調整大小功能的多面板 React 介面,例如程式碼編輯器、儀表板、檔案總管、聊天版面或電子郵件用戶端。適合需要可摺疊面板、巢狀分隔器或可設定面板尺寸的開發者。
執行需求
需要一個 React 專案,並透過 npm 安裝 @syncfusion/ej2-react-layouts 套件,同時匯入 CSS/佈景主題。此技能不隨附指令碼,僅包含說明與參考文件。

Implementing Syncfusion React Splitter

The Splitter component creates flexible, resizable panel layouts with advanced configuration options. This skill guides you through installation, layout patterns, customization, and accessibility features.

When to Use This Skill

Use the Splitter component when you need to:

  • Create flexible layouts with multiple resizable panels
  • Build split-screen interfaces (code editors, dashboards, file explorers)
  • Allow users to adjust pane sizes dynamically
  • Display collapsible panes with expand/collapse functionality
  • Support different layout orientations (horizontal, vertical, nested)
  • Implement responsive multi-panel layouts
  • Add custom content types (HTML, components, selectors) to panes

Component Overview

SplitterComponent provides a container for multiple panes that users can resize by dragging separators. Each pane is defined with <PaneDirective> within <PanesDirective>.

Key Features:

  • Multiple layout orientations (horizontal, vertical, nested)
  • Dynamic pane resizing with constraints
  • Expand/collapse pane functionality
  • Multiple content types (HTML, components, CSS selectors)
  • Events for resize, expand, collapse operations
  • Add/remove panes dynamically at runtime
  • Accessibility and RTL support
  • Theme customization

Installation: npm install @syncfusion/ej2-react-layouts --save

Documentation and Navigation Guide

Getting Started

📄 Read: references/getting-started.md [blocked]

  • Installation and package setup
  • CSS imports and theme configuration
  • Basic Splitter initialization with PanesDirective
  • First working example
  • Import statements and dependencies

API Reference: Properties and Configuration

📄 Read: references/properties-and-configuration.md [blocked]

  • Complete SplitterComponent properties (orientation, height, width, separatorSize, etc.)
  • All PaneDirective properties (size, min, max, collapsed, collapsible, resizable, content, cssClass)
  • enablePersistence for state persistence
  • enableHtmlSanitizer for security
  • Common configuration patterns and examples

API Reference: Methods

📄 Read: references/methods-reference.md [blocked]

  • addPane() - Dynamically add new panes with PanePropertiesModel
  • removePane() - Remove panes by index
  • collapse() - Programmatically collapse panes
  • expand() - Programmatically expand panes
  • destroy() - Component cleanup and resource release
  • Real-world examples with working code

API Reference: Events

📄 Read: references/events-reference.md [blocked]

  • created - Component initialization
  • beforeCollapse / collapsed - Collapse events with cancellation
  • beforeExpand / expanded - Expand events with data loading
  • resizeStart / resizing / resizeStop - Resize lifecycle
  • Event handling patterns and state management

Pane Layout Configuration

📄 Read: references/pane-layout-configuration.md [blocked]

  • Horizontal and vertical layouts
  • Multiple panes and nested splitters
  • Pane properties and configuration
  • Layout patterns for common use cases

Pane Sizing and Separation

📄 Read: references/pane-sizing-and-separation.md [blocked]

  • Fixed pane sizing
  • Percentage-based sizing
  • Min and max size constraints
  • Separator styling and customization
  • Dynamic size adjustments

Expand and Collapse Functionality

📄 Read: references/expand-collapse-functionality.md [blocked]

  • Collapsed state initialization
  • Button integration for expand/collapse
  • User-driven vs programmatic collapse
  • Event handling patterns

Resize Behavior

📄 Read: references/resize-behavior.md [blocked]

  • Resize events and lifecycle
  • Preventing resize on specific panes
  • Dynamic resize configuration
  • Resize constraints and validation
  • Event data and handling

Pane Content and Styling

📄 Read: references/pane-content-and-styling.md [blocked]

  • HTML content in panes
  • React component content in panes
  • CSS selector-based content
  • Pane template usage
  • Custom styling and classes

Accessibility and Globalization

📄 Read: references/accessibility-and-globalization.md [blocked]

  • WCAG compliance and keyboard navigation
  • ARIA attributes and screen reader support
  • RTL (Right-to-Left) support
  • Internationalization and locale
  • Focus management and accessibility patterns

Style Customization

📄 Read: references/style-customization.md [blocked]

  • CSS customization and custom classes
  • Theme variables and CSS imports
  • Gripper and separator styling
  • Responsive design patterns
  • Dark mode and theme switching

Quick Start Example

tsx
import { PaneDirective, PanesDirective, SplitterComponent } from '@syncfusion/ej2-react-layouts';import * as React from "react";import './App.css';
function App() {  return (    <div className='App'>      <SplitterComponent>        <PanesDirective>          <PaneDirective size='200px'>            <div>Left Panel</div>          </PaneDirective>          <PaneDirective size='300px'>            <div>Right Panel</div>          </PaneDirective>        </PanesDirective>      </SplitterComponent>    </div>  );}
export default App;

Common Patterns

Two-Column Layout

tsx
<SplitterComponent orientation='Horizontal'>  <PanesDirective>    <PaneDirective size='25%'><div>Left</div></PaneDirective>    <PaneDirective size='75%'><div>Main Content</div></PaneDirective>  </PanesDirective></SplitterComponent>

Vertical Split with Collapse

tsx
<SplitterComponent orientation='Vertical'>  <PanesDirective>    <PaneDirective size='50%' collapsed={true}><div>Top</div></PaneDirective>    <PaneDirective size='50%'><div>Bottom</div></PaneDirective>  </PanesDirective></SplitterComponent>

Three-Panel Dashboard

tsx
<SplitterComponent orientation='Horizontal'>  <PanesDirective>    <PaneDirective size='20%'><div>Sidebar</div></PaneDirective>    <PaneDirective size='60%'><div>Main Content</div></PaneDirective>    <PaneDirective size='20%'><div>Right Panel</div></PaneDirective>  </PanesDirective></SplitterComponent>

Nested Splitters

Combine horizontal and vertical splitters for complex layouts like code editors with file explorer, editor, and console panels.

Key Props

PropTypeDescriptionWhen to Use
orientation'Horizontal' | 'Vertical'Layout directionWhen configuring panel direction
sizestring (PaneDirective)Pane width/height (px, %)When setting pane dimensions
minstring (PaneDirective)Minimum pane sizeWhen preventing pane from shrinking too small
maxstring (PaneDirective)Maximum pane sizeWhen limiting pane expansion
collapsedboolean (PaneDirective)Initial collapsed stateWhen panes should start hidden
collapsibleboolean (PaneDirective)Allow user to collapseWhen collapsing should be user-driven
resizableboolean (PaneDirective)Allow user to resizeWhen preventing manual resizing

Common Use Cases

File Explorer + Editor: Left sidebar (fixed 250px) with collapsible file tree, main editor area with resizing

Dashboard: Top bar (fixed height), left sidebar (collapsible nav), main content, right details panel

Chat Interface: Left contact list (fixed width), chat area (resizable), right info panel

Code Editor: Left explorer (collapsible), center editor (main), bottom console (collapsible)

Email Client: Left folders (fixed), center list (resizable), right preview (resizable)

來源與署名

來源:syncfusion/react-ui-components-skills位於skills/syncfusion-react-splitter提交6fb1c88

授權條款: 無授權條款

內容歸原作者所有。SourceWeft 從公開儲存庫中收錄這些內容。

檢舉或申請下架