Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Added

- Added a visual example to `Align` docstring.

## [14.2.0] - 2025-10-09

### Changed
Expand Down
1 change: 1 addition & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ The following people have contributed to the development of Rich:
- [JP Hutchins](https://github.com/JPhutchins)
- [Ionite](https://github.com/ionite34)
- [Josh Karpel](https://github.com/JoshKarpel)
- [Pouya Karazmayan](https://github.com/AttackThwarter)
- [Jan Katins](https://github.com/jankatins)
- [Hugo van Kemenade](https://github.com/hugovk)
- [Andrew Kettmann](https://github.com/akettmann)
Expand Down
14 changes: 14 additions & 0 deletions rich/align.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,20 @@ class Align(JupyterMixin):

Raises:
ValueError: if ``align`` is not one of the expected values.

Example:
.. code-block:: python

from rich.console import Console
from rich.align import Align
from rich.panel import Panel

console = Console()
# Create a panel 20 characters wide
p = Panel("Hello, [b]World[/b]!", style="on green", width=20)

# Renders the panel centered in the terminal
console.print(Align(p, align="center"))
"""

def __init__(
Expand Down