table

package
v0.0.14 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Column

type Column struct {
	Title    string
	Width    int
	MinWidth int
	Flex     bool
	Hidden   bool
	Auto     bool
	Padding  int
}

type Keymap

type Keymap struct {
	LineUp   key.Binding
	LineDown key.Binding
}

func DefaultKeymap

func DefaultKeymap() Keymap

type Model

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

func New

func New(opts ...Option) (m Model)

func (*Model) Blur

func (m *Model) Blur()

func (*Model) Focus

func (m *Model) Focus()

func (*Model) Focused

func (m *Model) Focused() bool

func (*Model) MoveDown

func (m *Model) MoveDown(n int)

func (*Model) MoveUp

func (m *Model) MoveUp(n int)

func (Model) SelectedRow

func (m Model) SelectedRow() Row

func (*Model) SetHeight added in v0.0.5

func (m *Model) SetHeight(h int)

Update height

func (*Model) SetRows added in v0.0.2

func (m *Model) SetRows(r []Row)

Update rows

func (*Model) SetStyles

func (m *Model) SetStyles(s Styles)

Update styles

func (*Model) SetWidth added in v0.0.5

func (m *Model) SetWidth(w int)

Update width

func (Model) Update

func (m Model) Update(msg tea.Msg) (Model, tea.Cmd)

func (*Model) UpdateViewport

func (m *Model) UpdateViewport()

func (Model) View

func (m Model) View() string

type Option

type Option func(*Model)

func WithColumns

func WithColumns(cols []Column) Option

func WithFocus

func WithFocus(f bool) Option

func WithKeymap

func WithKeymap(k Keymap) Option

func WithRows

func WithRows(rows []Row) Option

func WithStyles

func WithStyles(s Styles) Option

type Row

type Row []string

type Styles

type Styles struct {
	Header   lipgloss.Style
	Cell     lipgloss.Style
	Selected lipgloss.Style
}

func DefaultStyles

func DefaultStyles() Styles

Jump to

Keyboard shortcuts

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