bubble-table
bubble-table copied to clipboard
Feature Request: Ability to change the highlighted row color!
Hello, It would be wonderful if we could change the table's highlighted row color. At the moment, there only seems to be one color, a very light mauve. If we could change the color with code such as:
Example One:
highlightStyle := lipgloss.NewStyle().
Foreground(lipgloss.Color("7")).
Background(lipgloss.Color("2")).
Bold(true)
WithRowHighlightedStyle(highlightStyle)
Or, Example Two:
tableModel: table.New(rows).
WithRowHighlightedStyle(lipgloss.NewStyle().Foreground(lipgloss.Color("7")).Background(lipgloss.Color("2"))),
}),
}
Probably, there should be a,
WithRowHighlightedStyle(), .... and a,
WithColumnsHighlightedStyle(),
Many thanks,
This is super old, but this is possible.
WithRowStyleFunc(rowStyleFunc).
func rowStyleFunc(input table.RowStyleFuncInput) lipgloss.Style {
// Check if this row is highlighted.
if input.IsHighlighted { // or input.Highlighted depending on your library version
// Return the highlight style.
return lipgloss.NewStyle().
Background(lipgloss.Color(styles.White)).
Foreground(lipgloss.Color(styles.Black))
}
}`