Skip to content

Divider

A divider is a hairline which separates sections of content: horizontal in a VStack, vertical in an HStack. The default color is derived from the main color of the theme.

Divider

return VStack(
	Text("Above"),
	HLine(),
	Text("Below"),
	HLineWithColor(ColorAccent),
	HStack(
		Text("Left"),
		VLine(),
		Text("Right"),
	).Gap(L16).Frame(Frame{Height: L48}),
).Alignment(Leading).Frame(Frame{Width: L320})

A horizontal line takes the full width of its parent and a vertical line the full height, so the parent needs a size.

Constructors

ConstructorDescription
HLine() TDividerCreates a horizontal hairline divider in the line color of the theme.
HLineWithColor(c Color) TDividerCreates a horizontal hairline divider in the given color.
VLine() TDividerCreates a vertical hairline divider in the line color of the theme.
VLineWithColor(c Color) TDividerCreates a vertical hairline divider in the given color.

Methods

MethodDescription
Border(border Border) TDividerSets the border styling of the divider, typically its line thickness and color.
Frame(frame Frame) TDividerSets the layout frame of the divider, including size and positioning.
Padding(padding Padding) TDividerSets the spacing around the divider.
Visible(visible bool) TDividerHides the divider if set to false.

Related