Symfony 8.1 introduces the Tui component, a new library for building rich, full-screen terminal user interfaces in PHP. Unlike the Console component which handles commands and output, Tui provides a complete widget toolkit including text editors with undo/redo, selectable lists, progress bars, Markdown rendering, and animated spinners. Styling is handled via a CSS-like engine supporting inline Style objects, stylesheets with selectors and focus states, and Tailwind-like utility classes. The component is fully non-blocking, running on PHP Fibers and the Revolt event loop, enabling responsive interfaces with background async work. It can be embedded inside existing console commands and falls back gracefully to regular Console output.
1.1K Impressions