Components for Bubble Tea v2 applications.
Everything a terminal table should be, without the pain. Frozen columns, column groups, sortable headers, scroll indicators, dividers, and per-row styling — composable, generic, and wired up so you can focus on your data.
import tt "github.com/anadale/teaservice/teatable"
cols := []tt.Column{
tt.NewColumn("id", "ID", tt.WithFixedWidth(4)),
tt.NewColumn("name", "Name", tt.WithFlexRatio(2), tt.WithMinWidth(12)),
tt.NewColumn("dept", "Dept", tt.WithFlexRatio(1), tt.WithMinWidth(8)),
}
tbl := tt.New(source, ctx, cols,
tt.WithRoundedBorder(),
tt.WithTitle("Employees"),
tt.WithFrozenColumns(1),
tt.WithDividers(tt.SimpleDividers()),
tt.WithScrollIndicator(tt.DataOnlyScrollIndicator()),
)Full documentation: teatable/README.md
Examples: basic · paged · stream · showcase
Widget framework for forms: text inputs, textareas, dropdowns, checkboxes, radio
groups, and buttons arranged with Flex and Grid layout containers. Automatic
Tab / Shift+Tab focus navigation is handled by Form.
import "github.com/anadale/teaservice/teaware"
grid := teaware.NewGrid().
Columns(teaware.Auto, teaware.Stretch).
ColumnGap(2).
AddRow(teaware.NewLabel("Name:"), teaware.NewTextInput().Placeholder("Your name")).
AddRow(teaware.NewLabel("Color:"), teaware.NewDropdown([]string{"Blue", "Red", "Green"})).
AddRow(teaware.Span(2, teaware.NewButton("Submit").OnClick(func() tea.Cmd {
return tea.Quit
})))
form := teaware.NewForm(grid)Full documentation: teaware/README.md
Examples: form
go get github.com/anadale/teaservice