Bubbles

Introduction

Common UI components for Bubble Tea applications.

Some components for Bubble Tea applications. These components are used in production in Glow and many other applications.

Installation

go get github.com/charmbracelet/bubbles/v2

Available Components

Spinner

Indicate loading or processing

Text Input

Single-line text input field

Text Area

Multi-line text input

Table

Display and navigate tabular data

Progress

Customizable progress meter

List

Browsing items with pagination

Viewport

Scrollable content container

File Picker

Navigate and select files

Quick Example

import (
    "github.com/charmbracelet/bubbles/v2/spinner"
    tea "github.com/charmbracelet/bubbletea/v2"
)

type model struct {
    spinner spinner.Model
}

func initialModel() model {
    s := spinner.New()
    s.Spinner = spinner.Dot
    return model{spinner: s}
}

func (m model) Init() (tea.Model, tea.Cmd) {
    return m, m.spinner.Tick
}

func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
    var cmd tea.Cmd
    m.spinner, cmd = m.spinner.Update(msg)
    return m, cmd
}

func (m model) View() string {
    return m.spinner.View() + " Loading..."
}
Check out the Components page for detailed documentation on each component!