From 700bdbf36154f525b8285300345a2679afef958e Mon Sep 17 00:00:00 2001 From: TomJGooding <101601846+TomJGooding@users.noreply.github.com> Date: Mon, 6 Oct 2025 16:32:04 +0100 Subject: [PATCH] docs(containers): add summary of container types Add a summary of the different container types to the [containers API reference](https://textual.textualize.io/api/containers/). I spotted this documentation is now out-of-date where it states that: > With the exception of Center and Middle containers will fill all of the space in the parent widget. Rather than simply adding other widgets like `VerticalGroup` and `HorizontalGroup` to this list, a summary of the different container types (copied from the How-To guide) might be more helpful. --- src/textual/containers.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/textual/containers.py b/src/textual/containers.py index 4478901d35..839ec795f8 100644 --- a/src/textual/containers.py +++ b/src/textual/containers.py @@ -1,8 +1,10 @@ """ Container widgets for quick styling. -With the exception of `Center` and `Middle` containers will fill all of the space in the parent widget. - +- [`Horizontal`][textual.containers.Horizontal] and [`Vertical`][textual.containers.Vertical] containers stretch to fill available space. +- [`HorizontalGroup`][textual.containers.HorizontalGroup] and [`VerticalGroup`][textual.containers.VerticalGroup] fit to the height of their contents. +- [`HorizontalScroll`][textual.containers.HorizontalScroll] and [`VerticalScroll`][textual.containers.VerticalScroll] add automatic scrollbars. +- [`Center`][textual.containers.Center], [`Right`][textual.containers.Right], and [`Middle`][textual.containers.Middle] set alignment. """ from __future__ import annotations