foam

package module
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: May 23, 2026 License: MIT Imports: 0 Imported by: 0

README

foam

Latest Release GoDoc Build Status

Higher-order TUI components for Bubble Tea, composed from Bubbles primitives.

Palette

palette/advanced demo

A command palette with pluggable modes — fuzzy-filter a static list, dispatch an async search, or mix both behind different prefixes.

import "github.com/joelzwarrington/foam/palette"

var commands = []palette.Item{
    palette.Command{Name: "Open file"},
    palette.Command{Name: "Save"},
    palette.Command{Name: "Quit"},
}

mode := palette.Mode{
    Name: "commands",
    Items: func(_ palette.Model, q string) []palette.Item {
        return palette.FilterFuzzy(commands, q)
    },
}

p := palette.New(palette.WithModes(mode))

Each palette.Mode owns its own Match, Items, and optional async Search or typeable Facets. The runnable examples below mix several modes:

Built with

License

MIT

Documentation

Overview

Package foam provides higher-order TUI components for Bubble Tea, composed from the primitives in charm.land/bubbles/v2.

Each component lives in its own sub-package and follows the standard bubbles contract: a Model with Init, Update, and View, configured via functional options, with public KeyMap and Styles for theming.

Directories

Path Synopsis
examples
palette/advanced command
Command palette-example runs the palette bubble standalone.
Command palette-example runs the palette bubble standalone.
palette/overlay command
Command palette-overlay shows the palette as a modal layer over a background model — the canonical "modal palette" recipe.
Command palette-overlay shows the palette as a modal layer over a background model — the canonical "modal palette" recipe.
palette/simple command
Command palette-simple is the minimal foam/palette example: a single mode that fuzzy-filters a list of commands as you type — no "> "-style prefix required.
Command palette-simple is the minimal foam/palette example: a single mode that fuzzy-filters a list of commands as you type — no "> "-style prefix required.
Package palette provides a command-palette bubble for Bubble Tea programs.
Package palette provides a command-palette bubble for Bubble Tea programs.

Jump to

Keyboard shortcuts

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