Higher-order TUI components for Bubble Tea, composed from Bubbles primitives.
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:
- Bubble Tea — the TUI framework
- Bubbles — the primitive components foam builds on
- Lip Gloss — styling and layout
