tui-component-browser
Skill2 starsChanged 34 days agoApache-2.0View on GitHub
Before writing a new TUI feature, browse the Charm component libraries for existing components. USE WHEN starting a new Bubble Tea screen, picking between custom and existing components, or unsure which component fits. Uses WebFetch to grab the source of relevant components from charmbracelet/bubbles and charmbracelet/huh.
In this repository41 other files it gives its agents.
- AGENTS.mdAGENTS.md
- CLAUDE.mdCLAUDE.md
- 12-principles-of-animationSkill
- aip-namingSkill
- architectSkill
- babysit-abortSkill
- babysit-prSkill
- babysit-tickSkill
- baseline-uiSkill
- commit-pushSkill
- complex-refactorSkill
- critiqueSkill
- deadSkill
- devstackSkill
- go-backendSkill
- goSkill
- go-strictSkill
- greptileSkill
- impl-checkSkill
- inspect-dbSkill
- inspect-deploySkill
- inspect-runtimeSkill
- interaction-designSkill
- issue-planSkill
- lessonsSkill
- mergeSkill
- new-resourceSkill
- plan-featureSkill
- preflightSkill
- pr-reviewSkill
- review-fixSkill
- reviewSkill
- shipSkill
- simplifySkill
- task-execution-protocolSkill
- teamSkill
- tui-design-labSkill
- tui-designSkill
- verifySkill
- wrap-upSkill
- write-docsSkill
The file
We split this skill into the rules it gives an agent
8 rules. About 0 are common, 6 are distinctive, and 2 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈6
Distinctive · estimate
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 9
Before writing a custom Bubble Tea component, check the Charm libraries.
- Distinctive: line 19
Match the need to a component: Use the table below as a starting point.
- Distinctive: line 21
Read the component source: If a candidate exists, fetch its source to confirm the API fits:
- Distinctive: line 25
Decide: Use the existing component unless it provably doesn't fit.
- Distinctive: line 55
If you're rolling your own:
- Very specific: line 58
Follow the same Init/Update/View pattern as bubbles.
- Distinctive: line 59
Add a snapshot test.
- Very specific: line 70
Help text consistency: Use bubbles/help.Model with key.NewBinding(key.WithHelp(...)) so every screen's help row reads the same way.
≈ “Common” is an estimate: at least 1 in 5 of the 408,460 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
TUI Component Browser
Before writing a custom Bubble Tea component, check the Charm libraries. Reinventing burns time and ships inconsistent UX.
Workflow
- Identify the need. What does the user need to do? (Pick, type, scroll, watch progress, see a list, edit a long string, confirm.)
- Browse the catalog. Fetch the index of each library:
WebFetch https://github.com/charmbracelet/bubbles-> see the README's component list.WebFetch https://github.com/charmbracelet/huh-> see the README's form primitives.
- Match the need to a component. Use the table below as a starting point.
- Read the component source. If a candidate exists, fetch its source to confirm the API fits:
WebFetch https://github.com/charmbracelet/bubbles/blob/master/<component>/<component>.goWebFetch https://github.com/charmbracelet/huh/blob/main/<primitive>.go
- Decide. Use the existing component unless it provably doesn't fit. "It would feel slightly different" is not a reason to roll your own.
Need -> component map
| Need | Library | Component | Notes |
| Pick from a list (single) | huh | huh.NewSelect[T] | Form primitive, embed in form or use standalone. |
| Pick from a list (multi) | huh | huh.NewMultiSelect[T] | Same as above. |
| Free text input | huh | huh.NewInput | Validation, masking, placeholder support. |
| Confirm yes/no | huh | huh.NewConfirm | Default focus on the safe option. |
| Note / instruction | huh | huh.NewNote | Markdown-style content step. |
| Loading spinner | bubbles | spinner.New(spinner.Moon) | Moon for thinking, Dot for short waits. |
| Measurable progress | bubbles | progress.New() | Animate via progress.IncrPercent. |
| Scrollable view | bubbles | viewport.New(w, h) | Set content via viewport.SetContent. |
| Selectable list | bubbles | list.New(items, delegate, w, h) | Built-in filter and pagination. |
| Tabular data | bubbles | table.New(...) | Sortable columns, keyboard navigation. |
| Pagination control | bubbles | paginator.New() | Dots-style page indicator. |
| Single-line text input | bubbles | textinput.New() | Lower-level than huh.NewInput. |
| Multi-line text input | bubbles | textarea.New() | For longer-form editing. |
| File picker | huh | huh.NewFilePicker | Browse + pick a path. |
| Key bindings | bubbles | key.NewBinding | Centralizes help text and binding. |
| Help panel | bubbles | help.New() | Renders key bindings as a help row. |
When to roll your own
Custom components are justified when:
- The interaction model doesn't exist in either library (rare).
- The visual treatment requires a layout primitive not in lipgloss.
- The component is genuinely Mazarbul-specific (e.g. the Watchword block, the entity provenance trail).
If you're rolling your own:
- Live under
internal/tui/<screen>/components/if scoped to one screen. - Live under
internal/tui/components/if shared across screens. - Follow the same
Init/Update/Viewpattern as bubbles. - Add a snapshot test.
Reading the source
Charm code is small and readable. When in doubt, read the component's view.go and update.go. The conventions you'll pick up apply across the whole stack.
Gotchas
- Different
Updatesignatures. Some components returntea.Cmd, some return(Model, tea.Cmd). Read before integrating. - Theme integration. Some components accept a styles struct (e.g.
list.DefaultStyles()). Override viainternal/tui/style.Themeaccessors, not raw hex. - Key binding conflicts. Embedded components may bind keys that the host model also wants. Use
key.Binding.SetEnabled(false)to suppress when the host has focus. - Help text consistency. Use
bubbles/help.Modelwithkey.NewBinding(key.WithHelp(...))so every screen's help row reads the same way.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

