File tree Expand file tree Collapse file tree 12 files changed +496
-0
lines changed Expand file tree Collapse file tree 12 files changed +496
-0
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
55The format is based on [ Keep a Changelog] ( http://keepachangelog.com/ )
66and this project adheres to [ Semantic Versioning] ( http://semver.org/ ) .
77
8+ ### Unreleased
9+
10+ ## Added
11+
12+ - Added ` CenterMiddle ` container
13+
814## [ 3.5.0] - 2025-06-20
915
1016### Changed
Original file line number Diff line number Diff line change 1+ from textual .app import App , ComposeResult
2+ from textual .containers import Horizontal
3+ from textual .widgets import Placeholder
4+
5+
6+ class Box (Placeholder ):
7+ """Example widget."""
8+
9+ DEFAULT_CSS = """
10+ Box {
11+ width: 16;
12+ height: 8;
13+ }
14+ """
15+
16+
17+ class ContainerApp (App ):
18+ """Simple app to play with containers."""
19+
20+ def compose (self ) -> ComposeResult :
21+ with Horizontal (): # (1)!
22+ yield Box () # (2)!
23+ yield Box ()
24+ yield Box ()
25+
26+
27+ if __name__ == "__main__" :
28+ app = ContainerApp ()
29+ app .run ()
Original file line number Diff line number Diff line change 1+ from textual .app import App , ComposeResult
2+ from textual .containers import Vertical
3+ from textual .widgets import Placeholder
4+
5+
6+ class Box (Placeholder ):
7+ """Example widget."""
8+
9+ DEFAULT_CSS = """
10+ Box {
11+ width: 16;
12+ height: 8;
13+ }
14+ """
15+
16+
17+ class ContainerApp (App ):
18+ """Simple app to play with containers."""
19+
20+ def compose (self ) -> ComposeResult :
21+ with Vertical (): # (1)!
22+ yield Box ()
23+ yield Box ()
24+ yield Box ()
25+
26+
27+ if __name__ == "__main__" :
28+ app = ContainerApp ()
29+ app .run ()
Original file line number Diff line number Diff line change 1+ from textual .app import App , ComposeResult
2+ from textual .containers import Horizontal
3+ from textual .widgets import Placeholder
4+
5+
6+ class Box (Placeholder ):
7+ """Example widget."""
8+
9+ DEFAULT_CSS = """
10+ Box {
11+ width: 16;
12+ height: 8;
13+ }
14+ """
15+
16+
17+ class ContainerApp (App ):
18+ """Simple app to play with containers."""
19+
20+ CSS = """
21+ .with-border {
22+ border: heavy green;
23+ }
24+ """
25+
26+ def compose (self ) -> ComposeResult :
27+ with Horizontal (classes = "with-border" ): # (1)!
28+ yield Box ()
29+ yield Box ()
30+ yield Box ()
31+
32+
33+ if __name__ == "__main__" :
34+ app = ContainerApp ()
35+ app .run ()
Original file line number Diff line number Diff line change 1+ from textual .app import App , ComposeResult
2+ from textual .containers import Horizontal
3+ from textual .widgets import Placeholder
4+
5+
6+ class Box (Placeholder ):
7+ """Example widget."""
8+
9+ DEFAULT_CSS = """
10+ Box {
11+ width: 16;
12+ height: 8;
13+ }
14+ """
15+
16+
17+ class ContainerApp (App ):
18+ """Simple app to play with containers."""
19+
20+ CSS = """
21+ .with-border {
22+ border: heavy green;
23+ }
24+ """
25+
26+ def compose (self ) -> ComposeResult :
27+ with Horizontal (classes = "with-border" ):
28+ yield Box ()
29+ yield Box ()
30+ yield Box ()
31+ with Horizontal (classes = "with-border" ):
32+ yield Box ()
33+ yield Box ()
34+ yield Box ()
35+
36+
37+ if __name__ == "__main__" :
38+ app = ContainerApp ()
39+ app .run ()
Original file line number Diff line number Diff line change 1+ from textual .app import App , ComposeResult
2+ from textual .containers import HorizontalGroup
3+ from textual .widgets import Placeholder
4+
5+
6+ class Box (Placeholder ):
7+ """Example widget."""
8+
9+ DEFAULT_CSS = """
10+ Box {
11+ width: 16;
12+ height: 8;
13+ }
14+ """
15+
16+
17+ class ContainerApp (App ):
18+ """Simple app to play with containers."""
19+
20+ CSS = """
21+ .with-border {
22+ border: heavy green;
23+ }
24+ """
25+
26+ def compose (self ) -> ComposeResult :
27+ with HorizontalGroup (classes = "with-border" ):
28+ yield Box ()
29+ yield Box ()
30+ yield Box ()
31+ with HorizontalGroup (classes = "with-border" ):
32+ yield Box ()
33+ yield Box ()
34+ yield Box ()
35+
36+
37+ if __name__ == "__main__" :
38+ app = ContainerApp ()
39+ app .run ()
Original file line number Diff line number Diff line change 1+ from textual .app import App , ComposeResult
2+ from textual .containers import Horizontal
3+ from textual .widgets import Placeholder
4+
5+
6+ class Box (Placeholder ):
7+ """Example widget."""
8+
9+ DEFAULT_CSS = """
10+ Box {
11+ width: 16;
12+ height: 8;
13+ }
14+ """
15+
16+
17+ class ContainerApp (App ):
18+ """Simple app to play with containers."""
19+
20+ CSS = """
21+ .with-border {
22+ border: heavy green;
23+ }
24+ """
25+
26+ def compose (self ) -> ComposeResult :
27+ with Horizontal (classes = "with-border" ):
28+ for n in range (10 ):
29+ yield Box (label = f"Box { n + 1 } " )
30+
31+
32+ if __name__ == "__main__" :
33+ app = ContainerApp ()
34+ app .run ()
Original file line number Diff line number Diff line change 1+ from textual .app import App , ComposeResult
2+ from textual .containers import HorizontalScroll
3+ from textual .widgets import Placeholder
4+
5+
6+ class Box (Placeholder ):
7+ """Example widget."""
8+
9+ DEFAULT_CSS = """
10+ Box {
11+ width: 16;
12+ height: 8;
13+ }
14+ """
15+
16+
17+ class ContainerApp (App ):
18+ """Simple app to play with containers."""
19+
20+ CSS = """
21+ .with-border {
22+ border: heavy green;
23+ }
24+ """
25+
26+ def compose (self ) -> ComposeResult :
27+ with HorizontalScroll (classes = "with-border" ):
28+ for n in range (10 ):
29+ yield Box (label = f"Box { n + 1 } " )
30+
31+
32+ if __name__ == "__main__" :
33+ app = ContainerApp ()
34+ app .run ()
Original file line number Diff line number Diff line change 1+ from textual .app import App , ComposeResult
2+ from textual .containers import Center , Right
3+ from textual .widgets import Placeholder
4+
5+
6+ class Box (Placeholder ):
7+ """Example widget."""
8+
9+ DEFAULT_CSS = """
10+ Box {
11+ width: 16;
12+ height: 5;
13+ }
14+ """
15+
16+
17+ class ContainerApp (App ):
18+ """Simple app to play with containers."""
19+
20+ CSS = """
21+ .with-border {
22+ border: heavy green;
23+ }
24+ """
25+
26+ def compose (self ) -> ComposeResult :
27+ yield Box ("Box 1" )
28+ with Center (classes = "with-border" ):
29+ yield Box ("Box 2" )
30+ with Right (classes = "with-border" ):
31+ yield Box ("Box 3" )
32+
33+
34+ if __name__ == "__main__" :
35+ app = ContainerApp ()
36+ app .run ()
Original file line number Diff line number Diff line change 1+ from textual .app import App , ComposeResult
2+ from textual .containers import HorizontalGroup , Middle
3+ from textual .widgets import Placeholder
4+
5+
6+ class Box (Placeholder ):
7+ """Example widget."""
8+
9+ DEFAULT_CSS = """
10+ Box {
11+ width: 16;
12+ height: 5;
13+ }
14+ """
15+
16+
17+ class ContainerApp (App ):
18+ """Simple app to play with containers."""
19+
20+ CSS = """
21+ .with-border {
22+ border: heavy green;
23+ }
24+ """
25+
26+ def compose (self ) -> ComposeResult :
27+ with HorizontalGroup ():
28+ yield Box ("Box 1" )
29+ with Middle (classes = "with-border" ):
30+ yield Box ("Box 2" )
31+ yield Box ("Box 3" )
32+
33+
34+ if __name__ == "__main__" :
35+ app = ContainerApp ()
36+ app .run ()
You can’t perform that action at this time.
0 commit comments