← All libraries

SugarDash

SugarDash

Dashboard TUI library — grid layouts, panels, and more

port of charmbracelet/bubble-grid dashboardlayoutgridpanel

Build dashboard-style terminal UIs with column grid layouts, framed panels, status bars, tabs, and more. Compose complex layouts from reusable components.

Install

composer require sugarcraft/sugar-dash

Quickstart

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();

What's in the box

StackedGridColumn grid layout with weighted sizing and gap support.
FrameFramed panel with border, title, and padding.
StatusBarStatus bar component for dashboard footers.
TabsTabbed interface for switching between views.
Card / Box / ParagraphReusable UI components for building panels.
Event systemKeyboard, mouse, focus, and resize event handling.

Showcase examples

Complex Dashboard Charts, stats, funnels, sparklines in a full StackedGrid layout.
View gif →
Metrics Dashboard Key statistics and status indicators.
View gif →
Status Indicators Spinners, progress bars, gauges, alerts.
View gif →
Interactive Dashboard Accordion, timeline, and card components.
View gif →
Server Showcase Production dashboard — gauges, charts, avatars, timeline in multi-column layout.
View gif →

Source & demos

Try the quickstart →

API

ClassMethodDescription
StackedGridnew(Options)Create a stacked grid layout
StackedGridaddItem(item, ItemOptions)Add item to a column
StackedGridsetSize(width, height)Set grid dimensions
StackedGridrender()Render the grid to ANSI string
Framenew(content, title)Create a framed panel
FramewithBorder(style)Apply border styling
StatusBarnew(items)Create a status bar
Tabsnew(pages)Create a tabbed interface

Demos.

VHS-recorded GIFs of every example shipped with the library. Regenerated automatically on every push that touches the source.

Layout & Structure

StackedGrid

StackedGrid

Multi-column stacked grid layout.
GridLayout

GridLayout

CSS Grid-style layout.
FlexLayout

FlexLayout

Flexbox-style layout.
VStack

VStack

Vertical stack with alignment.
HStack

HStack

Horizontal stack with spacing.
ZStack

ZStack

Layered stack.
Stack

Stack

Basic vertical stack.
Frame

Frame

Bordered frame with title.
Panel

Panel

Panel with header/footer.
Card

Card

Card container component.
Divider

Divider

Horizontal or vertical divider.
BoxDrawing

BoxDrawing

Unicode box-drawing frame.
BorderText

BorderText

Text with ASCII border.
Spacer

Spacer

Empty space filler.
Split

Split

Split layout.
Center

Center

Centered content.
Cover

Cover

Cover layout.
Header

Header

Page header.
Footer

Footer

Page footer.
Window

Window

Window frame.
Drawer

Drawer

Drawer panel.

Charts

Chart

Chart

Bar/line chart with axes.
AreaChart

AreaChart

Area chart for time series.
Bar

Bar

Horizontal status bar.
Donut

Donut

Donut chart.
Gauge

Gauge

Horizontal gauge.
GaugeChart

GaugeChart

Circular gauge chart.
GaugeCircle

GaugeCircle

Circular gauge visualization.
Heatmap

Heatmap

Heat map visualization.
RadarChart

RadarChart

Radar/spider chart.
Bubble

Bubble

Bubble chart.
Bullet

Bullet

Bullet chart.
Sparkline

Sparkline

Inline sparkline chart.
SparklineBar

SparklineBar

Bar-style sparkline.
SparklineArea

SparklineArea

Area-style sparkline.
SparkArea

SparkArea

Spark area chart.
FunnelChart

FunnelChart

Funnel chart.

Form & Input

Input

Input

Text input field.
Textarea

Textarea

Multi-line text area.
Select

Select

Dropdown select.
Checkbox

Checkbox

Checkbox group.
Radio

Radio

Radio button.
Slider

Slider

Slider control.
Toggle

Toggle

Toggle switch.
Switch

Switch

Switch component.
Chip

Chip

Chip/tag component.
ChipGroup

ChipGroup

Group of chips.
Label

Label

Form label.
ComboBox

ComboBox

Combo box.
DatePicker

DatePicker

Date picker.

Navigation

Tabs

Tabs

Tabbed interface.
TabsVertical

TabsVertical

Vertical tab navigation.
Navbar

Navbar

Navigation bar.
Sidebar

Sidebar

Sidebar navigation.
Breadcrumb

Breadcrumb

Breadcrumb navigation.
Menu

Menu

Menu component.

Feedback

Alert

Alert

Alert/message box.
Toast

Toast

Toast message.
Notification

Notification

Toast notification.
Spinner

Spinner

Loading spinner.
Progress

Progress

Progress indicator.
ProgressBar

ProgressBar

Progress bar.
ProgressRing

ProgressRing

Circular progress indicator.
NProgress

NProgress

npm-style progress bar.
LoadingText

LoadingText

Animated loading text.

Data Display

TableBordered

TableBordered

Bordered table.
TableZebra

TableZebra

Zebra-striped table.
List

List

List renderer.
Tree

Tree

Tree structure.
Metric

Metric

Metric display.
Stat

Stat

Single stat display.
Stats

Stats

Statistics display.
MetricsGrid

MetricsGrid

Grid of metrics.

Media

Image

Image

Image display.
Picture

Picture

Picture frame.
Avatar

Avatar

User avatar.
AvatarGroup

AvatarGroup

Group of avatars.
Icon

Icon

Icon display.
QRCode

QRCode

QR code.
Barcode

Barcode

Barcode.
Video

Video

Video player.
Audio

Audio

Audio player.

Text

Text

Text

Word-wrapped text.
Paragraph

Paragraph

Paragraph text.
Code

Code

Code block.
Kbd

Kbd

Keyboard key display.
Emoji

Emoji

Emoji display.
FigletText

FigletText

ASCII art text.
ASCIIBanner

ASCIIBanner

ASCII banner text.
Highlight

Highlight

Syntax highlighted code.
HexDump

HexDump

Hex dump viewer.
DotMatrix

DotMatrix

Dot matrix display.
Pictogram

Pictogram

Pictogram display.
Boxer

Boxer

Boxing text effect.

Status

Clock

Clock

Digital clock.
Timer

Timer

Countdown timer.
Stopwatch

Stopwatch

Stopwatch.
Calendar

Calendar

Calendar view.
Terminal

Terminal

Terminal emulator.
LogViewer

LogViewer

Log file viewer.
Log

Log

Log entry.
Console

Console

Terminal console.
State

State

Application state.
Focus

Focus

Focus state management.

Advanced

Accordion

Accordion

Accordion/collapsible.
ActivityFeed

ActivityFeed

Activity feed.
Badge

Badge

Badge/tag component.
Testimonial

Testimonial

Testimonial quote.
Profile

Profile

User profile card.
CTA

CTA

Call-to-action.
Jumbotron

Jumbotron

Jumbotron hero section.
EmptyState

EmptyState

Empty state placeholder.
Skeleton

Skeleton

Loading skeleton.
Marquee

Marquee

Scrolling marquee text.
Scrollbar

Scrollbar

Custom scrollbar.
Tooltip

Tooltip

Tooltip popup.
Popover

Popover

Popover content.
Hint

Hint

Hint component.
Tag

Tag

Tag component.
Rating

Rating

Star rating display.
Leaderboard

Leaderboard

Leaderboard display.
Diff

Diff

Diff view.
Editor

Editor

Text editor.
CommandPalette

CommandPalette

Command palette.
Modal

Modal

Modal dialog.
WordCloud

WordCloud

Word cloud visualization.

Dashboard Examples

Dashboard Layout

Dashboard Layout

Layout containers demo.
Dashboard Charts

Dashboard Charts

Charts demo.
Dashboard Form

Dashboard Form

Form demo.
Dashboard Nav

Dashboard Nav

Navigation demo.
Dashboard Status

Dashboard Status

Status indicators demo.
Dashboard Text

Dashboard Text

Text components demo.
Dashboard Time

Dashboard Time

Time components demo.
Dashboard UI

Dashboard UI

UI components demo.
Dashboard Complex

Dashboard Complex

Complex layout demo.
Dashboard Data

Dashboard Data

Data display demo.
Dashboard Devtools

Dashboard Devtools

Devtools demo.
Dashboard Accordion Timeline

Dashboard Accordion Timeline

Accordion and timeline components.
Dashboard Media

Dashboard Media

Media components demo.
Dashboard Metrics

Dashboard Metrics

Metrics display demo.