Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
table
✓ github.com/evertras/bubble-table
Creates a simple Bubble Tea table with two columns and two rows.
package main
import (
"fmt"
"os"
"github.com/charmbracelet/bubbletea"
"github.com/evertras/bubble-table/table"
)
type model struct {
table table.Model
}
func (m model) Init() tea.Cmd { return nil }
func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
var cmd tea.Cmd
m.table, cmd = m.table.Update(msg)
return m, cmd
}
func (m model) View() string {
return m.table.View()
}
func main() {
columns := []table.Column{
table.NewColumn("Name", "Name", 20),
table.NewColumn("Age", "Age", 10),
}
rows := []table.Row{
table.NewRow(table.RowData{"Name": "Alice", "Age": "30"}),
table.NewRow(table.RowData{"Name": "Bob", "Age": "25"}),
}
t := table.New(columns).WithRows(rows)
p := tea.NewProgram(model{table: t})
if err := p.Start(); err != nil {
fmt.Println("Error:", err)
os.Exit(1)
}
}
Debug
Known issues
No known issues recorded.
Upgrade
Version history
0.19.2latest on pkg.go.dev
Audit
Dependencies
No dependency data recorded yet.