Documentation
¶
Index ¶
- type Border
- type Column
- type KeyMap
- type Model
- func (m Model) Border(border Border) Model
- func (m Model) BorderDefault() Model
- func (m Model) Focused(focused bool) Model
- func (m Model) HeaderStyle(style lipgloss.Style) Model
- func (m Model) HighlightStyle(style lipgloss.Style) Model
- func (m Model) HighlightedRow() Row
- func (m Model) Init() tea.Cmd
- func (m Model) KeyMap() KeyMap
- func (m Model) SelectableRows(selectable bool) Model
- func (m Model) SelectedRows() []Row
- func (m Model) Update(msg tea.Msg) (Model, tea.Cmd)
- func (m Model) View() string
- func (m Model) WithKeyMap(keyMap KeyMap) Model
- func (m Model) WithRows(rows []Row) Model
- func (m Model) WithStaticFooter(footer string) Model
- type Row
- type RowData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Border ¶ added in v0.2.0
type Border struct {
Top string
Left string
Right string
Bottom string
TopRight string
TopLeft string
BottomRight string
BottomLeft string
TopJunction string
LeftJunction string
RightJunction string
BottomJunction string
InnerJunction string
InnerDivider string
// contains filtered or unexported fields
}
Border defines the borders in and around the table.
type KeyMap ¶ added in v0.4.0
KeyMap defines the keybindings for the table when it's focused.
func DefaultKeyMap ¶ added in v0.4.0
func DefaultKeyMap() KeyMap
DefaultKeyMap returns a set of sensible defaults for controlling a focused table.
type Model ¶
type Model struct {
// contains filtered or unexported fields
}
Model is the main table model. Create using New().
func (Model) BorderDefault ¶ added in v0.2.0
BorderDefault uses the basic square border, useful to reset the border if it was changed somehow.
func (Model) Focused ¶
Focused allows the table to show highlighted rows and take in controls of up/down/space/etc to let the user navigate the table and interact with it.
func (Model) HeaderStyle ¶
HeaderStyle sets the style to apply to the header text, such as color or bold.
func (Model) HighlightStyle ¶
HighlightStyle sets a custom style to use when the row is being highlighted by the cursor.
func (Model) HighlightedRow ¶
HighlightedRow returns the full Row that's currently highlighted by the user.
func (Model) SelectableRows ¶
SelectableRows sets whether or not rows are selectable. If set, adds a column in the front that acts as a checkbox and responds to controls if Focused.
func (Model) SelectedRows ¶
SelectedRows returns all rows that have been set as selected by the user.
func (Model) View ¶
View renders the table. It does not end in a newline, so that it can be composed with other elements more consistently.
func (Model) WithKeyMap ¶ added in v0.4.0
WithKeyMap sets the key map to use for controls when focused.
func (Model) WithStaticFooter ¶ added in v0.4.0
WithStaticFooter adds a footer that only displays the given text.