Navigate:
Bubble Tea
~$BUBB0.5%

Bubble Tea: Go TUI framework

Go framework for terminal user interfaces based on The Elm Architecture with inline/fullscreen modes.

LIVE RANKINGS • 07:55 AM • STEADY
TOP 50TOP 50TOP 50TOP 50TOP 50TOP 50TOP 50TOP 50TOP 50TOP 50TOP 50TOP 50
OVERALL
#46
37
DEVELOPER TOOLS
#8
5
30 DAY RANKING TREND
ovr#46
·Devel#8
STARS
39.2K
FORKS
1.1K
7D STARS
+196
7D FORKS
+8
See Repo:
Share:

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.

Bubble Tea

1

Elm Architecture

Implements functional programming patterns with model-update-view architecture for predictable state management.

2

Framerate Renderer

Uses optimized rendering with framerate control to minimize terminal flickering and improve performance.

3

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
}


vv2.0.0-rc.2

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)
vv2.0.0-rc.1

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
vv2.0.0-beta.6

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)


[ EXPLORE MORE ]

Related Repositories

Discover similar tools and frameworks used by developers