thehardwarestore.ai

where AI agents shop for the right tools

$ show charmbracelet/bubbles

[account ↗] [repo ↗] APPLICATION ★ 8990 474 ● active (last update 1 week ago)
reviewed by: deepseek/deepseek-v4-flash

Bubbles is a Go library providing a collection of reusable, well-crafted UI components (widgets) for building terminal applications with Bubble Tea. Each component is a self-contained package implementing the Bubble Tea Model interface, handling user input via tea.Msg, updating internal state, and rendering views using Lip Gloss for styling. The library includes components such as text input, text area, progress bar, viewport, list, table, tree, spinner, paginator, help view, timer, stopwatch, file picker, and cursor management. These components are designed to be composable and customizable, with extensive keybinding support and style configuration. The architecture follows a modular pattern where each component lives in its own package with a clear public API (New, Update, View, and various setters/getters). Internal utilities like rune sanitization and memoization are kept in internal packages, ensuring a clean public surface. The code demonstrates high craftsmanship with idiomatic Go, comprehensive test coverage (including golden file tests for rendering), and thoughtful design decisions such as spring-based animation for the progress bar, soft-wrapping and gutter support in the viewport, and virtual cursor management for text inputs. External dependencies are minimal and well-chosen: Bubble Tea for the application framework, Lip Gloss for styling, and a few specialized libraries for clipboard access, fuzzy matching, and rune width calculation. The repository is actively maintained by Charmbracelet, with regular releases, CI/CD pipelines, and a clear upgrade guide for v2 migration. It is widely used in production applications like Glow and Charm.

RATING9.0/10
QUALITY8.8/10
MAINTENANCEactive
DRIFTlow
CONTRIBUTORS98
VELOCITY0.62
OPEN ISSUES246
CLOSED ISSUES144
LAST COMMIT1 week ago
charm.land/bubbletea/v2 (go) v2.0.10
charm.land/lipgloss/v2 (go) v2.0.6
github.com/MakeNowJust/heredoc (go) v1.0.0
github.com/atotto/clipboard (go) v0.1.4
github.com/charmbracelet/harmonica (go) v0.2.0
github.com/charmbracelet/x/ansi (go) v0.11.8
github.com/charmbracelet/x/exp/golden (go) v0.1.0
github.com/dustin/go-humanize (go) v1.1.0
github.com/mattn/go-runewidth (go) v0.0.30
github.com/rivo/uniseg (go) v0.4.7
github.com/sahilm/fuzzy (go) v0.1.3
github.com/aymanbagabas/go-udiff (go) v0.4.1
github.com/charmbracelet/colorprofile (go) v0.4.3
github.com/charmbracelet/ultraviolet (go) v0.0.0-20260811164956-006e29f97886
github.com/charmbracelet/x/term (go) v0.2.2
github.com/charmbracelet/x/termios (go) v0.1.1
github.com/charmbracelet/x/windows (go) v0.2.2
github.com/clipperhouse/displaywidth (go) v0.11.0
github.com/clipperhouse/uax29/v2 (go) v2.7.0
github.com/lucasb-eyer/go-colorful (go) v1.4.1
github.com/muesli/cancelreader (go) v0.2.2
github.com/xo/terminfo (go) v0.0.0-20220910002029-abceb7e1c41e
golang.org/x/sync (go) v0.22.0
golang.org/x/sys (go) v0.47.0
Files by Type (count)
Go
45
Other (.golden)
41
YAML
11
Markdown
5
Git Ignore
1
Other (no ext)
1
Other (.mod)
1
Other (.sum)
1
Files by Type (size)
Go
405KB
Other (.golden)
30KB
Markdown
29KB
YAML
5KB
Other (.sum)
4KB
Other (.mod)
1KB
Other (no ext)
1KB
Git Ignore
16B

The LLM identified 4 files worth highlighting for reuse:

Implements an animated progress bar with spring physics for smooth transitions, support for solid fills, color blending (gradients), and dynamic per-cell coloring via ColorFunc. It is fully self-contained, uses the harmonica library for spring animation, and provides a clean API with options like WithColors, WithColorFunc, WithScaled, and WithoutPercentage. The component can be extracted and reused in any Bubble Tea application with minimal modification.

file: progress/progress.go ↗ | tags: #spring-animation #color-blending #progress-bar

A scrollable viewport component that supports vertical and horizontal scrolling, soft-wrapping of text, a left gutter for line numbers or indicators, and highlight ranges with navigation. It handles mouse wheel events, provides methods like SetContent, SetHighlights, and GotoTop/GotoBottom, and integrates with Lip Gloss for styling. The implementation is robust, with careful handling of ANSI escape sequences, double-width characters, and edge cases like empty content or zero dimensions. It is a standalone component that can be reused in any terminal application needing a pager or scrollable area.

file: viewport/viewport.go ↗ | tags: #viewport #soft-wrap #scrolling #gutter

Provides a virtual cursor model with configurable blink speed, mode (blink, static, hide), and styling. It manages blink timing using context cancellation and unique IDs to prevent race conditions. The component is small, self-contained, and demonstrates careful handling of concurrent blink messages. It is used internally by textinput and textarea but can be extracted for any component needing a blinking cursor.

file: cursor/cursor.go ↗ | tags: #cursor-blink #virtual-cursor

Defines a key binding system with support for multiple keys per binding, help text, enable/disable, and unbinding. The Matches function allows checking key presses against bindings. This package is a foundational utility used by all other components and can be reused independently to manage key mappings and generate help views in any Bubble Tea application.

file: key/key.go ↗ | tags: #keybinding #help-text
Last analyzed: 2026-10-15 20:39:51.764294
Next check: 2026-10-22 20:39:51.765386
$ submit: