Skip to content

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)
Step-by-step guide: how to use Lip GlossInstall, first run, examples, tips and FAQs

How to get it

  1. 1

    Install with a package manager

    You'll need: Go

    Install the library

    go get charm.land/lipgloss/v2
  2. 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. 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

ProjectStarsTypeLevelUpdatedBest for
lipgloss (this)12kLibraryintermediate4 days agoGo developers building terminal user interfaces
tview14.1kLibraryintermediate3 months agoGo developers building interactive command-line tools with menus, forms, or tables
bubbletea45.6kLibraryintermediate4 days agoGo developers who want to build interactive command-line tools with a visual interface
superfile24kAppbeginner7 days agoPeople who spend a lot of time in the terminal and want a visual file browser there
gh-dash12.7kCLIintermediate10 days agoDevelopers who spend most of their day in the terminal
ratatui23.1kLibraryintermediate5 days agoRust 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.