glossy

package
v0.0.22 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package glossy contains a glossy table

Index

Constants

View Source
const KeyWidth = 15

KeyWidth is the width of the key column in the key value layout

Variables

View Source
var (
	// MainTableStyle is the style to use for tables
	MainTableStyle = lipgloss.NewStyle().
					BorderStyle(lipgloss.NormalBorder()).
					BorderForeground(cli.AccentColor)
	// TableStyles is the style to use for tables
	TableStyles = table.Styles{
		Selected: lipgloss.NewStyle().Bold(true).Foreground(cli.SecondaryColor),
		Header:   lipgloss.NewStyle().Bold(true).Padding(0, 1).Foreground(cli.PrimaryColor),
		Cell:     lipgloss.NewStyle().Padding(0, 1),
	}
	// TableHiddenSelectStyles is the style to use for tables. It hides the selection
	// indicator.
	TableHiddenSelectStyles = table.Styles{
		Header:   lipgloss.NewStyle().Bold(true).Padding(0, 1).Foreground(cli.PrimaryColor),
		Cell:     lipgloss.NewStyle().Padding(0, 1),
		Selected: lipgloss.NewStyle(),
	}
)

Functions

This section is empty.

Types

type Table

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

Table is a wrapper around tablewriter.Table

func New

func New(layout string, header []string) *Table

New creates a new table with the given header

func (*Table) AddRow

func (t *Table) AddRow(row []string)

AddRow adds a row

func (*Table) AddRowWithColor

func (t *Table) AddRowWithColor(row []string, _ []string)

AddRowWithColor adds a row with the given colors

func (*Table) Render

func (t *Table) Render()

Render renders the table

Jump to

Keyboard shortcuts

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