
Lip Gloss
A Go library for styling and laying out text in terminal user interfaces.
- Stars
- 12k
- Forks
- 426
- Licence
- MIT
- Language
- Go
- Last update
- 4 days ago
- Type
- Library
What it is
Lip Gloss is a Go library that lets you define styles for text in a terminal, such as colors, bold or underline, padding, margins, alignment, and borders. It uses a CSS-like, declarative approach, so people familiar with CSS can get started quickly. It is built with terminal user interfaces (TUIs) in mind.
- Style headings, labels, and highlighted text with colors and text formatting
- Draw bordered boxes, including custom border characters and gradient-blended border colors
- Add padding, margins, and fixed widths or heights to lay out terminal content
- Create clickable hyperlinks in terminals that support them
- Automatically downgrade colors for terminals or logs with limited color support
Great for
- Go developers building terminal user interfaces
- Developers who already use Bubble Tea and want consistent styling
- People familiar with CSS who want a similar style model in the terminal
- Anyone printing styled, aligned output from a Go command-line program
Not ideal for
- Non-Go projects, since the library is written for Go (reason: it is a Go package)
- People who only need plain text output with no styling (reason: the library adds styling features they would not use)
- Users looking for an end-user application (reason: it is a library that developers include in their own programs)
How to get it
- 1
Install with a package manager
You'll need: Go
Install the library
go get charm.land/lipgloss/v2 - 2
Run it
- Install the library with go get charm.land/lipgloss/v2
- Import charm.land/lipgloss/v2 in your Go program
- Create a style with lipgloss.NewStyle() and set properties such as Bold, Foreground, and Padding
- Call lipgloss.Println(style.Render("text")) to print the styled text
- 3
Get the most out of it
- Use Bubble Tea with Lip Gloss so colors are downsampled automatically without extra work
- Use lipgloss.Println or lipgloss.Sprint for standalone output so colors adapt to the terminal
- Use Inherit and Unset rules to build reusable component styles
- Use the upgrade guide if you are moving from v1 to v2
Downloads
Strengths
- Declarative, CSS-like API that is easy to read and reuse
- Styles are value types, so copying and modifying them does not change the original
- Automatic color downsampling lets one style work across different terminals
Trade-offs
- Requires working knowledge of Go to use
- Terminal rendering support varies, and some features such as hyperlinks degrade in unsupported terminals
- The README is truncated here, so full API coverage and details are not verified
How it compares
| Project | Stars | Type | Level | Updated | Best for |
|---|---|---|---|---|---|
| lipgloss (this) | 12k | Library | intermediate | 4 days ago | Go developers building terminal user interfaces |
| tview | 14.1k | Library | intermediate | 3 months ago | Go developers building interactive command-line tools with menus, forms, or tables |
| bubbletea | 45.6k | Library | intermediate | 5 days ago | Go developers who want to build interactive command-line tools with a visual interface |
| superfile | 24k | App | beginner | 7 days ago | People who spend a lot of time in the terminal and want a visual file browser there |
| gh-dash | 12.7k | CLI | intermediate | 11 days ago | Developers who spend most of their day in the terminal |
| ratatui | 23.1k | Library | intermediate | 5 days ago | Rust developers building interactive command-line tools or dashboards |
Stats synced from GitHub. The assessment above was drafted with AI from the project's README on 2026-10-29 and may miss recent changes — check the README before relying on a command. MIT licence: free to use, modify and distribute, including commercially, as long as you keep the copyright notice.