Bubble Tea: Go TUI framework
Go framework for terminal user interfaces based on The Elm Architecture with inline/fullscreen modes.
Learn more about Bubble Tea
Bubble Tea is a terminal user interface framework written in Go that implements The Elm Architecture pattern. Applications are built around a model-update-view cycle where the model represents application state, update handles incoming messages and state changes, and view renders the UI as strings. The framework includes a framerate-based renderer, mouse support, focus reporting, and other terminal-specific optimizations. It is commonly used for building interactive command-line tools, system utilities, and text-based applications.
Elm Architecture
Implements functional programming patterns with model-update-view architecture for predictable state management.
Framerate Renderer
Uses optimized rendering with framerate control to minimize terminal flickering and improve performance.
Message System
Handles terminal events through a type-safe message passing system for keyboard, mouse, and other I/O operations.
package main
import (
"fmt"
"os"
tea "github.com/charmbracelet/bubbletea"
)
type model struct {
choices []string // items on the to-do list
cursor int // which to-do list item our cursor is pointing at
selected map[int]struct{} // which to-do items are selected
}
func initialModel() model {
return model{
choices: []string{"Buy carrots", "Buy celery", "Buy kohlrabi"},
selected: make(map[int]struct{}),
}
}
func (m model) Init() tea.Cmd {
return nil // No initial I/O needed
}This release introduces synchronized output updates, which is enabled by default. This mode enhances how supported terminals render program updates by
- –feat: add SupportsKeyDisambiguation to KeyboardEnhancementsMsg (@aymanbagabas)
- –feat: add synchronized updates option to renderer interface (@aymanbagabas)
- –feat: introduce ModeReportMsg for terminal mode reports (@aymanbagabas)
- –feat: query terminal for synchronized output support (mode 2026) (@aymanbagabas)
- –feat: renderer: use uv altscreen helpers (@aymanbagabas)
This release includes a big change in the module name, and several message type changes. These types changed from type aliases to structs to improve
- –`github.com/charmbracelet/bubbletea/v2` - now moved to `charm.land/bubbletea/v2`
- –`CursorPositionMsg` - now a struct type
- –`KeyboardEnhancementsMsg` - now a struct type
- –`PasteMsg` - now a struct type
- –`CapabilityMsg` - now a struct type
This new beta release includes a number of fixes related to the renderer.
- –fix: renderer: avoid requesting keyboard enhancements on close (@aymanbagabas)
- –fix: renderer: ensure we reset cursor style and color on close (@aymanbagabas)
- –fix: renderer: only move cursor to bottom when we're in the main screen (@aymanbagabas)
- –fix: renderer: sync buffer resize with frame rate (@aymanbagabas)
Top in Developer Tools
Related Repositories
Discover similar tools and frameworks used by developers
Swag
CLI tool that generates Swagger 2.0 API documentation from Go source code annotations.
moq
Mock .NET objects using lambda expressions and LINQ.
whatsmeow
Go client library for WhatsApp web multidevice protocol.
nvm
Per-user Node.js version manager for switching between installed versions via command line on POSIX-compliant shells.
googletest
xUnit-based C++ testing framework with integrated mocking.