Skip to main content
.border(config?: { style: Style; width?: number; } | Style | number): Component;

Parameters

config
{ style: Style; width?: number; } | Style | number
Border configuration. Can be a configuration object, a Style for the border, or a number for border width.

Support

Usage

Simple border

Rectangle()
    .fill(Color("white"))
    .border(Color("black"))

Thick border

Circle()
    .fill(Color("blue"))
    .border(4)

Custom border

Text("Bordered text")
    .border({ style: Color("red"), width: 2 })