Skip to content

Outline

An Outline draws a line around a component like a Border, but it takes no space in the layout and can be moved away from the edge by an offset. Stacks use it for focus, hover and pressed states.

Outline

return HStack(
	VStack(Text("Outline")).
		Outline(Outline{Style: OutlineSolid, Width: 2, Offset: 4, Color: "#FA2C7F"}).
		BackgroundColor("#C9E7F8").
		Padding(Padding{}.All(L16)),
	VStack(Text("Inside()")).
		Outline(Outline{Style: OutlineSolid, Width: 2, Color: "#FA2C7F"}.Inside()).
		BackgroundColor("#C9E7F8").
		Padding(Padding{}.All(L16)),
).Gap(L32).Padding(Padding{}.All(L16))

Fields

FieldDescription
Style OutlineStyleOutlineSolid or OutlineDotted.
Width intLine width in pixels.
Offset intDistance between the edge and the outline in pixels.
Color ColorLine color.

Methods

MethodDescription
Inside() OutlineSets the outline to be inside the element.

Related