Skip to content

Feature: draggable split container (resizable panes with a drag gutter) #6716

Closed

Description

@thunderballfists

Summary

A built-in draggable split container (resizable panes with a drag gutter between children), for master-detail and multi-pane layouts.

Motivation

Split panes are one of the most common TUI layouts (file managers, editors, dashboards, master-detail consoles). Today Horizontal/Vertical + CSS width/height gives a fixed or proportional split, but there's no first-class way to let the user drag the border between two panes to resize them, nor a keyboard-resizable equivalent.

Concretely: I'm building a master-detail app — a left list rail and a right detail pane — and users expect to drag the divider to rebalance them. Right now that means a reactive width on one pane plus a thin separator widget that handles MouseDown/MouseMove/MouseUp with manual min/max clamping. It works, but it's boilerplate every split-pane app re-implements, and getting the drag hit-testing/clamping right is fiddly.

Suggested API (sketch)

with SplitContainer(orientation="horizontal", initial=("30%", "70%"),
                    min_sizes=(16, 20)):
    yield LeftRail()
    yield DetailPane()
  • Draggable gutter between children (mouse), and keyboard-resizable when the gutter/container is focused.
  • Queryable/persistable split ratio, so apps can save and restore layout.
  • A SplitContainer.Resized message when the split changes.
  • Respect per-child min_sizes (and optionally max).

Alternatives considered

  • Horizontal + reactive width + a custom separator widget handling mouse events — the current workaround; ~40 lines and easy to get subtly wrong.
  • Community splitters exist but there's no official, supported widget.

Happy to help test a design against a real master-detail app if useful.

Activity

  1. github-actions commented on Sep 18, 2026

    @github-actions

    Thank you for your issue. Give us a little time to review it.

    PS. You might want to check the FAQ if you haven't done so already.

    This project is developed and maintained by Will McGugan. Consider sponsoring Will's work on this project (and others).

    This is an automated reply, generated by FAQtory

  2. thunderballfists commented on Sep 18, 2026

    @thunderballfists
    Author

    Retracting — filed in error; will track this in our own project instead. Apologies for the noise.

  3. github-actions commented on Sep 18, 2026

    @github-actions

    I hope I solved your issue!

    Consider sponsoring my work to continue to maintain and develop Textual.

    • Will McGugan
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions