Skip to content

anadale/teaservice

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Teaservice

Components for Bubble Tea v2 applications.

Teatable

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.

teatable showcase

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


Teaware

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.

teaware 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

Installation

go get github.com/anadale/teaservice

About

Components for BubbleTea applications

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages