Skip to content

Styling Guide ​

Termina provides a rich set of styling options for text and borders. All styling is done through fluent APIs on layout nodes, with no CSS or external stylesheets.

Overview ​

Styling in Termina includes:

  • Colors - Foreground and background colors for text and borders
  • Text Formatting - Bold, italic, underline
  • Border Styles - Single, double, rounded, and ASCII borders

Quick Examples ​

Styled Text ​

csharp
new TextNode("Important message")
    .WithForeground(Color.Red)
    .Bold()

Styled Panel ​

csharp
new PanelNode()
    .WithTitle("Dashboard")
    .WithBorder(BorderStyle.Rounded)
    .WithBorderColor(Color.Cyan)
    .WithTitleColor(Color.BrightCyan)

Colored Spinners ​

csharp
new SpinnerNode()
    .WithLabel("Processing...")
    .WithSpinnerColor(Color.Yellow)
    .WithLabelColor(Color.Gray)

Color System ​

Termina supports three color modes:

ModeDescriptionExample
DefaultTerminal's default colorColor.Default
Indexed256-color paletteColor.Red, Color.FromIndex(42)
RGBTrue color (24-bit)Color.FromRgb(255, 128, 0)

See Colors for details.

Text Formatting ​

Apply text styles using fluent methods:

csharp
new TextNode("Formatted")
    .Bold()
    .Italic()
    .Underline()

See Text Formatting for details.

Border Styles ​

Four border styles are available:

Single:   ┌───┐     Double:   ╔═══╗
          │   │               ║   ║
          └───┘               ╚═══╝

Rounded:  ╭───╮     ASCII:    +---+
          │   │               |   |
          ╰───╯               +---+

See Borders for details.

Sections ​

Released under the Apache 2.0 License.