table

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2024 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
	Flex   bool
	Hidden bool
}

type Keymap

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

func DefaultKeymap

func DefaultKeymap() Keymap

type Model

type Model struct {
	Keymap Keymap
	// 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) SetRows added in v0.0.2

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

func (*Model) SetStyles

func (m *Model) SetStyles(s Styles)

func (Model) Update

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

func (*Model) UpdateDimensions

func (m *Model) UpdateDimensions(width int, height int)

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