primer

module
v0.2.7 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2026 License: MIT

README

primer

A Charm-native library of reusable terminal UI primitives.

Packages

Package Description
activity Observational mutation log with monotonic IDs and bounded retention
button Focusable button row with click hit-testing
cache Generic TTL memoizer with newest-fetch-wins commits
carousel Wrapping tab strip with one active label
dialog Modal overlay stack, dialog frame, mouse clicks, and stock dialogs
filter Smart-case text matching with ! negate, ^ prefix, $ suffix modifiers
flash Transient status message state with monotonic-ID expiry
form Multi-field modal form with focus ring, dirty guard, and autocomplete
helpbar Wrapped footer hints
helpsheet Two-column keybinding overlay sheet with dismiss footer
input Text-entry wrappers, textarea factory, and external editor hop
key Key-name constants, inline key highlighting, rebinding, and key replay
layout Line normalization, ANSI-aware hard wrapping, and separator rendering
list Scrollable cursor list over rendered rows with optional type-to-filter
overlay Centered foreground placement over background content
palette Fuzzy type-to-filter command list with replayable keybindings
pick Generic multi-select interactive prompt built on huh
picker Cursor-navigable options overlay with row/choice selection
pill Labeled cycle-selector rendering (label ‹ value ›)
prompt Scrollable modal prompts with choice groups, hints, and interaction state
render Terminal markdown, theme-derived glamour styles, and diff rendering
scrollbar Proportional scrollbar rendering and scroll position math
scrollwheel Mouse wheel event coalescing for Bubble Tea filters
table ANSI-aware column alignment, typed sorting, and generic table rendering
task Generation-tracked async work manager with per-scope staleness
titlebox Rounded box with the title embedded in the top border
view Viewport body rendering and composable fullscreen frame footers

Install

go get github.com/gechr/primer@latest

Directories

Path Synopsis
Package activity is the observational record of user-facing mutations in a Bubble Tea app: it feeds a footer's status slot (the most-recent operation and an in-flight count) and a scrollable operation-log overlay (every recorded mutation, newest-first).
Package activity is the observational record of user-facing mutations in a Bubble Tea app: it feeds a footer's status slot (the most-recent operation and an in-flight count) and a scrollable operation-log overlay (every recorded mutation, newest-first).
Package button renders a horizontal row of focusable buttons - "No Yes", or a lone "OK" - the affordance a confirm dialog puts under its prompt.
Package button renders a horizontal row of focusable buttons - "No Yes", or a lone "OK" - the affordance a confirm dialog puts under its prompt.
Package cache is a session-scoped, in-memory TTL memoizer for slow keyed lookups - the suggestion queries and per-key option lists that would otherwise re-hit a remote source on every keystroke or reopen.
Package cache is a session-scoped, in-memory TTL memoizer for slow keyed lookups - the suggestion queries and per-key option lists that would otherwise re-hit a remote source on every keystroke or reopen.
Package carousel renders a horizontal strip of labels with one active, and wraps navigation around the ends.
Package carousel renders a horizontal strip of labels with one active, and wraps navigation around the ends.
Package dialog is a domain-free stack of modal overlays for a Bubble Tea application.
Package dialog is a domain-free stack of modal overlays for a Bubble Tea application.
Package flash provides state management for transient status messages in Bubble Tea applications.
Package flash provides state management for transient status messages in Bubble Tea applications.
Package form is the modal text-input controller for overlay forms: an ordered set of single- and multi-line fields with one focus ring, a dirty-discard guard (esc on edited content asks yes/no instead of dropping it), a submit/cancel/editor event contract with a consumed-key signal, and a pluggable autocomplete seam (a trigger rune such as @ starts a query; suggestions are fetched asynchronously as commands).
Package form is the modal text-input controller for overlay forms: an ordered set of single- and multi-line fields with one focus ring, a dirty-discard guard (esc on edited content asks yes/no instead of dropping it), a submit/cancel/editor event contract with a consumed-key signal, and a pluggable autocomplete seam (a trigger rune such as @ starts a query; suggestions are fetched asynchronously as commands).
Package input is the shared text-entry substrate: thin wrappers over bubbles/textinput and textarea (Line, Area) plus a textarea factory with overlay-friendly defaults (NewTextArea) and a multi-entry title+body editor (Editor), and the external-editor hop (ExternalEditorCmd).
Package input is the shared text-entry substrate: thin wrappers over bubbles/textinput and textarea (Line, Area) plus a textarea factory with overlay-friendly defaults (NewTextArea) and a multi-entry title+body editor (Editor), and the external-editor hop (ExternalEditorCmd).
Package list is a scrollable, single-selection list of pre-rendered rows.
Package list is a scrollable, single-selection list of pre-rendered rows.
Package palette is a fuzzy, type-to-filter command list for a command-palette dialog.
Package palette is a fuzzy, type-to-filter command list for a command-palette dialog.
Package pill renders a labeled cycle selector - "type ‹ Task ›" - a compact one-of chooser for a form field that needs no text area.
Package pill renders a labeled cycle selector - "type ‹ Task ›" - a compact one-of chooser for a form field that needs no text area.
Package render provides terminal-friendly markdown and diff rendering.
Package render provides terminal-friendly markdown and diff rendering.
Package scrollwheel coalesces rapid mouse wheel events into batched scroll messages, preventing per-event Update + Render cycles from pegging CPU.
Package scrollwheel coalesces rapid mouse wheel events into batched scroll messages, preventing per-event Update + Render cycles from pegging CPU.
Package task is the generation-tracked async work manager for a Bubble Tea app: named scopes group work, every start bumps the scope's monotonic generation, and a finished result is accepted only while its generation is still the latest - so a superseded fetch (the user refreshed again, changed filters, moved on) is dropped instead of overwriting newer state.
Package task is the generation-tracked async work manager for a Bubble Tea app: named scopes group work, every start bumps the scope's monotonic generation, and a finished result is accepted only while its generation is still the latest - so a superseded fetch (the user refreshed again, changed filters, moved on) is dropped instead of overwriting newer state.
Package titlebox draws a rounded box with its title embedded in the top border - "╭ title ─────╮" - around a body the caller has already rendered.
Package titlebox draws a rounded box with its title embedded in the top border - "╭ title ─────╮" - around a body the caller has already rendered.

Jump to

Keyboard shortcuts

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