PHPackages                             survos/tui-extras-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [CLI &amp; Console](/categories/cli)
4. /
5. survos/tui-extras-bundle

ActiveSymfony-bundle[CLI &amp; Console](/categories/cli)

survos/tui-extras-bundle
========================

Extra TUI widgets and data source abstractions for symfony/tui

2.7.2(1w ago)09MITPHPPHP ^8.1

Since May 15Pushed 2d agoCompare

[ Source](https://github.com/survos/tui-extras-bundle)[ Packagist](https://packagist.org/packages/survos/tui-extras-bundle)[ GitHub Sponsors](https://github.com/kbond)[ RSS](/packages/survos-tui-extras-bundle/feed)WikiDiscussions main Synced 1w ago

READMEChangelogDependencies (8)Versions (14)Used By (0)

survos/tui-extras-bundle
========================

[](#survostui-extras-bundle)

Extra TUI widgets and data-source abstractions for [`symfony/tui`](https://github.com/symfony/tui) — the terminal UI component shipping in Symfony 8.1.

> **Status:** 0.1 — beta. Tracks `symfony/tui ^8.1` which is itself experimental. Widgets are usable and the file browser works end-to-end. APIs may shift before 1.0.

---

What's in the box
-----------------

[](#whats-in-the-box)

### Widgets

[](#widgets)

WidgetWhat it does`DataTableWidget`Paged, searchable, sortable data table. Live search, FTS5-aware.`TreeWidget`Collapsible tree — `▼`/`►` branches, `──` leaves. Keyboard navigate.`DetailPanelWidget`Read-only text/code pane with title and separator.### Data sources (`TuiTableSourceInterface`)

[](#data-sources-tuitablesourceinterface)

SourceBacked by`ArrayTableSource`Plain PHP array, in-memory filter/sort`SqliteTableSource`PDO + SQLite with optional FTS5 full-text search`FileSource`Symfony Finder — respects `.gitignore` by default### Syntax highlighting (`SyntaxHighlighter`)

[](#syntax-highlighting-syntaxhighlighter)

- Uses `bat`/`batcat` if installed (200+ languages, themes)
- PHP fallback via `token_get_all()` — zero extra deps
- JSON fallback via stdlib pretty-print + hand-rolled tokenizer
- Markdown via `MarkdownWidget` (league/commonmark + tempest/highlight)

---

Requirements
------------

[](#requirements)

- PHP 8.1+
- `symfony/tui ^8.1` (currently `8.1.x-dev`)
- `league/commonmark ^2.0` (for Markdown rendering)
- `tempest/highlight ^2.0` (for code blocks within Markdown)

---

Installation
------------

[](#installation)

```
composer require survos/tui-extras-bundle
```

Register in your `config/bundles.php` (or let Flex do it):

```
Survos\TuiExtrasBundle\SurvosTuiExtrasBundle::class => ['all' => true],
```

> **HTTP-less apps** (`AbstractKernel` + `KernelTrait` + `ConsoleBundle`, no `FrameworkBundle`): the bundle works without an HTTP kernel. See the `demo/` directory for a minimal setup.

---

The file browser
----------------

[](#the-file-browser)

The fastest way to see the bundle in action:

```
cd demo/
composer install
php bin/console browse:files          # tree of current directory
php bin/console browse:files ../src   # browse the bundle source
php bin/console browse:files . --pre-expand=2   # open 2 levels on start
php bin/console browse:files . --raw            # no syntax highlighting
php bin/console browse:files . --no-gitignore   # include ignored files
```

```
▼ src/
── ► Event/
▼ Highlighter/
──── SyntaxHighlighter.php
▼ Model/
──── TreeNode.php
──── TuiColumn.php
▼ Widget/
──── DataTableWidget.php        │
