github charmbracelet/lipgloss v2.1.0

one hour ago

New table parameter and many fixes

Hi all! This release gives tables a new feature. They can now size themselves to their content and still respect a maximum width. It also comes with a big batch of fixes, many of them from first-time contributors. Let's go!

Fit Content on tables

Screenshot 2026-11-09 at 17 15 17

Until now, setting Width on a table meant it would always stretch to fill that width, even if it only had three short words in it. Now there's FitContent():

t := table.
	Width(72).
    FitContent().
    Headers("LANGUAGE", "FORMAL", "INFORMAL").
    Rows(rows...)

With FitContent, the table renders at the width its content actually needs. Width becomes a ceiling, if the content is wider than that, the table is held to the maximum and wraps like before.

Perfect for sidebars, popups, and anywhere a table shouldn't go far. Thanks, @pete-woods!

Darker Darks, Lighter Lights

Lip Gloss now decides whether a color is dark using CIELAB lightness instead of HSL. In simple words, it now judges dark and light the way your eyes do, so saturated blues and purples are no longer mistaken for light colors. LightDark and friends will pick the right side more often. Thanks, @janearc!

Full-Fidelity RGB

RGBColor channels are now 16 bits, so colors survive the round trip through color.Color without losing precision. Thanks, @MokiMeow!

Faster Wrapping

Wrap now sizes its buffer up front and copies bytes in runs instead of one at a time. Thanks, @taciturnaxolotl!

That's all for now,
Charm XX 💫

Changelog

New!

Fixed

Other stuff


The Charm logo

Thoughts? Questions? We love hearing from you. Feel free to reach out on X, Discord, Slack, The Fediverse, Bluesky.

Don't miss a new lipgloss release

NewReleases is sending notifications on new releases.