# Bubbletea
Link: [GitHub - charmbracelet/bubbletea: A powerful little TUI framework 🏗](https://github.com/charmbracelet/bubbletea)
Describe the go framework bubbletea by charmbracelet.
> [!ai]+ AI
>
> Bubbletea is an open-source Go framework developed by Charmbracelet. It is inspired by the [[Elm Architecture]] and The Interactive Program designs and is used for building modern and charming terminal applications.
> The framework provides a functional and declarative approach for constructing interactive applications, making it a great fit for building command-line tools, terminal-based games, interactive scripts, or even TUIs (Text-based User Interfaces). It also integrates well with other Charmbracelet libraries like Lip Gloss and Glamour, which allows developers to create aesthetically pleasing interfaces.
> Bubbletea's architecture revolves around three fundamental concepts: Models, Messages, and Update functions. The Model represents the current state of the program; Messages are events that can modify the state; Update functions handle messages to update the model. This architectural pattern enables a clean separation between logic and presentation layers, leading to more manageable code.
> With Bubbletea's event-driven nature and its meticulous handling of state changes, developers can build robust applications that are easy to test, debug, understand, and maintain.
Found this while I was reading the docs:
- [Zeichenorientierte Benutzerschnittstelle – Wikipedia](https://de.wikipedia.org/wiki/Zeichenorientierte_Benutzerschnittstelle)
## Cool widgets
### Bubbleprompt
- [Intro | Bubbleprompt](https://www.aschey.tech/bubbleprompt) to build REPLs, it seems

> [!ai]+ Claude
> Here is a summary of the bubbleprompt widget for the CLI framework bubbletea:
>
> Bubbleprompt consists of four main components:
>
> - Input - Defines the text input area where users enter commands. There are several input types like Simple, Command, Lexer, and Parser.
>
> - Input Handler - Handles command completion and execution. The Complete method generates suggestions, Execute runs on enter press, and Update is the standard Bubbletea update loop.
>
> - Suggestion Manager - Manages rendering the suggestion list dropdown. Bubbletea provides a default implementation.
>
> - Renderer - Renders the final output to the screen. There is an Unmanaged default that prints directly to the terminal history, and a Viewport renderer for controlling width/height.
>
> Together these components allow creating interactive CLI applications with Bubbletea. The input handles user input and suggestions. The input handler provides command completion and execution. And renderers control how output is displayed.
### Bubbles
These come straight from [[charm.sh]] themselves:
- [GitHub - charmbracelet/bubbles: TUI components for Bubble Tea 🫧](https://github.com/charmbracelet/bubbles)
> Here is a list of the main widgets provided by bubbles along with a brief description of each:
>
> - Spinner - A spinning animation to indicate loading/processing
> - Text Input - A text field for user input
> - Text Area - A text area for multi-line user input
> - Table - For displaying tabular data
> - Progress Bar - A progress indicator
> - Paginator - For pagination logic and UI
> - Viewport - A scrollable viewport component
> - List - For listing and selecting items
> - File Picker - For picking files from the filesystem
> - Timer - For countdown timers
> - Stopwatch - For counting up
> - Help - Generates help text from key bindings
> - Key - Manages key bindings
### Bubbleboxer
- [GitHub - treilik/bubbleboxer](https://github.com/treilik/bubbleboxer)
A box model renderer to put multiple bubbles into a box layout.
### Bubble-table
- [GitHub - Evertras/bubble-table: A customizable, interactive table component for the Bubble Tea framework](https://github.com/Evertras/bubble-table)
A table for bubbletea

### Teacup
- [GitHub - mistakenelf/teacup: A collection of bubbles and utilities for bubbletea applications](https://github.com/mistakenelf/teacup)
Brings the following widgets:
- file tree
- code syntax highlighting
- help
- statusbar
- markdown
- PDF
- image
### Promptkit
- [GitHub - erikgeiser/promptkit: Go prompt library](https://github.com/erikgeiser/promptkit)
This is I think a version of gum widgets but running in a blocking manner for simple use within a go program to add a bit of pizzazz.