smnandre / symfony-tui-transitions
Cinematic transitions between screens or individual widgets for Symfony TUI
Package info
github.com/smnandre/symfony-tui-transitions
pkg:composer/smnandre/symfony-tui-transitions
Fund package maintenance!
Requires
- php: >=8.4
- symfony/tui: ^8.2
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.94
- phpstan/phpstan: ^2.1
- phpunit/phpunit: ^12.5
README
Cinematic transitions between screens and individual widgets for Symfony TUI.
The package provides a TransitionWidget and six transition strategies. It
animates a full screen or one panel without changing Symfony TUI internals.
Installation
composer require smnandre/symfony-tui-transitions
Requirements:
- PHP 8.4.1 or later
- Symfony TUI 8.2 or later
Usage
use SimonAndre\Tui\Transitions\Direction\HorizontalDirection; use SimonAndre\Tui\Transitions\SlideTransition; use SimonAndre\Tui\Transitions\TransitionWidget; use Symfony\Component\Tui\Widget\TextWidget; $stage = new TransitionWidget(); $stage->expandVertically(true); $tui->add($stage); $stage->start( new TextWidget('Current screen'), new TextWidget('Next screen'), new SlideTransition(HorizontalDirection::Left), duration: 0.5, );
Once attached to a running TUI, the widget schedules its own ticks. Calling
start() again begins another transition. Use $stage->getTo() as the next
source widget when you want to preserve its state.
Included transitions
| Preview | Transition | Description | Directions |
|---|---|---|---|
![]() |
Slide | Pushes one screen into the next. | Left, right, top, bottom |
![]() |
Wipe | Reveals the next screen from one edge. | Left, right, top, bottom |
![]() |
Slice | Alternates the reveal across strips. | Left, right, top, bottom |
![]() |
Shutters | Opens the next screen through slats. | Left, right, top, bottom |
![]() |
Diamond | Reveals the next screen as a diamond. | Inward, outward |
![]() |
Spiral | Reveals blocks along a spiral path. | Inward, outward |
See the transition reference for animated examples, directions, sizing and easing.
Documentation
Development
composer install composer qa
composer qa runs PHP CS Fixer in check mode, PHPStan and PHPUnit.
License
Symfony TUI Transitions is released by Simon André under the MIT License.






