Documentation
¶
Index ¶
- type BubbleTable
- type InteractiveTableModel
- type StringBuilderTable
- type Table
- func (t *Table) AppendBulk(rows [][]string)
- func (t *Table) AppendRow(row []string)
- func (t *Table) Render() string
- func (t *Table) RenderToWriter(w fmt.State, verb rune)
- func (t *Table) SetAlignment(align lipgloss.Position)
- func (t *Table) SetAutoWrapText(wrap bool)
- func (t *Table) SetHeaders(headers []string)
- func (t *Table) SetStyle(style TableStyle)
- func (t *Table) UsePlainStyle()
- func (t *Table) UseStyledStyle()
- type TableStyle
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BubbleTable ¶
type BubbleTable struct {
// contains filtered or unexported fields
}
BubbleTable wraps the advanced bubbles/table component
func NewBubbleTable ¶
func NewBubbleTable(headers []string, styled bool) *BubbleTable
NewBubbleTable creates a new interactive table using bubbles/table with terminal-aware sizing
func (*BubbleTable) AppendData ¶
func (bt *BubbleTable) AppendData(data [][]string)
AppendData adds rows to the table
func (*BubbleTable) GetModel ¶
func (bt *BubbleTable) GetModel() table.Model
GetModel returns the underlying bubbles/table model for use in bubbletea apps
func (*BubbleTable) RenderStatic ¶
func (bt *BubbleTable) RenderStatic() string
RenderStatic renders the table as a static string (non-interactive)
func (*BubbleTable) SetData ¶
func (bt *BubbleTable) SetData(data [][]string)
SetData sets the table data and auto-adjusts column widths based on content
type InteractiveTableModel ¶
type InteractiveTableModel struct {
// contains filtered or unexported fields
}
InteractiveTableModel implements tea.Model for interactive table display
func NewInteractiveTable ¶
func NewInteractiveTable(headers []string, data [][]string, styled bool) *InteractiveTableModel
NewInteractiveTable creates a new interactive table model
func NewInteractiveTableWithTitle ¶
func NewInteractiveTableWithTitle(title string, headers []string, data [][]string, styled bool) *InteractiveTableModel
NewInteractiveTableWithTitle creates a new interactive table model with custom title
func (*InteractiveTableModel) Init ¶
func (m *InteractiveTableModel) Init() tea.Cmd
func (*InteractiveTableModel) View ¶
func (m *InteractiveTableModel) View() string
type StringBuilderTable ¶
type StringBuilderTable struct {
*Table
// contains filtered or unexported fields
}
Custom table that writes directly to strings.Builder
func NewStringBuilderTableWriter ¶
func NewStringBuilderTableWriter(sb *strings.Builder) *StringBuilderTable
NewStringBuilderTableWriter creates a table that writes to a strings.Builder
func (*StringBuilderTable) Render ¶
func (sbt *StringBuilderTable) Render()
Render writes the table directly to the strings.Builder
func (*StringBuilderTable) SetAlignment ¶
func (sbt *StringBuilderTable) SetAlignment(align int)
SetAlignment sets alignment
func (*StringBuilderTable) SetBorders ¶
func (sbt *StringBuilderTable) SetBorders(border any)
SetBorders is a no-op for compatibility
func (*StringBuilderTable) SetCenterSeparator ¶
func (sbt *StringBuilderTable) SetCenterSeparator(sep string)
SetCenterSeparator sets the separator
func (*StringBuilderTable) SetHeader ¶
func (sbt *StringBuilderTable) SetHeader(headers []string)
SetHeader sets the headers and maintains compatibility
type Table ¶
type Table struct {
// contains filtered or unexported fields
}
Table represents a simple table renderer using lipgloss
func NewPlainTable ¶
func NewPlainTable() *Table
NewPlainTable creates a new table with plain styling (no colors)
func NewStringBuilderTable ¶
NewStringBuilderTable creates a table that writes to a strings.Builder
func NewStyledTable ¶
func NewStyledTable() *Table
NewStyledTable creates a new table with colorful styling
func NewTableWithStyle ¶
func NewTableWithStyle(style TableStyle) *Table
NewTableWithStyle creates a new table with custom styling
func (*Table) AppendBulk ¶
AppendBulk adds multiple rows to the table
func (*Table) RenderToWriter ¶
RenderToWriter writes the table output to any writer (maintains tablewriter compatibility)
func (*Table) SetAlignment ¶
SetAlignment sets the alignment for each column
func (*Table) SetAutoWrapText ¶
SetAutoWrapText sets whether text should auto-wrap
func (*Table) SetHeaders ¶
SetHeaders sets the table headers
func (*Table) SetStyle ¶
func (t *Table) SetStyle(style TableStyle)
SetStyle changes the table style
func (*Table) UsePlainStyle ¶
func (t *Table) UsePlainStyle()
UsePlainStyle switches to plain (boring) styling
func (*Table) UseStyledStyle ¶
func (t *Table) UseStyledStyle()
UseStyledStyle switches to colorful styling
type TableStyle ¶
type TableStyle struct {
Header lipgloss.Style
Cell lipgloss.Style
Border lipgloss.Style
Separator string
}
TableStyle defines the visual styling for tables
func DefaultTableStyle ¶
func DefaultTableStyle() TableStyle
DefaultTableStyle returns a plain table styling (for users who hate colors)
func PlainTableStyle ¶
func PlainTableStyle() TableStyle
PlainTableStyle returns a plain, boring table style with no colors
func StyledTableStyle ¶
func StyledTableStyle() TableStyle
StyledTableStyle returns a colorful, styled table