Skip to content
lrstanleyPublic

About

🌸 Bubbletea compositor -- layout, animations, effects, simplified.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

202 stars

Watchers

2 watching

Forks

Latest commit

Β 

History

185 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

banner

πŸ”— Table of Contents

✨ Features

bloom is a layout, compositing, and animation engine for Bubble Tea programs. Describe your view as a tree of rows, columns, and layers, built from your model every frame, and bloom sizes it to the terminal, draws dialogs and toasts on top, animates what changes, and tells you what the mouse is over.

Warning

bloom is still pre-1.0. Its API may change drastically until the v1.0.0 release, so expect breaking changes between versions, and pin the version you use.

  • βœ”οΈ Layout without the math: Row, Column, Grid, and Wrap, with Fixed, Fill, Grow, Percent, and natural-size slots, Min/Max, gaps, alignment, and justification. No more measuring rendered strings and subtracting borders on every resize.
  • βœ”οΈ Responsive by priority: panels marked Collapsible drop out when the terminal is too small, lowest priority first, components can build a different layout for the space they're given, and MinSize shows a "window too small" note in place of a layout that can't fit.
  • βœ”οΈ Real layers: Overlay draws dialogs, dropdowns, popovers, and toasts over the screen, anchored to a corner or to another node, with backdrops, drop shadows, and modal input.
  • βœ”οΈ Mouse handlers: clicks, double clicks, the wheel, hover, and drags go to handlers on the nodes they belong to, like bloom.Text(name).On(on.Click(m.open)). Hover styles and drag capture are built in.
  • βœ”οΈ Focus: tab order from the layout, styles for the focused node, the real terminal cursor, and focus scopes that keep tab inside a dialog until it closes.
  • βœ”οΈ Tooltips: Tooltip("Deploy") on any node, and text cut short with "…" unfolds in place under the pointer, with placement that hides the least of the screen, a status line sink, and keyboard access through focus and pinning.
  • βœ”οΈ Animation kept in your model: eased and spring values, presences for showing and hiding (with ShowFor for toasts that hide themselves), sequences of steps, and automatic layout animation with Animate().
  • βœ”οΈ 25+ cell effects: Fade, Slide, Iris, Unfold, Decode, Glitch, and more as transitions; Dim, Desaturate, Recolor, and Spotlight as backdrops; Shake, Shimmer, Roll, and Burst for feedback; Chase, Pulse, Comet, and March for looping borders; and combinators to stagger, delay, reverse, and ease them. Or write your own.
  • βœ”οΈ Borders that do more: put titles, clickable tabs, icon buttons, and counters on a box's border with Edge, plus draggable scrollbars that only show up when there's more to scroll.
  • βœ”οΈ Viewports for a lot of text: Viewport shows a Buffer of lines, such as a log of a million, drawing only those in sight, with wrapping, following the end, line numbers, search marks, and selection.
  • βœ”οΈ Loading placeholders: Skeleton(8, 0, 5, 11) draws shimmering bars in place of content that's still loading, a line for each line of the content, so nothing jumps when it arrives.
  • βœ”οΈ FIGlet text: package fig draws big text in 67 bundled FIGlet and TOIlet fonts, laid out as C figlet does, with gradients and other paints, smaller fonts as space runs short, and letters animated one at a time with bloom's effects and layout animation.
  • βœ”οΈ Works with existing components: anything with a View() string method, including Bubbles components, is a leaf in the tree.
  • βœ”οΈ Fast: strings are parsed once, Lip Gloss renders are cached, and unchanged frames aren't composited again. A 200Γ—60 dashboard animating a dialog over a dimmed backdrop takes about 0.45ms a frame.

βš™οΈ Usage

Take a look at the official documentation for tutorials, guides, and reference, starting with building your first layout. The documentation is also available for LLMs and agents as llms.txt and llms-full.txt, and every page has a markdown version.

func (m *model) View() tea.View {
	v := m.ui.View(m.width, m.height, bloom.Overlay(
		bloom.Column(
			bloom.Fill(bloom.Row(
				bloom.Fixed(24, m.sidebar).Collapsible(1),
				bloom.Fill(m.reader).Min(40),
			)),
			m.statusbar,
		),
		bloom.Layer(m.dialog).
			Modal().
			Backdrop(fx.Dim{Amount: 0.5}).
			Presence(m.dialogAnim, fx.Fade{}, fx.Slide{From: bloom.Bottom}),
		bloom.Layer(m.toast).
			Anchor(bloom.End, bloom.End).
			Presence(m.toastAnim, fx.Slide{From: bloom.Right}),
	))
	v.AltScreen = true
	return v
}

The model keeps a *bloom.Root from bloom.New(), returns m.ui.Init() from Init, and passes every message to m.ui.Update. Build your first layout walks through a complete program, and Add bloom to an existing program converts one you already have.

Runnable programs, from a basic layout to a 120 FPS dashboard, are in _examples. Run one with go run ./forms from that directory.

go get -u bloomfx.dev/bloom@latest

bloom needs Go 1.27 or newer, Bubble Tea v2 (charm.land/bubbletea/v2), and Lip Gloss v2 (charm.land/lipgloss/v2). It isn't built for Bubble Tea v1; see Installation.

Related libraries

  • bubbletint: hundreds of terminal color themes for Bubble Tea and Lip Gloss, which work directly in bloom's styles and effects.
  • steep: a test harness that runs terminal programs, including Bubble Tea programs, in an emulated terminal, used for bloom's own end-to-end tests. Docs are at getsteep.dev.

πŸ™‹β€β™‚οΈ Support & Assistance

  • ❀️ Please review the Code of Conduct for guidelines on ensuring everyone has the best experience interacting with the community.
  • πŸ™‹β€β™‚οΈ Take a look at the support document on guidelines for tips on how to ask the right questions.
  • 🐞 For all features/bugs/issues/questions/etc, head over here.

🀝 Contributing

  • ❀️ Please review the Code of Conduct for guidelines on ensuring everyone has the best experience interacting with the community.
  • πŸ“‹ Please review the contributing doc for submitting issues/a guide on submitting pull requests and helping out.
  • πŸ—οΈ For anything security related, please review this repositories security policy.

βš–οΈ License

MIT License

Copyright (c) 2026 Liam Stanley <liam@liam.sh>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Also located here

About

🌸 Bubbletea compositor -- layout, animations, effects, simplified.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

202 stars

Watchers

2 watching

Forks

Releases

Sponsor this project

Used by

Contributors

Languages