Navigate:
Bubble Tea
~$BUBB0.7%

Bubble Tea: Go TUI framework

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

LIVE RANKINGS • 01:59 PM • STEADY
TOP 50TOP 50TOP 50TOP 50TOP 50TOP 50TOP 50TOP 50TOP 50TOP 50TOP 50TOP 50
OVERALL
#31
7
DEVELOPER TOOLS
#6
1
30 DAY RANKING TREND
ovr#31
·Devel#6
STARS
39.5K
FORKS
1.1K
7D STARS
+261
7D FORKS
+1
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

Synchronized output updates and enhanced terminal mode reporting

  • Add SupportsKeyDisambiguation to KeyboardEnhancementsMsg
  • Add synchronized updates option to renderer interface
  • Introduce ModeReportMsg for terminal mode reports
  • Query terminal for synchronized output support (mode 2026)
  • Renderer: use uv altscreen helpers
vv2.0.0-rc.1

Module name change and message type improvements from aliases to structs

  • `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

Renderer fixes for keyboard enhancements and cursor management

  • Fix: renderer: avoid requesting keyboard enhancements on close
  • Fix: renderer: ensure we reset cursor style and color on close
  • Fix: renderer: only move cursor to bottom when we're in the main screen
  • Fix: renderer: sync buffer resize with frame rate


[ EXPLORE MORE ]

Related Repositories

Discover similar tools and frameworks used by developers