Split Panel

Split two content areas and drag the divider to resize them.

Live preview
Interact with the component to see results here.
View code
HTML
<sy-split-panel
  type="horizontal"
  ratio="40"
  minratio="20"
  style="height:260px;width:100%"
>
  <div slot="left"
    style="height:100%;padding:20px;background:rgba(103,80,164,.06)"
  ><strong>List</strong>
    <p>Try resizing.</p>
  </div>
  <div slot="right"
    style="height:100%;padding:20px;background:rgba(103,80,164,.12)"
  ><strong>Details</strong>
    <p>You can also adjust the divider with the keyboard.</p>
  </div>
</sy-split-panel>

Usage guide

#

Use to view and resize two regions at once, such as an explorer and editor. Layout is better for a fixed sidebar.

  1. Place two regions

    Use the left and right slots, including for vertical splits. First ensure the parent has sufficient height.

  2. Set proportions and limits

    ratio is the percentage occupied by the left or top region. Set the minimum percentage on both sides with minRatio.

  3. Connect resize results

    Update the app's size state from the change event matching the direction.

Feature examples

#

Choose a feature from 8 topics. Explore property settings, method calls, event results, and slot layouts through live examples and code.

Usage examples · Overview

Try the selected example. Topics with multiple configurations let you switch between detailed examples.

View code
HTML
Loading the example.

Property · Disabled

See how settings change appearance and behavior.

View code
HTML
Loading the example.

Property · Hide Divider

See how settings change appearance and behavior.

View code
HTML
Loading the example.

Property · Min Ratio

See how settings change appearance and behavior.

View code
HTML
Loading the example.

Property · Ratio

See how settings change appearance and behavior.

View code
HTML
Loading the example.

Property · Type

See how settings change appearance and behavior.

View code
HTML
Loading the example.

Events · Horizontal Changed

Interact with the component to see event names and payloads in the live preview below.

View code
HTML
Loading the example.

Events · Vertical Changed

Interact with the component to see event names and payloads in the live preview below.

View code
HTML
Loading the example.

API reference

#

Hover over a name or focus it with the keyboard to see the code. On touch screens, tap the name.

<sy-split-panel>

Properties

Attribute / PropertyTypeDefaultDescription
booleanfalsePrevent dragging and keyboard adjustment of the divider.
booleanfalseHide the resize handle between panels.
number0Minimum percentage for each region. Valid range: 0–50.
number50Percentage occupied by the left or top region.
'horizontal' | 'vertical''horizontal'horizontal splits left and right; vertical splits top and bottom.

Events

EventDetailDescription
CustomEvent<{ leftRatio: number; rightRatio: number; }>Read the result from the event's detail.
CustomEvent<{ topRatio: number; bottomRatio: number; }>Read the result from the event's detail.

Slots

SlotDescription
Content displayed in the left area.
Content displayed in the right area.