table

package
v0.6.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 2, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewStyledTable

func NewStyledTable() *ltable.Table

NewStyledTable creates a new lipgloss table with Grove's default styling

func NewStyledTableWithOptions

func NewStyledTableWithOptions(opts Options) *ltable.Table

NewStyledTableWithOptions creates a table with custom options

func SelectableTable

func SelectableTable(headers []string, rows [][]string, selectedIndex int) string

SelectableTable creates a table suitable for selection interfaces The selection indicator (▶) is rendered on the right side of the table, outside the border

func SelectableTableWithOptions

func SelectableTableWithOptions(headers []string, rows [][]string, selectedIndex int, opts SelectableTableOptions) string

SelectableTableWithOptions creates a table with custom highlighting options

func SimpleTable

func SimpleTable(headers []string, rows [][]string) string

SimpleTable creates a basic table with headers and rows

func StatusTable

func StatusTable(items [][]string) string

StatusTable creates a table for displaying status information

Types

type Builder

type Builder struct {
	// contains filtered or unexported fields
}

Builder provides a fluent interface for creating styled tables

func NewBuilder

func NewBuilder() *Builder

NewBuilder creates a new table builder

func (*Builder) Build

func (b *Builder) Build() *ltable.Table

Build creates the styled table

func (*Builder) WithBorder

func (b *Builder) WithBorder(bordered bool) *Builder

WithBorder enables or disables the border

func (*Builder) WithHeaders

func (b *Builder) WithHeaders(headers ...string) *Builder

WithHeaders sets the table headers

func (*Builder) WithHeight

func (b *Builder) WithHeight(height int) *Builder

WithHeight sets the table height

func (*Builder) WithRowNumbers

func (b *Builder) WithRowNumbers(show bool) *Builder

WithRowNumbers enables or disables row numbers

func (*Builder) WithRows

func (b *Builder) WithRows(rows ...[]string) *Builder

WithRows sets the table rows

func (*Builder) WithTheme

func (b *Builder) WithTheme(t *theme.Theme) *Builder

WithTheme sets the theme

func (*Builder) WithWidth

func (b *Builder) WithWidth(width int) *Builder

WithWidth sets specific column widths

type Options

type Options struct {
	ShowRowNumbers bool
	Bordered       bool
	HeaderStyle    lipgloss.Style
	RowStyle       lipgloss.Style
	Theme          *theme.Theme
}

Options provides additional configuration for the table

func DefaultOptions

func DefaultOptions() Options

DefaultOptions returns the default table options

type SelectableTableOptions

type SelectableTableOptions struct {
	HighlightColumn int // Column index to highlight (0-based), -1 for no highlight
}

SelectableTableOptions provides configuration for SelectableTable

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL