logoAnt Design

⌘ K
  • Design
  • Development
  • Components
  • Blog
  • Resources
YouMindTRACTIANLobeHubCodeRabbit
6.4.5
  • Components Overview
  • Changelog
    v6.4.5
  • General
    • Button
    • FloatButton
    • Icon
    • Typography
  • Layout
    • Divider
    • Flex
    • Grid
    • Layout
    • Masonry
      6.0.0
    • Space
    • Splitter
  • Navigation
    • Anchor
    • Breadcrumb
    • Dropdown
    • Menu
    • Pagination
    • Steps
    • Tabs
  • Data Entry
    • AutoComplete
    • Cascader
    • Checkbox
    • ColorPicker
    • DatePicker
    • Form
    • Input
    • InputNumber
    • Mentions
    • Radio
    • Rate
    • Select
    • Slider
    • Switch
    • TimePicker
    • Transfer
    • TreeSelect
    • Upload
  • Data Display
    • Avatar
    • Badge
    • Calendar
    • Card
    • Carousel
    • Collapse
    • Descriptions
    • Empty
    • Image
    • List
      DEPRECATED
    • Popover
    • QRCode
    • Segmented
    • Statistic
    • Table
    • Tag
    • Timeline
    • Tooltip
    • Tour
    • Tree
  • Feedback
    • Alert
    • Drawer
    • Message
    • Modal
    • Notification
    • Popconfirm
    • Progress
    • Result
    • Skeleton
    • Spin
    • Watermark
  • Other
    • Affix
    • App
    • BorderBeam
      6.4.0
    • ConfigProvider
    • Util
When To Use
Examples
Basic
Control mode
Vertical
Collapsible
Control collapsible icons
Multiple panels
Complex combination
Lazy
Customize
Custom semantic dom styling
Double-clicked reset
API
Splitter
Panel
Semantic DOM
Design Token

Splitter

Resizable split panel layout
Importimport { Splitter } from 'antd';
GitHub
components/splitterIssueOpen issues
Docs
Edit this pageLLMs.md
SpaceAnchor

Resources

Ant Design X
Ant Design Charts
Ant Design Pro
Pro Components
Ant Design Mobile
Ant Design Mini
Ant Design Web3
Ant Design Landing-Landing Templates
Scaffolds-Scaffold Market
Umi-React Application Framework
dumi-Component doc generator
qiankun-Micro-Frontends Framework
Ant Motion-Motion Solution
China Mirror 🇨🇳

Community

Awesome Ant Design
Medium
X
yuque logoAnt Design in YuQue
Ant Design in Zhihu
Experience Cloud Blog
seeconf logoSEE Conf-Experience Tech Conference

Help

GitHub
Change Log
FAQ
For Agents
Bug Report
Issues
Discussions
StackOverflow
SegmentFault

Ant XTech logoMore Products

yuque logoYuQue-Document Collaboration Platform
AntV logoAntV-Data Visualization
Egg logoEgg-Enterprise Node.js Framework
Kitchen logoKitchen-Sketch Toolkit
Galacean logoGalacean-Interactive Graphics Solution
WeaveFox logoWeaveFox-AI Development with WeaveFox 🦊
xtech logoAnt Financial Experience Tech
Theme Editor
Made with ❤ by
Ant Group and Ant Design Community
loading

When To Use

Can be used to separate areas horizontally or vertically. When you need to freely drag and adjust the size of each area. When you need to specify the maximum and minimum width and height of an area.

Examples

API

Common props ref:Common props

The Splitter component needs to calculate the panel size through its child elements, so its child elements only support Splitter.Panel.

Splitter

PropertyDescriptionTypeDefaultVersionGlobal Config
classNamesCustomize class for each semantic structure inside the component. Supports object or function.Record<SemanticDOM, string> | (info: { props })=> Record<SemanticDOM, string>-6.0.06.0.0
collapsiblemotion to enable collapse animation, icon to customize collapse icons{ motion?: boolean; icon?: { start?: ReactNode; end?: ReactNode } }-6.4.0×
collapsibleIconcustom collapsible icon{start?: ReactNode; end?: ReactNode}-6.0.0×
destroyOnHiddenDestroy panel content when collapsed (size is 0). Applies to all panels, can be overridden per panelbooleanfalse6.4.0×
draggerIconcustom dragger iconReactNode-6.0.0×
layoutLayout directionhorizontal | verticalhorizontal-×
lazyLazy modebooleanfalse5.23.0×
onCollapseCallback when expanding or collapsing(collapsed: boolean[], sizes: number[]) => void-5.28.0×
orientationOrientation directionhorizontal | verticalhorizontal×
stylesCustomize inline style for each semantic structure inside the component. Supports object or function.Record<SemanticDOM, CSSProperties> | (info: { props })=> Record<SemanticDOM, CSSProperties>-6.0.06.0.0
verticalOrientation. Simultaneously existing with orientation, orientation takes prioritybooleanfalse×
onDraggerDoubleClickCallback triggered when the dragger is double-clicked(index: number) => void-6.3.0×
onResizePanel size change callback(sizes: number[]) => void--×
onResizeEndDrag end callback(sizes: number[]) => void--×
onResizeStartCallback before dragging starts(sizes: number[]) => void--×

Panel

PropertyDescriptionTypeDefaultVersion
collapsibleQuick foldingboolean | { start?: boolean; end?: boolean; showCollapsibleIcon?: boolean | 'auto' }falseshowCollapsibleIcon: 5.27.0
defaultSizeInitial panel size support number for px or 'percent%' usagenumber | string--
destroyOnHiddenDestroy panel content when collapsed (size is 0). Overrides Splitter's destroyOnHiddenboolean-6.4.0
maxMaximum threshold support number for px or 'percent%' usagenumber | string--
minMinimum threshold support number for px or 'percent%' usagenumber | string--
resizableWhether to enable drag and dropbooleantrue-
sizeControlled panel size support number for px or 'percent%' usagenumber | string--

Semantic DOM

Design Token

Component TokenHow to use?
Token NameDescriptionTypeDefault Value
splitBarDraggableSizeDrag and drop the identity element sizenumber20
splitBarSizeDrag the element display sizenumber2
splitTriggerSizeDrag and drop trigger area sizenumber6
Global TokenHow to use?
Token NameDescriptionTypeDefault Value
colorFillThe darkest fill color is used to distinguish between the second and third level of fill color, and is currently only used in the hover effect of Slider.stringrgba(0,0,0,0.15)
colorPrimaryBrand color is one of the most direct visual elements to reflect the characteristics and communication of the product. After you have selected the brand color, we will automatically generate a complete color palette and assign it effective design semantics.string#1677ff
colorTextDefault text color which comply with W3C standards, and this color is also the darkest neutral color.stringrgba(0,0,0,0.88)
borderRadiusXSXS size border radius, used in some small border radius components, such as Segmented, Arrow and other components with small border radius.number2
controlHeightSMSM component heightnumber24
controlItemBgActiveControl the background color of control component item when active.string#e6f4ff
controlItemBgActiveHoverControl the background color of control component item when hovering and active.string#bae0ff
controlItemBgHoverControl the background color of control component item when hovering.stringrgba(0,0,0,0.04)
fontFamilyThe font family of Ant Design prioritizes the default interface font of the system, and provides a set of alternative font libraries that are suitable for screen display to maintain the readability and readability of the font under different platforms and browsers, reflecting the friendly, stable and professional characteristics.string-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji'
fontSizeThe most widely used font size in the design system, from which the text gradient will be derived.number14
fontSizeSMSmall font sizenumber12
lineHeightLine height of text.number1.5714285714285714
motionDurationSlowMotion speed, slow speed. Used for large element animation interaction.string0.3s
motionEaseInOutPreset motion curve.string
Cubic Bezier Visualizer
cubic-bezier(0.645, 0.045, 0.355, 1)External Link Icon
zIndexPopupBaseBase zIndex of component like FloatButton, Affix which can be cover by large popupnumber1000
Basic

Initialize panel size, panel size limit.

CodeSandbox Icon
Hitu Icon
codepen icon
External Link Icon
Expand Icon
Control mode

Control the size of the splitter. When one of the panels disables resizable, dragging will be disabled.

CodeSandbox Icon
Hitu Icon
codepen icon
External Link Icon
Expand Icon
Vertical

Use vertical layout.

CodeSandbox Icon
Hitu Icon
codepen icon
External Link Icon
Expand Icon
Collapsible

Set collapsible to enable collapse. Can through min to limit dragging to expand when collapsed.

CodeSandbox Icon
Hitu Icon
codepen icon
External Link Icon
Expand Icon
Control collapsible icons

Set collapsible.showCollapsibleIcon to control the display mode of collapsible icons.

CodeSandbox Icon
Hitu Icon
codepen icon
External Link Icon
Expand Icon
5.27.0
Multiple panels

Multiple panels.

CodeSandbox Icon
Hitu Icon
codepen icon
External Link Icon
Expand Icon
Complex combination

Complex combination panel, quick folding, prohibited from changing size

CodeSandbox Icon
Hitu Icon
codepen icon
External Link Icon
Expand Icon
Lazy

Lazy mode, dragging does not update the size immediately, but updates when released.

CodeSandbox Icon
Hitu Icon
codepen icon
External Link Icon
Expand Icon
5.23.0
Customize

customize handle elements and style

CodeSandbox Icon
Hitu Icon
codepen icon
External Link Icon
Expand Icon
6.0.0
Custom semantic dom styling

You can customize the semantic dom style of Splitter by passing objects/functions through classNames and styles.

CodeSandbox Icon
Hitu Icon
codepen icon
External Link Icon
Expand Icon
6.0.0
Double-clicked reset

Double-click the dragger to reset the Splitter.Panel to its default size.

CodeSandbox Icon
Hitu Icon
codepen icon
External Link Icon
Expand Icon
6.3.0
First
Second
First
Second
First
Second
First
Second
First
Second

ShowCollapsibleIcon:

First
Second
Third
Panel 1
Panel 2
Panel 3
Left
Top
Bottom
First
Second
First
Second
Panel 1
Panel 2
Panel 3
First
Second
First
Second
First
Second
Panel 1
Panel 2
Panel 3
First
Second
  • root
    6.0.0
    Root element with flex layout, width and height, alignment and stretch styles
  • panel
    6.0.0
    Panel element with flex basis, grow ratio and panel container styles
  • dragger
    6.0.0
    Drag control element with absolute positioning, user selection, z-index, center alignment, background color, hover and active states styles