MCPcopy Create free account

hub / github.com/charmbracelet/lipgloss / functions

Functions731 in github.com/charmbracelet/lipgloss

↓ 60 callersFunctionNew
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 callersMethodString
String returns the table as a string.
table/table.go:312
↓ 57 callersMethodset
Set a value on the underlying rules map.
set.go:9
↓ 53 callersMethodHeaders
Headers sets the table headers.
table/table.go:155
↓ 53 callersMethodStyleFunc
StyleFunc sets the style for a cell based on it's position (row, column).
table/table.go:110
↓ 51 callersMethodunset
unset unsets a property from a style.
unset.go:4
↓ 49 callersMethodForeground
Foreground sets a foreground color. // Sets the foreground to blue s := lipgloss.NewStyle().Foreground(lipgloss.Color("#0000ff")) // Removes the
set.go:272
↓ 46 callersMethodRows
Rows returns the number of rows in the table.
table/rows.go:9
↓ 40 callersMethodChild
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 callersMethodRender
Render applies the defined style formatting to a given string.
style.go:268
↓ 39 callersMethodBorder
Border sets the table border.
table/table.go:166
↓ 34 callersFunctionNew
New returns a new tree.
tree/tree.go:403
↓ 32 callersMethodString
String returns the string representation of a Leaf node. For leaf nodes, this is the same as Value.
tree/tree.go:91
↓ 31 callersMethodPadding
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 callersMethodBold
Bold sets a bold formatting rule.
set.go:195
↓ 24 callersMethodgetAsInt
(k propKey)
get.go:564
↓ 23 callersFunctionNewStyle
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 callersMethodBackground
Background sets a background color.
set.go:278
↓ 22 callersMethodWidth
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 callersMethodWidth
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 callersMethodBorder
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 callersMethodString
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 callersMethodgetAsBool
(k propKey, defaultVal bool)
get.go:504
↓ 20 callersFunctionRoot
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 callersMethodRow
Row appends a row to the table data.
table/table.go:146
↓ 18 callersFunctionNew
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 callersMethodEnumerator
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 callersMethodAlign
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 callersMethodRoot
Root sets the root value of this tree.
tree/tree.go:386
↓ 14 callersFunctionColor
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 callersMethodMargin
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 callersMethodgetAsColor
(k propKey)
get.go:524
↓ 13 callersMethodString
()
examples/tree/toggle/main.go:44
↓ 12 callersMethodHeight
Height sets the table height.
table/table.go:263
↓ 12 callersMethodItem
Item appends an item to the list. l := list.New(). Item("Foo"). Item("Bar"). Item("Baz")
list/list.go:246
↓ 12 callersMethodLength
Length returns the number of children in the tree.
tree/children.go:11
↓ 12 callersMethodString
()
list/list.go:116
↓ 12 callersMethodisSet
Returns whether or not the given property is set.
get.go:487
↓ 11 callersMethodEnumeratorStyle
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 callersMethodPaddingRight
PaddingRight adds padding on the right.
set.go:361
↓ 11 callersMethodensureRenderer
()
tree/tree.go:226
↓ 10 callersMethodAt
At returns the contents of the cell at the given index.
table/rows.go:6
↓ 10 callersMethodAt
At returns the content item of the given index.
tree/children.go:8
↓ 10 callersMethodHeight
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 callersMethodItalic
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 callersMethodUnderline
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 callersMethodBorderRow
BorderRow sets the row border separator.
table/table.go:208
↓ 9 callersMethodEnumerator
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 callersMethodMarginBottom
MarginBottom sets the value of the bottom margin.
set.go:447
↓ 9 callersMethodMarginRight
MarginRight sets the value of the right margin.
set.go:435
↓ 9 callersMethodSetString
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 callersMethodStrikethrough
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 callersMethodValue
()
tree/tree.go:38
↓ 8 callersMethodBorderForeground
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 callersMethodFaint
Faint sets a rule for rendering the foreground color in a dimmer shade.
set.go:260
↓ 8 callersMethodRGBA
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 callersMethodWrap
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 callersMethodgetBorderStyle
()
get.go:614
↓ 8 callersFunctionrequireEqual
(tb testing.TB, a, b any)
style_test.go:504
↓ 7 callersMethodBorderColumn
BorderColumn sets the column border separator.
table/table.go:202
↓ 7 callersMethodIndenterStyle
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 callersMethodRender
Render returns the table as a string.
table/table.go:379
↓ 7 callersFunctionexpectColorMatches
(t *testing.T, got, want color.Color)
color_test.go:18
↓ 7 callersFunctiongetLines
Split a string into lines, additionally returning the size of the widest line.
get.go:630
↓ 6 callersMethodItemStyle
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 callersFunctionWidth
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 callersFunctionhex
hex converts a color to a hex string or panics if invalid.
color_test.go:10
↓ 5 callersMethodBlink
Blink sets a rule for blinking foreground text.
set.go:254
↓ 5 callersMethodBorderBottom
BorderBottom sets the bottom border.
table/table.go:178
↓ 5 callersMethodBorderLeft
BorderLeft sets the left border.
table/table.go:184
↓ 5 callersMethodBorderRight
BorderRight sets the right border.
table/table.go:190
↓ 5 callersMethodBorderTop
BorderTop sets the top border.
table/table.go:172
↓ 5 callersMethodChildren
()
tree/tree.go:39
↓ 5 callersMethodGetBackground
GetBackground returns the style's background color. If no value is set NoColor{} is returned.
get.go:71
↓ 5 callersMethodInherit
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 callersMethodItemStyle
ItemStyle sets a static style for all items. Use ItemStyleFunc to conditionally set styles based on the tree node.
tree/tree.go:296
↓ 5 callersMethodMarginLeft
MarginLeft sets the value of the left margin.
set.go:429
↓ 5 callersMethodMaxWidth
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 callersFunctionbtoi
btoi converts a boolean to an integer, 1 if true, 0 if false.
table/util.go:8
↓ 5 callersMethodisBorderStyleSetWithoutSides
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 callersFunctionnewWhitespace
newWhitespace creates a new whitespace renderer.
whitespace.go:16
↓ 5 callersMethodrender
Render whitespaces.
whitespace.go:25
↓ 5 callersMethodxPaddingForCol
xPaddingForCol returns the horizontal padding for a column.
table/resizing.go:418
↓ 4 callersMethodAddLayers
AddLayers adds child layers to the Layer.
layer.go:90
↓ 4 callersFunctionBlend1D
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 callersMethodBorderForegroundBlend
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 callersMethodBorderStyle
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 callersMethodColumns
Columns returns the number of columns in the table.
table/rows.go:12
↓ 4 callersMethodEnumeratorStyleFunc
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 callersMethodGetBold
GetBold returns the style's bold value. If no value is set false is returned.
get.go:11
↓ 4 callersMethodGetHorizontalFrameSize
GetHorizontalFrameSize returns the sum of the style's horizontal margins, padding and border widths. Provisional: this method may be renamed.
get.go:450
↓ 4 callersMethodGetHorizontalMargins
GetHorizontalMargins returns the style's left and right margins. Unset values are measured as 0.
get.go:223
↓ 4 callersMethodGetVerticalFrameSize
GetVerticalFrameSize returns the sum of the style's vertical margins, padding and border widths. Provisional: this method may be renamed.
get.go:458
↓ 4 callersFunctionHeight
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 callersMethodHide
Hide sets whether to hide the Tree node. Use this when creating a new hidden Tree.
tree/tree.go:113
↓ 4 callersMethodIndenter
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 callersMethodInline
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 callersMethodItemStyleFunc
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 callersFunctionNewStringData
NewStringData creates a new StringData with the given number of columns.
table/rows.go:22
↓ 4 callersMethodPaddingLeft
PaddingLeft adds padding on the left.
set.go:355
next →1–100 of 731, ranked by callers