Dashboard TUI library — grid layouts, panels, and more
Build dashboard-style terminal UIs with column grid layouts, framed panels, status bars, tabs, and more. Compose complex layouts from reusable components.
composer require sugarcraft/sugar-dash
use SugarCraft\Dash\Layout\StackedGrid;
use SugarCraft\Dash\Layout\Frame;
use SugarCraft\Dash\Layout\ItemOptions;
use SugarCraft\Dash\Layout\Options;
$grid = new StackedGrid(new Options(fitScreen: true));
$grid->addItem(new SomePanel(), new ItemOptions(column: 0));
$grid->addItem(new AnotherPanel(), new ItemOptions(column: 1));
$grid->setSize(80, 24);
echo $grid->render();
| Class | Method | Description |
|---|---|---|
| StackedGrid | new(Options) | Create a stacked grid layout |
| StackedGrid | addItem(item, ItemOptions) | Add item to a column |
| StackedGrid | setSize(width, height) | Set grid dimensions |
| StackedGrid | render() | Render the grid to ANSI string |
| Frame | new(content, title) | Create a framed panel |
| Frame | withBorder(style) | Apply border styling |
| StatusBar | new(items) | Create a status bar |
| Tabs | new(pages) | Create a tabbed interface |
VHS-recorded GIFs of every example shipped with the library. Regenerated automatically on every push that touches the source.