PHPackages                             sugarcraft/sugar-stickers - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. sugarcraft/sugar-stickers

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

sugarcraft/sugar-stickers
=========================

PHP port of 76creates/stickers — Lipgloss utility components. FlexBox (CSS flexbox-like responsive grid layout) and Table (sortable, filterable data table with column definitions).

001PHP

Since Jul 1Pushed 3w agoCompare

[ Source](https://github.com/sugarcraft/sugar-stickers)[ Packagist](https://packagist.org/packages/sugarcraft/sugar-stickers)[ RSS](/packages/sugarcraft-sugar-stickers/feed)WikiDiscussions master Synced 3w ago

READMEChangelogDependenciesVersions (1)Used By (1)

[![sugar-stickers](.assets/icon.png)](.assets/icon.png)

[![CI](https://github.com/detain/sugarcraft/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/detain/sugarcraft/actions/workflows/ci.yml)[![codecov](https://camo.githubusercontent.com/65624921c2c5e34ffc3a8b819bd2811c3a3e239b3b121a20c0e0dfc1a99c766a/68747470733a2f2f636f6465636f762e696f2f67682f64657461696e2f737567617263726166742f6272616e63682f6d61737465722f67726170682f62616467652e7376673f666c61673d73756761722d737469636b657273)](https://app.codecov.io/gh/detain/sugarcraft?flags%5B0%5D=sugar-stickers)[![Packagist Version](https://camo.githubusercontent.com/080cbb3e71073362586ad61f131aa9da9fe3f2fa5b42d9823b519e8e3f5e60b4/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7375676172636f72652f73756761722d737469636b6572733f6c6162656c3d7061636b6167697374)](https://packagist.org/packages/sugarcore/sugar-stickers)[![License](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](LICENSE)[![PHP](https://camo.githubusercontent.com/e78ffc83837c0d12647811a7fd1910c3cbeae04988de94bb4fd5b67e0874696a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d254532253839254135382e312d3838393262662e737667)](https://www.php.net/)

SugarStickers
=============

[](#sugarstickers)

PHP port of [76creates/stickers](https://github.com/76creates/stickers) — Lipgloss utility building blocks. Provides FlexBox layout and Table components for terminal UIs.

Features
--------

[](#features)

### FlexBox

[](#flexbox)

- **CSS flexbox-like** responsive grid layout for terminal UIs
- **Direction**: row (horizontal) or column (vertical)
- **Align** items: start/center/end/stretch
- **Gap** between items
- **Ratio-based sizing** — items with grow ratios fill available space

### Table

[](#table)

- **Sortable columns** — click to sort by any column, ascending/descending
- **Filterable** — filter rows by cell content
- **Configurable columns** — title, width, alignment, formatter
- **Cell styling** — per-column ANSI style support
- **Cursor tracking** — get current row/cell on selection

### Viewport

[](#viewport)

- **Scrollable viewport** — composes `sugar-bits` `Viewport` (SSOT)
- **Keyboard navigation** — line-up/down, page-up/down, goto-top/bottom
- **Mouse wheel** support with configurable delta
- **Horizontal scrolling** with step-based navigation
- **Smooth scroll** and scrollbar toggle

### Scrollbar

[](#scrollbar)

- **Scrollbar** — composes `sugar-bits` `Scrollbar` (SSOT)
- **Vertical and horizontal** scrollbars with configurable thumb/track characters
- **Arrow toggling** for scrollbar ends

Install
-------

[](#install)

```
composer require sugarcraft/sugar-stickers
```

FlexBox Quick Start
-------------------

[](#flexbox-quick-start)

```
use SugarCraft\Stickers\Flex\{FlexBox, FlexItem};

$box = FlexBox::row(
    FlexItem::new('Panel A')->withRatio(1),
    FlexItem::new('Panel B')->withRatio(2),
    FlexItem::new('Panel C')->withRatio(1),
)->withGap(1);

echo $box->render(80, 24);
```

Table Quick Start
-----------------

[](#table-quick-start)

```
use SugarCraft\Stickers\Table\{Table, Column};

$table = new Table();
$table->addColumn(Column::make('Name', 20));
$table->addColumn(Column::make('Age', 5)->withAlign('right'));
$table->addColumn(Column::make('City', 15));

$table->addRow(['Alice', 30, 'NYC']);
$table->addRow(['Bob',   25, 'LA']);
$table->addRow(['Carol', 35, 'Chicago']);

$table->sortBy(0);  // sort by Name column
$table->filter('a'); // filter rows

echo $table->render();
```

Viewport Quick Start
--------------------

[](#viewport-quick-start)

```
use SugarCraft\Stickers\Viewport;
use SugarCraft\Stickers\Scrollbar;

$viewport = Viewport::withContent(str_repeat("Line\n", 50), 80, 24);
$viewport = $viewport->withScrollbar(true);

// Use as a model in your BubbleTea app
$model = $viewport;
```

Buffer diffing
--------------

[](#buffer-diffing)

The Table renderer maintains a `?Buffer $previousFrame` across renders. On each render it builds the current Buffer, computes `current->diff(previous)` (from [candy-buffer](https://github.com/detain/sugarcraft-candy-buffer)), and emits only the delta ANSI ops via `DiffEncoder::encode($ops)`. The current frame then replaces `previousFrame` for the next render.

**SSH bandwidth + flicker win:** a one-character change in an 80×24 viewport produces ~8 bytes of delta ops instead of ~1 940 bytes for a full repaint. Over an SSH session this means far less per-frame data on the wire and eliminates the full-screen flicker of rewrite-based terminals. The first render after startup or a resize still emits a full Buffer (no diff possible), so behaviour is always correct.

License
-------

[](#license)

[MIT](LICENSE)

###  Health Score

20

—

LowBetter than 12% of packages

Maintenance62

Regular maintenance activity

Popularity0

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity11

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/b1036e0717211b8030b83cbe729e8ba6ba442fdbd5285fb97a39d7dcfe339342?d=identicon)[detain](/maintainers/detain)

---

Top Contributors

[![detain](https://avatars.githubusercontent.com/u/1364504?v=4)](https://github.com/detain "detain (81 commits)")

### Embed Badge

![Health badge](/badges/sugarcraft-sugar-stickers/health.svg)

```
[![Health](https://phpackages.com/badges/sugarcraft-sugar-stickers/health.svg)](https://phpackages.com/packages/sugarcraft-sugar-stickers)
```

###  Alternatives

[wpmetabox/meta-box

The most powerful &amp; comprehensive plugin to create, manage, show and connect dynamic data with forms and custom fields effortlessly on WordPress.

1.2k20.8k6](/packages/wpmetabox-meta-box)[laravel-admin-ext/grid-lightbox

Turn your grid into a lightbox &amp; gallery

58186.3k2](/packages/laravel-admin-ext-grid-lightbox)[wapplersystems/ws-scss

Compiles SCSS to CSS at runtime with caching, TypoScript variables and EXT: import support

11149.9k8](/packages/wapplersystems-ws-scss)[hannesvdvreken/pip

The Polygon class

1738.8k1](/packages/hannesvdvreken-pip)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
