Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/charmbracelet/lipgloss
/ functions
Functions
731 in github.com/charmbracelet/lipgloss
⨍
Functions
731
◇
Types & classes
65
↓ 60 callers
Function
New
New returns a new Table that can be modified through different attributes. By default, a table has normal border, no styling, and no rows.
table/table.go:80
↓ 58 callers
Method
String
String returns the table as a string.
table/table.go:312
↓ 57 callers
Method
set
Set a value on the underlying rules map.
set.go:9
↓ 53 callers
Method
Headers
Headers sets the table headers.
table/table.go:155
↓ 53 callers
Method
StyleFunc
StyleFunc sets the style for a cell based on it's position (row, column).
table/table.go:110
↓ 51 callers
Method
unset
unset unsets a property from a style.
unset.go:4
↓ 49 callers
Method
Foreground
Foreground sets a foreground color. // Sets the foreground to blue s := lipgloss.NewStyle().Foreground(lipgloss.Color("#0000ff")) // Removes the
set.go:272
↓ 46 callers
Method
Rows
Rows returns the number of rows in the table.
table/rows.go:9
↓ 40 callers
Method
Child
Child adds a child to this Tree. If a Child Tree is passed without a root, it will be parented to its sibling child (auto-nesting). tree.Root("Foo"
tree/tree.go:169
↓ 40 callers
Method
Render
Render applies the defined style formatting to a given string.
style.go:268
↓ 39 callers
Method
Border
Border sets the table border.
table/table.go:166
↓ 34 callers
Function
New
New returns a new tree.
tree/tree.go:403
↓ 32 callers
Method
String
String returns the string representation of a Leaf node. For leaf nodes, this is the same as Value.
tree/tree.go:91
↓ 31 callers
Method
Padding
Padding is a shorthand method for setting padding on all sides at once. With one argument, the value is applied to all sides. With two arguments, th
set.go:341
↓ 27 callers
Method
Bold
Bold sets a bold formatting rule.
set.go:195
↓ 24 callers
Method
getAsInt
(k propKey)
get.go:564
↓ 23 callers
Function
NewStyle
NewStyle returns a new, empty Style. While it's syntactic sugar for the [Style]{} primitive, it's recommended to use this function for creating styles
style.go:137
↓ 22 callers
Method
Background
Background sets a background color.
set.go:278
↓ 22 callers
Method
Width
Width sets the width of the block before applying margins. This means your styled content will exactly equal the size set here. Text will wrap based o
set.go:286
↓ 22 callers
Method
Width
Width sets the table width, this auto-sizes the columns to fit the width by either expanding or contracting the widths of each column as a best effort
table/table.go:257
↓ 21 callers
Method
Border
Border is shorthand for setting the border style and which sides should have a border at once. The variadic argument sides works as follows: With one
set.go:490
↓ 21 callers
Method
String
String implements stringer for a Style, returning the rendered result based on the rules in this style. An underlying string value must be set with St
style.go:221
↓ 21 callers
Method
getAsBool
(k propKey, defaultVal bool)
get.go:504
↓ 20 callers
Function
Root
Root returns a new tree with the root set. tree.Root(root) It is a shorthand for: tree.New().Root(root)
tree/tree.go:380
↓ 19 callers
Method
Row
Row appends a row to the table data.
table/table.go:146
↓ 18 callers
Function
New
New returns a new list with the given items. alphabet := list.New( "A", "B", "C", "D", "E", "F", ... ) Items can be other lists, tre
list/list.go:50
↓ 17 callers
Method
Enumerator
Enumerator sets the list enumerator. There are several predefined enumerators: • Alphabet • Arabic • Bullet • Dash • Roman Or, define your own. fu
list/list.go:288
↓ 16 callers
Method
Align
Align is a shorthand method for setting horizontal and vertical alignment. With one argument, the position value is applied to the horizontal alignme
set.go:305
↓ 16 callers
Method
Root
Root sets the root value of this tree.
tree/tree.go:386
↓ 14 callers
Function
Color
Color specifies a color by hex or ANSI256 value. For example: ansiColor := lipgloss.Color("1") // The same as lipgloss.Red ansi256Color := lipgloss
color.go:68
↓ 14 callers
Method
Margin
Margin is a shorthand method for setting margins on all sides at once. With one argument, the value is applied to all sides. With two arguments, the
set.go:415
↓ 14 callers
Method
getAsColor
(k propKey)
get.go:524
↓ 13 callers
Method
String
()
examples/tree/toggle/main.go:44
↓ 12 callers
Method
Height
Height sets the table height.
table/table.go:263
↓ 12 callers
Method
Item
Item appends an item to the list. l := list.New(). Item("Foo"). Item("Bar"). Item("Baz")
list/list.go:246
↓ 12 callers
Method
Length
Length returns the number of children in the tree.
tree/children.go:11
↓ 12 callers
Method
String
()
list/list.go:116
↓ 12 callers
Method
isSet
Returns whether or not the given property is set.
get.go:487
↓ 11 callers
Method
EnumeratorStyle
EnumeratorStyle sets the enumerator style for all enumerators. To set the enumerator style conditionally based on the item value or index, use [Enume
list/list.go:124
↓ 11 callers
Method
PaddingRight
PaddingRight adds padding on the right.
set.go:361
↓ 11 callers
Method
ensureRenderer
()
tree/tree.go:226
↓ 10 callers
Method
At
At returns the contents of the cell at the given index.
table/rows.go:6
↓ 10 callers
Method
At
At returns the content item of the given index.
tree/children.go:8
↓ 10 callers
Method
Height
Height sets the height of the block before applying margins. If the height of the text block is less than this value after applying padding (or not),
set.go:294
↓ 10 callers
Method
Italic
Italic sets an italic formatting rule. In some terminal emulators this will render with "reverse" coloring if not italic font variant is available.
set.go:202
↓ 10 callers
Method
Underline
Underline sets an underline rule. By default, underlines will not be drawn on whitespace like margins and padding. To change this behavior set [Style.
set.go:210
↓ 9 callers
Method
BorderRow
BorderRow sets the row border separator.
table/table.go:208
↓ 9 callers
Method
Enumerator
Enumerator sets the enumerator implementation. This can be used to change the way the branches indicators look. Lipgloss includes predefined enumerat
tree/tree.go:325
↓ 9 callers
Method
MarginBottom
MarginBottom sets the value of the bottom margin.
set.go:447
↓ 9 callers
Method
MarginRight
MarginRight sets the value of the right margin.
set.go:435
↓ 9 callers
Method
SetString
SetString sets the underlying string value for this style. To render once the underlying string is set, use the [Style.String]. This method is a conve
style.go:208
↓ 9 callers
Method
Strikethrough
Strikethrough sets a strikethrough rule. By default, strikes will not be drawn on whitespace like margins and padding. To change this behavior set Str
set.go:242
↓ 9 callers
Method
Value
()
tree/tree.go:38
↓ 8 callers
Method
BorderForeground
BorderForeground is a shorthand function for setting all of the foreground colors of the borders at once. The arguments work as follows: With one arg
set.go:567
↓ 8 callers
Method
Faint
Faint sets a rule for rendering the foreground color in a dimmer shade.
set.go:260
↓ 8 callers
Method
RGBA
RGBA returns the RGBA value of this color. Because we have to return something, despite this color being the absence of color, we're returning black w
color.go:59
↓ 8 callers
Method
Wrap
Wrap dictates whether or not the table content should wrap. This only applies to data cells. Headers are never wrapped.
table/table.go:306
↓ 8 callers
Method
getBorderStyle
()
get.go:614
↓ 8 callers
Function
requireEqual
(tb testing.TB, a, b any)
style_test.go:504
↓ 7 callers
Method
BorderColumn
BorderColumn sets the column border separator.
table/table.go:202
↓ 7 callers
Method
IndenterStyle
IndenterStyle sets the enumerator style for all enumerators. To set the enumerator style conditionally based on the item value or index, use [Indente
list/list.go:154
↓ 7 callers
Method
Render
Render returns the table as a string.
table/table.go:379
↓ 7 callers
Function
expectColorMatches
(t *testing.T, got, want color.Color)
color_test.go:18
↓ 7 callers
Function
getLines
Split a string into lines, additionally returning the size of the widest line.
get.go:630
↓ 6 callers
Method
ItemStyle
ItemStyle sets the item style for all items. To set the item style conditionally based on the item value or index, use [ItemStyleFunc].
list/list.go:214
↓ 6 callers
Function
Width
Width returns the cell width of characters in the string. ANSI sequences are ignored and characters wider than one cell (such as Chinese characters an
size.go:15
↓ 6 callers
Function
hex
hex converts a color to a hex string or panics if invalid.
color_test.go:10
↓ 5 callers
Method
Blink
Blink sets a rule for blinking foreground text.
set.go:254
↓ 5 callers
Method
BorderBottom
BorderBottom sets the bottom border.
table/table.go:178
↓ 5 callers
Method
BorderLeft
BorderLeft sets the left border.
table/table.go:184
↓ 5 callers
Method
BorderRight
BorderRight sets the right border.
table/table.go:190
↓ 5 callers
Method
BorderTop
BorderTop sets the top border.
table/table.go:172
↓ 5 callers
Method
Children
()
tree/tree.go:39
↓ 5 callers
Method
GetBackground
GetBackground returns the style's background color. If no value is set NoColor{} is returned.
get.go:71
↓ 5 callers
Method
Inherit
Inherit overlays the style in the argument onto this style by copying each explicitly set value from the argument style onto this style if it is not a
style.go:238
↓ 5 callers
Method
ItemStyle
ItemStyle sets a static style for all items. Use ItemStyleFunc to conditionally set styles based on the tree node.
tree/tree.go:296
↓ 5 callers
Method
MarginLeft
MarginLeft sets the value of the left margin.
set.go:429
↓ 5 callers
Method
MaxWidth
MaxWidth applies a max width to a given style. This is useful in enforcing a certain width at render time, particularly with arbitrary strings and sty
set.go:750
↓ 5 callers
Function
btoi
btoi converts a boolean to an integer, 1 if true, 0 if false.
table/util.go:8
↓ 5 callers
Method
isBorderStyleSetWithoutSides
isBorderStyleSetWithoutSides returns true if the border style is set but no sides are set. This is used to determine if the border should be rendered
get.go:648
↓ 5 callers
Function
newWhitespace
newWhitespace creates a new whitespace renderer.
whitespace.go:16
↓ 5 callers
Method
render
Render whitespaces.
whitespace.go:25
↓ 5 callers
Method
xPaddingForCol
xPaddingForCol returns the horizontal padding for a column.
table/resizing.go:418
↓ 4 callers
Method
AddLayers
AddLayers adds child layers to the Layer.
layer.go:90
↓ 4 callers
Function
Blend1D
Blend1D blends a series of colors together in one linear dimension using multiple stops, into the provided number of steps. Uses the "CIE L*, a*, b*"
blending.go:18
↓ 4 callers
Method
BorderForegroundBlend
BorderForegroundBlend sets the foreground colors for the border blend. At least 2 colors are required to use blending, otherwise this will no-op with
set.go:628
↓ 4 callers
Method
BorderStyle
BorderStyle defines the Border on a style. A Border contains a series of definitions for the sides and corners of a border. Note that if border visib
set.go:523
↓ 4 callers
Method
Columns
Columns returns the number of columns in the table.
table/rows.go:12
↓ 4 callers
Method
EnumeratorStyleFunc
EnumeratorStyleFunc sets the enumerator style function for the list items. Use this to conditionally set different styles based on the current items,
list/list.go:143
↓ 4 callers
Method
GetBold
GetBold returns the style's bold value. If no value is set false is returned.
get.go:11
↓ 4 callers
Method
GetHorizontalFrameSize
GetHorizontalFrameSize returns the sum of the style's horizontal margins, padding and border widths. Provisional: this method may be renamed.
get.go:450
↓ 4 callers
Method
GetHorizontalMargins
GetHorizontalMargins returns the style's left and right margins. Unset values are measured as 0.
get.go:223
↓ 4 callers
Method
GetVerticalFrameSize
GetVerticalFrameSize returns the sum of the style's vertical margins, padding and border widths. Provisional: this method may be renamed.
get.go:458
↓ 4 callers
Function
Height
Height returns height of a string in cells. This is done simply by counting \n characters. If your output has \r\n, that sequence will be replaced wit
size.go:29
↓ 4 callers
Method
Hide
Hide sets whether to hide the Tree node. Use this when creating a new hidden Tree.
tree/tree.go:113
↓ 4 callers
Method
Indenter
Indenter sets the indenter implementation. This is used to change the way the tree is indented. The default indentor places a border connecting siblin
tree/tree.go:351
↓ 4 callers
Method
Inline
Inline makes rendering output one line and disables the rendering of margins, padding and borders. This is useful when you need a style to apply only
set.go:732
↓ 4 callers
Method
ItemStyleFunc
ItemStyleFunc sets the item style function for the list items. Use this to conditionally set different styles based on the current items, sibling ite
list/list.go:233
↓ 4 callers
Function
NewStringData
NewStringData creates a new StringData with the given number of columns.
table/rows.go:22
↓ 4 callers
Method
PaddingLeft
PaddingLeft adds padding on the left.
set.go:355
next →
1–100 of 731, ranked by callers