Skip to content

Frame

The Frame widget is a container with decorative borders and an optional title. It’s perfect for grouping related widgets and creating visual sections.

Frame extends Container and adds border rendering and title display. It’s one of the most commonly used widgets for creating structured layouts.

The title displayed at the top of the frame.

frame.Title = "Settings";

The style of the border. Available styles:

  • Single: Single-line borders (default)
  • Double: Double-line borders
  • Rounded: Rounded corners
  • None: No border
frame.BorderStyle = BorderStyle.Rounded;

The color of the border. If not set, uses ForegroundColor.

frame.BorderColor = ColorHelper.FromRgb(100, 200, 255);

When greater than 0, corners will be rounded. Only affects Single and Double border styles.

frame.CornerRadius = 2;
var frame = new Frame("My Application")
{
X = 5,
Y = 3,
Width = 70,
Height = 20,
BorderStyle = BorderStyle.Rounded,
ForegroundColor = ColorHelper.FromRgb(100, 200, 255),
BackgroundColor = Color.Black,
BorderColor = ColorHelper.FromRgb(100, 200, 255)
};
var label = new Label("Content goes here")
{
X = 2,
Y = 2,
Width = 65,
Height = 1,
ForegroundColor = Color.White
};
frame.Add(label);
frame.BorderStyle = BorderStyle.Single;
// Uses: ┌ ┐ └ ┘ │ ─
frame.BorderStyle = BorderStyle.Double;
// Uses: ╔ ╗ ╚ ╝ ║ ═
frame.BorderStyle = BorderStyle.Rounded;
// Uses: ╭ ╮ ╰ ╯ │ ─