Skip to content

Repository files navigation

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

About

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

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages