Skip to content

fix(deps): update module github.com/charmbracelet/lipgloss to v2#164

Open
renovate[bot] wants to merge 1 commit intomainfrom
renovate/github.com-charmbracelet-lipgloss-2.x
Open

fix(deps): update module github.com/charmbracelet/lipgloss to v2#164
renovate[bot] wants to merge 1 commit intomainfrom
renovate/github.com-charmbracelet-lipgloss-2.x

Conversation

@renovate
Copy link
Contributor

@renovate renovate bot commented Feb 24, 2026

This PR contains the following updates:

Package Change Age Confidence
github.com/charmbracelet/lipgloss v0.6.0v2.0.0 age confidence

Release Notes

charmbracelet/lipgloss (github.com/charmbracelet/lipgloss)

v2.0.0

Compare Source

lipgloss-v2-block

Do you think you can handle Lip Gloss v2?

We’re really excited for you to try Lip Gloss v2! Read on for new features and a guide to upgrading.

If you (or your LLM) just want the technical details, take a look at Upgrade Guide.

[!NOTE]
We take API changes seriously and strive to make the upgrade process as simple as possible. We believe the changes bring necessary improvements as well as pave the way for the future. If something feels way off, let us know.

What’s new?

The big changes are that Styles are now deterministic (λipgloss!) and you can be much more intentional with your inputs and outputs. Why does this matter?

Playing nicely with others

v2 gives you precise control over I/O. One of the issues we saw with the Lip Gloss and Bubble Tea v1s is that they could fight over the same inputs and outputs, producing lock-ups. The v2s now operate in lockstep.

Querying the right inputs and outputs

In v1, Lip Gloss defaulted to looking at stdin and stdout when downsampling colors and querying for the background color. This was not always necessarily what you wanted. For example, if your application was writing to stderr while redirecting stdout to a file, the program would erroneously think output was not a TTY and strip colors. Lip Gloss v2 gives you control over this.

Going beyond localhost

Did you know TUIs and CLIs can be served over the network? For example, Wish allows you to serve Bubble Tea and Lip Gloss over SSH. In these cases, you need to work with the input and output of the connected clients as opposed to stdin and stdout, which belong to the server. Lip Gloss v2 gives you flexibility around this in a more natural way.

🧋 Using Lip Gloss with Bubble Tea?

Make sure you get all the latest v2s as they’ve been designed to work together.

# Collect the whole set.
go get charm.land/bubbletea/v2
go get charm.land/bubbles/v2
go get charm.land/lipgloss/v2

🐇 Quick upgrade

If you don't have time for changes and just want to upgrade to Lip Gloss v2 as fast as possible? Here’s a quick guide:

Use the compat package

The compat package provides adaptive colors, complete colors, and complete adaptive colors:

import "charm.land/lipgloss/v2/compat"

// Before
color := lipgloss.AdaptiveColor{Light: "#f1f1f1", Dark: "#cccccc"}

// After
color := compat.AdaptiveColor{Light: lipgloss.Color("#f1f1f1"), Dark: lipgloss.Color("#cccccc")}

compat works by looking at stdin and stdout on a global basis. Want to change the inputs and outputs? Knock yourself out:

import (
	"charm.land/lipgloss/v2/compat"
	"github.com/charmbracelet/colorprofile"
)

func init() {
	// Let’s use stderr instead of stdout.
	compat.HasDarkBackground = lipgloss.HasDarkBackground(os.Stdin, os.Stderr)
	compat.Profile = colorprofile.Detect(os.Stderr, os.Environ())
}
Use the new Lip Gloss writer

If you’re using Bubble Tea with Lip Gloss you can skip this step. If you're using Lip Gloss in a standalone fashion, however, you'll want to use lipgloss.Println (and lipgloss.Printf and so on) when printing your output:

s := someStyle.Render("Fancy Lip Gloss Output")

// Before
fmt.Println(s)

// After
lipgloss.Println(s)

Why? Because lipgloss.Println will automatically downsample colors based on the environment.

That’s it!

Yep, you’re done. All this said, we encourage you to read on to get the full benefit of v2.

👀 What’s changing?

Only a couple main things that are changing in Lip Gloss v2:

  • Color downsampling in non-Bubble-Tea uses cases is now a manual proccess (don't worry, it's easy)
  • Background color detection and adaptive colors are manual, and intentional (but optional)
🪄 Downsampling colors with a writer

One of the best things about Lip Gloss is that it can automatically downsample colors to the best available profile, stripping colors (and ANSI) entirely when output is not a TTY.

If you're using Lip Gloss with Bubble Tea there's nothing to do here: downsampling is built into Bubble Tea v2. If you're not using Bubble Tea you now need to use a writer to downsample colors. Lip Gloss writers are a drop-in replacement for the usual functions found in the fmt package:

s := someStyle.Render("Hello!")

// Downsample and print to stdout.
lipgloss.Println(s)

// Render to a variable.
downsampled := lipgloss.Sprint(s)

// Print to stderr.
lipgloss.Fprint(os.Stderr, s)
🌛 Background color detection and adaptive colors

Rendering different colors depending on whether the terminal has a light or dark background is an awesome power. Lip Gloss v2 gives you more control over this progress. This especially matters when input and output are not stdin and stdout.

If that doesn’t matter to you and you're only working with stdout you skip this via compat above, though we encourage you to explore this new functionality.

With Bubble Tea

In Bubble Tea, request the background color, listen for a BackgroundColorMsg in your update, and respond accordingly.

// Query for the background color.
func (m model) Init() tea.Cmd {
	return tea.RequestBackgroundColor
}

// Listen for the response and initialize your styles accordigly.
func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
	switch msg := msg.(type) {
	case tea.BackgroundColorMsg:
		// Initialize your styles now that you know the background color.
		m.styles = newStyles(msg.IsDark())
		return m, nil
	}
}

type styles {
    myHotStyle lipgloss.Style
}

func newStyles(bgIsDark bool) (s styles) {
	lightDark := lipgloss.LightDark(bgIsDark) // just a helper function
	return styles{
		myHotStyle := lipgloss.NewStyle().Foreground(lightDark("#f1f1f1", "#​333333"))
	}
}
Standalone

If you're not using Bubble Tea you simply can perform the query manually:

// Detect the background color. Notice we're writing to stderr.
hasDarkBG, err := lipgloss.HasDarkBackground(os.Stdin, os.Stderr)
if err != nil {
    log.Fatal("Oof:", err)
}

// Create a helper for choosing the appropriate color.
lightDark := lipgloss.LightDark(hasDarkBG)

// Declare some colors.
thisColor := lightDark("#C5ADF9", "#​864EFF")
thatColor := lightDark("#​37CD96", "#​22C78A")

// Render some styles.
a := lipgloss.NewStyle().Foreground(thisColor).Render("this")
b := lipgloss.NewStyle().Foreground(thatColor).Render("that")

// Print to stderr.
lipgloss.Fprintf(os.Stderr, "my fave colors are %s and %s...for now.", a, b)

🥕 Other stuff

Colors are now color.Color

lipgloss.Color() now produces an idiomatic color.Color, whereas before colors were type lipgloss.TerminalColor. Generally speaking, this is more of an implementation detail, but it’s worth noting the structural differences.

// Before
type TerminalColor interface{/* ... */}
type Color string

// After
func Color(string) color.Color
type RGBColor struct{R, G, B uint8}

func LightDark(isDark bool) LightDarkFunc
type LightDarkFunc func(light, dark color.Color) color.Color
func Complete(colorprofile.Profile) CompleteFunc
type CompleteFunc func(ansi, ansi256, truecolor color.Color) color.Color

Changelog

New!
  • b259725e46e9fbb2af6673d74f26917ed42df370: feat(blending): early return when steps <= num stops (#​566) (@​lrstanley)
  • 71dd8ee66ac1f4312844a792952789102513c9c5: feat(borders): initial border blend implementation (#​560) (@​lrstanley)
  • 2166ce88ec1cca66e8a820a86baafd7cfd34bcd0: feat(canvas): accept any type as layer content (@​aymanbagabas)
  • 0303864674b37235e99bc14cd4da17c409ec448e: feat(colors): refactor colors sub-package into root package (@​lrstanley)
  • 9c86c1f950fbfffd6c56a007de6bd3e61d67a1ea: feat(colors): switch from int to float64 for inputs (@​lrstanley)
  • 0334bb4562ca1f72a684c1c2a63c848ac21fffc6: feat(tree): support width and indenter styling (#​446) (@​dlvhdr)
  • 9a771f5a242df0acf862c7acd72124469eb4635a: feat: BlendLinear* -> Blend* (@​lrstanley)
  • 34443e82a7ddcbe37b9dc0d69b84385e400b8a5c: feat: add brightness example, misc example tweaks (@​lrstanley)
  • c95c5f3c5b27360d344bf82736a8ce9257aaf71e: feat: add hyperlink support (#​473) (@​aymanbagabas)
  • 5e542b8c69a0f20ea62b2caa422bbee5337fbb48: feat: add underline style and color (@​aymanbagabas)
  • d3032608aa74f458a7330e17cc304f1ebb5fa1b9: feat: add wrap implementation preserving styles and links (#​582) (@​aymanbagabas)
  • 7bf18447c8729839ca7e79aa3ba9aa00ecb8f963: feat: further simplify colors in examples (@​lrstanley)
  • 27a8cf99a81d1bd5ab875cd773ac8647320b02ba: feat: implement uv Drawable for Canvas and Layer (@​aymanbagabas)
  • c4c08fc4f8a107b00bc54407ad9094b9642dd103: feat: implement uv.Drawable for *Layer (#​607) (@​ayn2op)
  • 18b4bb86c515f93eede5720fe66b0d9ba83fa489: feat: initial implementation of color blending & brightness helpers (@​lrstanley)
  • 63610090044b782caa8ce8b1b53cc81b98264eaa: feat: update examples/layout to use colors.BlendLinear1D (@​lrstanley)
  • de4521b8baa33c49a96e9458e9d9213c7ba407bd: feat: update examples/list/sublist to use colors.BlendLinear1D (@​lrstanley)
  • 1b3716cc53b5cc29c2b1b0c655a684b797fef075: feat: use custom hex parsing for increased perf (@​lrstanley)
Fixed
  • 06ca257e382fa107afcfe147c9cda836b3cdb4be: fix(canvas): Hit method should return Layer ID as string instead of *Layer (@​aymanbagabas)
  • d1fa8790efbd70df8b0dd8bd139434f3ac6e063b: fix(canvas): handle misc edge cases (#​588) (@​lrstanley)
  • 7869489d8971e2e3a8de8e0a4a1e1dfe4895a352: fix(canvas): simplify Render handling (@​aymanbagabas)
  • 68f38bdee72b769ff9c137a4097d9e64d401b703: fix(ci): use local golangci config (@​aymanbagabas)
  • ff11224963a33f6043dfb3408e67c7fea7759f34: fix(color): update deprecated types (@​aymanbagabas)
  • 3f659a836c78f6ad31f5652571007cb4ab9d1eb8: fix(colors): update examples to use new method locations (@​lrstanley)
  • 3248589b24c9894694be6d1862817acb77e119cc: fix(layers): allow recursive rendering for layers that only contain children (#​589) (@​lrstanley)
  • 6c33b19c3f0a1e7d50ce9028ef4bda3ca631cd68: fix(lint): remove nolint:exhaustive comments and ignore var-naming rule for revive (@​aymanbagabas)
  • d267651963ad3ba740b30ecf394d7a5ef86704fc: fix(style): use alias for Underline type from ansi package (@​aymanbagabas)
  • 76690c6608346fc7ef09db388ee82feaa7920630: fix(table): fix wrong behavior of headers regarding margins (#​513) (@​andreynering)
  • 41ff0bf215ea2a444c5161d0bd7fa38b4a70af27: fix(terminal): switch to uv.NewCancelReader for Windows compatibility (@​aymanbagabas)
  • 5d69c0e790f24cbfaa94f8f8b2b64d1bb926c96d: fix: ensure we strip out \r\n from strings when getting lines (@​aymanbagabas)
  • 2e570c2690b61bac103e7eef9da917d1dfc6512d: fix: linear-2d example (@​lrstanley)
  • 0d6a022f7d075e14d61a755b3e9cab9d97519f21: fix: lint issues (@​aymanbagabas)
  • 832bc9d6b9d209e002bf1131938ffe7dbba07652: fix: prevent infinite loop with zero-width whitespace chars (#​108) (#​604) (@​calobozan)
  • 354e70d6d0762e6a54cfc45fe8d019d6087a4c00: fix: rename underline constants to be consistent with other style properties (@​raphamorim)
Docs
  • 60df47f8000b6cb5dfec46af37bceb2c9050bef0: docs(readme): cleanup badges (@​meowgorithm)
  • 881a1ffc54b6afb5f22ead143d10f8dce05e7e66: docs(readme): update art (@​meowgorithm)
  • ee74a03efa8363cf3b17ee7a128b9825c8f3791e: docs(readme): update footer art and copyright date (@​meowgorithm)
  • 8863cc06da67b8ef9f4b6f80c567738fa53bd090: docs(readme): update header image (@​meowgorithm)
  • 4e8ca2d9f045d6bca78ee0150420e26cda8bcccf: docs: add underline styles and colors caveats (@​aymanbagabas)
  • a8cfc26d7de7bdb335a8c7c2f0c8fc4f18ea8993: docs: add v2 upgrade and changes guide (#​611) (@​aymanbagabas)
  • 454007a0ad4e8b60afc1f6fdc3e3424e4d3a4c16: docs: update comments in for GetPaddingChar and GetMarginChar (@​aymanbagabas)
  • 95f30dbdc90cc409e8645de4bd2296a33ba37c70: docs: update mascot header image (@​aymanbagabas)
  • a06a847849dbd1726c72047a98ab8cce0f73a65f: docs: update readme in prep for v2 (#​613) (@​aymanbagabas)
Other stuff
  • 5ca0343ec7be2e85521e79734f4392cdb19e4949: Fix(table): BorderRow (#​514) (@​bashbunni)
  • f2d1864a58cd455ca118e04123feae177d7d2eef: Improve performance of maxRuneWidth (#​592) (@​clipperhouse)
  • 10c048e361129dd601eb6ff8c0c2458814291156: Merge v2-uv-canvas into v2-exp (@​aymanbagabas)
  • d02a007bb19e14f6bf351ed71a47beb6bee9cae3: ci: sync dependabot config (#​521) (@​charmcli)
  • 8708a8925b60c610e68b9aa6e509ebd513a8244e: ci: sync dependabot config (#​561) (@​charmcli)
  • 7d1b622c64d1a68cdc94b30864ae5ec3e6abc2dd: ci: sync dependabot config (#​572) (@​charmcli)
  • 19a4b99cb3bbbd2ab3079adc500faa1875da87e8: ci: sync golangci-lint config (@​aymanbagabas)
  • a6c079dc8a3fc6e68a00214a767627ec8447adb5: ci: sync golangci-lint config (@​aymanbagabas)
  • 350edde4903bcc2eee5a8ce1552dd90c3b89c125: ci: sync golangci-lint config (#​553) (@​github-actions[bot])
  • 1e3ee3483a907facd98ca0a56f6694a0e9365f26: ci: sync golangci-lint config (#​598) (@​github-actions[bot])
  • e729228ac14e63057e615a2241ce4303d59fef08: lint: fix lint for newer go versions (#​540) (@​andreynering)
  • 66093c8cf3b79596597c1e39fd4c67a954010fb3: perf: remove allocations from getFirstRuneAsString (#​578) (@​clipperhouse)
  • ad876c4132d61951d091a1a535c27237f6a90ad6: refactor: new Canvas, Compositor, and Layer API (#​591) (@​aymanbagabas)
  • 3aae2866142214f5b8ce9cbfc1939645928dcb8f: refactor: update imports to use charm.land domain (@​aymanbagabas)

🌈 Feedback

That's a wrap! Feel free to reach out, ask questions, and let us know how it's going. We'd love to know what you think.


Part of Charm.

The Charm logo

Charm热爱开源 • Charm loves open source • نحنُ نحب المصادر المفتوحة

v1.1.0

Compare Source

Tables, Improved

In this release, the inimitable @​andreynering and @​bashbunni majorly overhauled on the table sizing and content wrapping algorithms. Tables will now be much smarter on deciding the ideal width of each column, and contents now wraps by default inside cells.

// Table content wraps by default.
t := table.New().
    Headers(someHeaders...).
    Rows(someRows...).
    Width(80)

fmt.Println(t)
// Actually, let's not wrap the content.
t := table.New().
    Headers(someHeaders...).
    Rows(someRows...).
    Width(80).
    Wrap(false)

fmt.Println(t)

New Border Styles

Also, we added two new border styles that you can use to generate tables in Markdown and ASCII styles.

Markdown Tables

To render tables correctly for Markdown you'll want to use lipgloss.MarkdownBorder and disable the top and bottom borders.

t := table.New().
    Headers(someHeaders...).
    Rows(someRows).
    Border(lipgloss.MarkdownBorder()).
    BorderTop(false).
    BorderBottom(false)

fmt.Println(t)
ASCII Tables

To render an ASCII-style table use lipgloss.ASCIIBorder.

t := table.New().
    Headers(someHeaders...).
    Rows(someRows).
    Border(lipgloss.ASCIIBorder())

fmt.Println(t)

Thanks everyone

Special thanks to @​aymanbagabas, @​bashbunni, @​andreynering, and @​caarlos0 for or all the work on this release!


Changelog

New Features
Bug fixes
Other work

The Charm logo

Thoughts? Questions? We love hearing from you. Feel free to reach out on Twitter, The Fediverse, or on Discord.

v1.0.0

Compare Source

At last: v1.0.0

This is an honorary release indicating that Lip Gloss is now stable. Thank you, open source community, for all your love, support, contributions, and great style.

Stay tuned for a v2 alpha!

v0.13.1

Compare Source

Table improvements, on stream

@​bashbunni went to town in this release and fixed a bunch of bugs, mostly around table. Best of all, she did most of it on stream.

Changelog

Table
Other Stuff

Bonus

New Contributors

Full Changelog: charmbracelet/lipgloss@v0.13.0...v0.13.1


The Charm logo

Thoughts? Questions? We love hearing from you. Feel free to reach out on Twitter, The Fediverse, or on Discord.

v0.13.0

Compare Source

Woodn’t you know, Lip Gloss has trees!

Lip Gloss ships with a tree rendering sub-package.

import "github.com/charmbracelet/lipgloss/tree"

Define a new tree.

t := tree.Root(".").
    Child("A", "B", "C")

Print the tree.

fmt.Println(t)

// .
// ├── A
// ├── B
// └── C

Trees have the ability to nest.

t := tree.Root(".").
    Child("macOS").
    Child(
        tree.New().
            Root("Linux").
            Child("NixOS").
            Child("Arch Linux (btw)").
            Child("Void Linux"),
        ).
    Child(
        tree.New().
            Root("BSD").
            Child("FreeBSD").
            Child("OpenBSD"),
    )

Print the tree.

fmt.Println(t)

Tree Example (simple)

Trees can be customized via their enumeration function as well as using
lipgloss.Styles.

enumeratorStyle := lipgloss.NewStyle().Foreground(lipgloss.Color("63")).MarginRight(1)
rootStyle := lipgloss.NewStyle().Foreground(lipgloss.Color("35"))
itemStyle := lipgloss.NewStyle().Foreground(lipgloss.Color("212"))

t := tree.
    Root("⁜ Makeup").
    Child(
        "Glossier",
        "Fenty Beauty",
        tree.New().Child(
            "Gloss Bomb Universal Lip Luminizer",
            "Hot Cheeks Velour Blushlighter",
        ),
        "Nyx",
        "Mac",
        "Milk",
    ).
    Enumerator(tree.RoundedEnumerator).
    EnumeratorStyle(enumeratorStyle).
    RootStyle(rootStyle).
    ItemStyle(itemStyle)

Print the tree.

Tree Example (makeup)

The predefined enumerators for trees are DefaultEnumerator and RoundedEnumerator.

If you need, you can also build trees incrementally:

t := tree.New()

for i := 0; i < repeat; i++ {
    t.Child("Lip Gloss")
}

There’s more where that came from

See all the tree examples.


Changelog

New Features
Bug fixes
Documentation updates

The Charm logo

Thoughts? Questions? We love hearing from you. Feel free to reach out on Twitter, The Fediverse, or on Discord.

v0.12.1

Compare Source

Border width calcs: back to normal

This release fixes a regression with regard to border calculations introduced in Lip Gloss v0.11.1.


The Charm logo

Thoughts? Questions? We love hearing from you. Feel free to reach out on Twitter, The Fediverse, or on Discord.

v0.12.0

Compare Source

Lists, Check ✓

This release adds a new sub-package for rendering trees and lists.

import "github.com/charmbracelet/lipgloss/list"

Define a new list.

l := list.New("A", "B", "C")

Print the list.

fmt.Println(l)

// • A
// • B
// • C

Lists have the ability to nest.

l := list.New(
  "A", list.New("Artichoke"),
  "B", list.New("Baking Flour", "Bananas", "Barley", "Bean Sprouts"),
  "C", list.New("Cashew Apple", "Cashews", "Coconut Milk", "Curry Paste", "Currywurst"),
  "D", list.New("Dill", "Dragonfruit", "Dried Shrimp"),
  "E", list.New("Eggs"),
  "F", list.New("Fish Cake", "Furikake"),
  "J", list.New("Jicama"),
  "K", list.New("Kohlrabi"),
  "L", list.New("Leeks", "Lentils", "Licorice Root"),
)

Print the list.

fmt.Println(l)

image

Lists can be customized via their enumeration function as well as using
lipgloss.Styles.

enumeratorStyle := lipgloss.NewStyle().Foreground(lipgloss.Color("99")).MarginRight(1)
itemStyle := lipgloss.NewStyle().Foreground(lipgloss.Color("212")).MarginRight(1)

l := list.New(
  "Glossier",
  "Claire’s Boutique",
  "Nyx",
  "Mac",
  "Milk",
).
  Enumerator(list.Roman).
  EnumeratorStyle(enumeratorStyle).
  ItemStyle(itemStyle)

Print the list.

List example

In addition to the predefined enumerators (Arabic, Alphabet, Roman, Bullet, Tree),
you may also define your own custom enumerator:

l := list.New("Duck", "Duck", "Duck", "Duck", "Goose", "Duck", "Duck")

func DuckDuckGooseEnumerator(l list.Items, i int) string {
    if l.At(i).Value() == "Goose" {
        return "Honk →"
    }
    return ""
}

l = l.Enumerator(DuckDuckGooseEnumerator)

Print the list:

image

If you need, you can also build lists incrementally:

l := list.New()

for i := 0; i < repeat; i++ {
    l.Item("Lip Gloss")
}

The Charm logo

Thoughts? Questions? We love hearing from you. Feel free to reach out on Twitter, The Fediverse, or on Discord.

v0.11.1

Compare Source

A lil’ truncation fix

This release is a small patch release to fix text truncation in table cells. For details see: #​324.

Other stuff

Full Changelog: charmbracelet/lipgloss@v0.11.0...v0.11.1


The Charm logo

Thoughts? Questions? We love hearing from you. Feel free to reach out on Twitter, The Fediverse, or Discord.

v0.11.0

Compare Source

Immutable Styles and Raw Speed, Baby

So! The big news in this release is:

  • Style methods will now always return new styles
  • Style and ANSI operations under the hood are faster

There are also a handful of great lil' bug fixes. Read on for more.

Immutable Styles

Every Style method now returns a completely new style with its own underlying data structure no matter what. This means working with Styles is a lot easier. No more need for Copy()!

// Before
s := lipgloss.NewStyle().Bold(true)
newStyle := s.Copy()

// After
s := lipgloss.NewStyle().Bold(true)
newStyle := s // this is a true copy

Okay, but why are styles easier to work with now? Consider this:

// Before
baseStyle := lipgloss.NewStyle().Background(lipgloss.Color("59"))
styleAtRuntime := baseStyle.Copy().Width(m.Width)

// After
baseStyle := lipgloss.NewStyle().Padding(1, 2)
styleAtRuntime := baseStyle.Width(m.Width)

It might seem small, but eliminating the risk of mutations in persistent styles in an enormous usability improvement.

How to upgrade

There's nothing to do, however Style.Copy() is now deprecated and only returns itself, so you can just remove Style.Copy() calls. If you need to just copy a style without any changes to it you can simply b := a.

Faster ANSI

Sometimes watch companies brag about their "in-house" watch movement. Well, now we're bragging about our in-house-amazing x/ansi library by our own @​aymanbagabas. It's a fine-tuned, low-level way to manage ANSI sequencing and, because we're pretty nerdy, we’re super excited about it.


What's Changed

New!
Changed
Fixed

New Contributors

Full Changelog: charmbracelet/lipgloss@v0.10.0...v0.11.0


The Charm logo

Thoughts? Questions? We love hearing from you. Feel free to reach out on Twitter, The Fediverse, or Discord.

v0.10.0

Compare Source

String Transforms 💄

Lip Gloss v0.10.0 features a brand new Transform function for Styles to alter strings at render time. As well as some bug fixes, like ANSI-aware table cell truncation. 🧹

Simply define a Transform function as func (string) string and apply it to any style:

// Example:
s := NewStyle().Transform(strings.ToUpper)
fmt.Println(s.Render("raow!") // "RAOW!"

Or, if you prefer:

// Example:
reverse := func(s string) string {
    n := 0
    rune := make([]rune, len(s))
    for _, r := range s {
        rune[n] = r
	n++
    }
    rune = rune[0:n]
    for i := 0; i < n/2; i++ {
        rune[i], rune[n-1-i] = rune[n-1-i], rune[i]
    }
    return string(rune)
}

s := NewStyle().Transform(reverse)
fmt.Println(s.Render("The quick brown 狐 jumped over the lazy 犬")
// "犬 yzal eht revo depmuj 狐 nworb kciuq ehT",

What's Changed?

New Contributors

Full Changelog: charmbracelet/lipgloss@v0.9.1...v0.10.0


The Charm logo

Thoughts? Questions? We love hearing from you. Feel free to reach out on Twitter, The Fediverse, or Discord.

v0.9.1

Compare Source

This bugfix release changes the Table Headers API to accept []string for consistency with Row / Rows and downgrades Lip Gloss to Go version v1.17.

What's Changed

Full Changelog: charmbracelet/lipgloss@v0.9.0...v0.9.1

v0.9.0

Compare Source

My, how the tables have turned

Now you can draw Tables with Lip Gloss! 💅

image

View the source code.

Let's get started

import "github.com/charmbracelet/lipgloss/table"

Define some rows of data.

rows := [][]string{
    {"Chinese", "您好", "你好"},
    {"Japanese", "こんにちは", "やあ"},
    {"Arabic", "أهلين", "أهلا"},
    {"Russian", "Здравствуйте", "Привет"},
    {"Spanish", "Hola", "¿Qué tal?"},
}

Use the table package to style and render the table.

t := table.New().
    Border(lipgloss.NormalBorder()).
    BorderStyle(lipgloss.NewStyle().Foreground(lipgloss.Color("99"))).
    StyleFunc(func(row, col int) lipgloss.Style {
        switch {
        case row == 0:
            return HeaderStyle
        case row%2 == 0:
            return EvenRowStyle
        default:
            return OddRowStyle
        }
    }).
    Headers("LANGUAGE", "FORMAL", "INFORMAL").
    Rows(rows...)

// You can also add tables row-by-row
t.Row("English", "You look absolutely fabulous.", "How's it going?")

Print the table.

fmt.Println(t)
Table example

For more on tables see the examples.

Additional Borders

Lip Gloss' Border now supports additional middle border separators.

type Border struct {
    // ...
    MiddleLeft   string
    MiddleRight  string
    Middle       string
    MiddleTop    string
    MiddleBottom string
}

v0.8.0

Compare Source

Predictable Tabs

At last: tabs that render the way you want ’em to. With the new Style.TabWidth() method, you can determine exactly how a \t will render.

Before this release, Lip Gloss used to mis-measure a tab (i.e. a \t) at 0 cells wide when they actually render at different widths in different terminals (usually 8 cells, sometimes 4 cells). For these reasons, tabs are almost never what you want when designing layouts for TUIs.

With this release, a tab will get converted to 4 spaces by default—so this is a behavioral change—but you can customize the behavior as well as disable it entirely.

s := lipgloss.NewStyle()        // 4 spaces per tab, the default
s = s.TabWidth(2)               // 2 spaces per tab
s = s.TabWidth(0)               // remove tabs
s = s.TabWidth(-1)              // don't convert tabs to spaces
s = s.TabWidth(NoTabConversion) // alias of the above

You can disable the feature with Style.TabWidth(NoTabConversion) (or Style.TabWidth(-1), if you're the pedantic type).

Bug Fixes

This release also includes a bunch of bug fixes. This includes:


Full Changelog: charmbracelet/lipgloss@v0.7.1...v0.8.0

v0.7.1

Compare Source

This bugfix release fixes a problem introduced in v0.7.0 where applications could freeze or hang on start-up.

What's Changed

Full Changelog: charmbracelet/lipgloss@v0.7.0...v0.7.1

v0.7.0

Compare Source

Custom Renderers

We're pleased to introduce custom renders for Lip Gloss! Custom renderers allow you to render to a specific outputs, which is particularly important when you want to detect the color profile and dark background status for multiple different outputs at runtime, such as in a server-client situation.

Here's what it looks like:

func myLittleHandler(sess ssh.Session) {
    // Create a renderer for the client.
    renderer := lipgloss.NewRenderer(sess)

    // Create a new style on the renderer.
    style := renderer.NewStyle().Background(lipgloss.AdaptiveColor{Light: "63", Dark: "228"})

    // Render. The color profile and dark background state will be correctly detected.
    io.WriteString(sess, style.Render("Heyyyyyyy"))
}

For a full example on using a custom renderer over SSH with Wish see the SSH example.

New API Stuff

  • type Renderer struct
  • NewRenderer(io.Writer)
  • DefaultRenderer()
  • SetDefaultRenderer(*lipgloss.Renderer)
  • style.Renderer(*lipgloss.Renderer) Style

What's Changed

New
Fixed

New Contributors

Full Changelog: charmbracelet/lipgloss@v0.6.0...v0.7.0


Configuration

📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate bot requested a review from Clivern as a code owner February 24, 2026 22:59
@renovate
Copy link
Contributor Author

renovate bot commented Feb 24, 2026

⚠️ Artifact update problem

Renovate failed to update an artifact related to this branch. You probably do not want to merge this PR as-is.

♻ Renovate will retry this branch, including artifacts, only when one of the following happens:

  • any of the package files in this branch needs updating, or
  • the branch becomes conflicted, or
  • you click the rebase/retry checkbox if found above, or
  • you rename this PR's title to start with "rebase!" to trigger it manually

The artifact failure details are included below:

File name: go.sum
Command failed: go get -t ./...
go: github.com/charmbracelet/lipgloss/v2@v2.0.0: parsing go.mod:
	module declares its path as: charm.land/lipgloss/v2
	        but was required as: github.com/charmbracelet/lipgloss/v2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants