pill

package
v0.2.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 16, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package pill renders a labeled cycle selector - "type ‹ Task ›" - a compact one-of chooser for a form field that needs no text area. It is the counterpart to titlebox: where a box frames somewhere to type, a pill frames a value stepped through a fixed set, so the two read as distinct affordances.

Like titlebox it is style-agnostic: the label and chevron colors arrive through Styles, so a caller signals focus by handing it a brighter pair.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Render

func Render(label, value string, labelW int, s Styles) string

Render draws "label<pad>‹ value ›". label is padded on the right to labelW columns so a column of pills aligns their values; a label already at or past labelW is left as is. The value carries no styling of its own - the caller styles it before passing it in if it wants to.

Types

type Styles

type Styles struct {
	// Label styles the field name to the left of the value.
	Label lg.Style
	// Chevron styles the "‹" "›" markers that frame the value.
	Chevron lg.Style
}

Styles are the pill's injected render styles, so the widget stays theme-agnostic: a caller signals focus by handing it a brighter pair.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL