Table of Contents

Class Controls

Namespace
SharpConsoleUI.Builders
Assembly
SharpConsoleUI.dll

Static factory class for creating control builders

public static class Controls
Inheritance
Controls
Inherited Members

Methods

BarGraph()

Creates a new bar graph builder

public static BarGraphBuilder BarGraph()

Returns

BarGraphBuilder

A new bar graph builder

Button(string)

Creates a new button builder

public static ButtonBuilder Button(string text = "Button")

Parameters

text string

The initial button text

Returns

ButtonBuilder

A new button builder

Canvas(int?, int?)

Creates a new canvas control builder.

public static CanvasControlBuilder Canvas(int? width = null, int? height = null)

Parameters

width int?

Optional canvas width in characters.

height int?

Optional canvas height in characters.

Returns

CanvasControlBuilder

A new canvas control builder.

Checkbox(string)

Creates a new checkbox builder

public static CheckboxBuilder Checkbox(string label)

Parameters

label string

The checkbox label

Returns

CheckboxBuilder

A new checkbox builder

DatePicker(string?)

Creates a new date picker builder.

public static DatePickerBuilder DatePicker(string? prompt = null)

Parameters

prompt string

Optional prompt text.

Returns

DatePickerBuilder

A new date picker builder.

Dropdown(string?)

Creates a new dropdown builder

public static DropdownBuilder Dropdown(string? prompt = null)

Parameters

prompt string

The dropdown prompt text

Returns

DropdownBuilder

A new dropdown builder

Error(string)

Creates an error message (red color)

public static MarkupControl Error(string text)

Parameters

text string

The error text

Returns

MarkupControl

A configured markup control

Figlet(string?)

Creates a new Figlet text control builder

public static FigleControlBuilder Figlet(string? text = null)

Parameters

text string

The FIGlet ASCII art text

Returns

FigleControlBuilder

A new Figlet control builder

Header(string, string)

Creates a header text (bold and colored)

public static MarkupControl Header(string text, string color = "yellow")

Parameters

text string

The header text

color string

The header color (default: yellow)

Returns

MarkupControl

A configured markup control

HorizontalGrid()

Creates a new horizontal grid builder

public static HorizontalGridBuilder HorizontalGrid()

Returns

HorizontalGridBuilder

A new horizontal grid builder

HorizontalSplitter()

Creates a new horizontal splitter control builder.

public static HorizontalSplitterBuilder HorizontalSplitter()

Returns

HorizontalSplitterBuilder

A new horizontal splitter control builder.

Image()

Creates a new image control builder.

public static ImageControlBuilder Image()

Returns

ImageControlBuilder

A new image control builder.

Image(PixelBuffer)

Creates an ImageControl displaying the specified pixel buffer.

public static ImageControl Image(PixelBuffer source)

Parameters

source PixelBuffer

The pixel buffer to display.

Returns

ImageControl

A configured image control.

Info(string)

Creates an info message (blue color)

public static MarkupControl Info(string text)

Parameters

text string

The info text

Returns

MarkupControl

A configured markup control

Label(string)

Creates a text label (markup without formatting)

public static MarkupControl Label(string text)

Parameters

text string

The label text

Returns

MarkupControl

A configured markup control

LineGraph()

Creates a new line graph builder

public static LineGraphBuilder LineGraph()

Returns

LineGraphBuilder

A new line graph builder

List(string?)

Creates a new list builder

public static ListBuilder List(string? title = null)

Parameters

title string

The initial list title

Returns

ListBuilder

A new list builder

Markup(string?)

Creates a new markup builder

public static MarkupBuilder Markup(string? initialLine = null)

Parameters

initialLine string

The initial line of markup

Returns

MarkupBuilder

A new markup builder

Menu()

Creates a new menu builder

public static MenuBuilder Menu()

Returns

MenuBuilder

A new menu builder

MultilineEdit(string?)

Creates a new multiline edit control builder

public static MultilineEditControlBuilder MultilineEdit(string? content = null)

Parameters

content string

Optional initial content

Returns

MultilineEditControlBuilder

A new multiline edit control builder

NavigationView()

Creates a new navigation view builder.

public static NavigationViewBuilder NavigationView()

Returns

NavigationViewBuilder

A new navigation view builder.

Panel()

Creates a new panel builder for bordered content panels

public static PanelBuilder Panel()

Returns

PanelBuilder

A new panel builder

Panel(string)

Creates a panel control with text content

public static PanelControl Panel(string content)

Parameters

content string

The text content (supports Spectre markup)

Returns

PanelControl

A configured panel control

ProgressBar()

Creates a new progress bar builder

public static ProgressBarBuilder ProgressBar()

Returns

ProgressBarBuilder

A new progress bar builder

Prompt(string)

Creates a new prompt builder

public static PromptBuilder Prompt(string prompt = "> ")

Parameters

prompt string

The prompt text

Returns

PromptBuilder

A new prompt builder

RangeSlider()

Creates a new range slider builder.

public static RangeSliderBuilder RangeSlider()

Returns

RangeSliderBuilder

A new range slider builder.

Rule(string?)

Creates a new rule control

public static RuleControl Rule(string? title = null)

Parameters

title string

The rule title

Returns

RuleControl

A configured rule control

RuleBuilder()

Creates a new rule builder for horizontal separator lines

public static RuleBuilder RuleBuilder()

Returns

RuleBuilder

A new rule builder

ScrollablePanel()

Creates a new scrollable panel builder

public static ScrollablePanelBuilder ScrollablePanel()

Returns

ScrollablePanelBuilder

A new scrollable panel builder

Separator()

Creates a horizontal separator rule

public static RuleControl Separator()

Returns

RuleControl

A configured rule control

Slider()

Creates a new slider builder.

public static SliderBuilder Slider()

Returns

SliderBuilder

A new slider builder.

Sparkline()

Creates a new sparkline graph builder

public static SparklineBuilder Sparkline()

Returns

SparklineBuilder

A new sparkline builder

Splitter()

Creates a new splitter control builder.

public static SplitterControlBuilder Splitter()

Returns

SplitterControlBuilder

A new splitter control builder.

StatusBar()

Creates a new status bar builder.

public static StatusBarBuilder StatusBar()

Returns

StatusBarBuilder

A new status bar builder.

Success(string)

Creates a success message (green color)

public static MarkupControl Success(string text)

Parameters

text string

The success text

Returns

MarkupControl

A configured markup control

TabControl()

Creates a new tab control builder

public static TabControlBuilder TabControl()

Returns

TabControlBuilder

A new tab control builder

Table()

Creates a new table control builder

public static TableControlBuilder Table()

Returns

TableControlBuilder

A new table control builder

Terminal(string?)

Creates a terminal builder for a PTY-backed terminal control. Supported platforms: Linux (openpty), Windows 10 1809+ (ConPTY). The default shell is bash on Linux and cmd.exe on Windows. Pass exe to launch a different program (e.g. "pwsh").

public static TerminalBuilder Terminal(string? exe = null)

Parameters

exe string

Returns

TerminalBuilder

TimePicker(string?)

Creates a new time picker builder.

public static TimePickerBuilder TimePicker(string? prompt = null)

Parameters

prompt string

Optional prompt text.

Returns

TimePickerBuilder

A new time picker builder.

Toolbar()

Creates a new toolbar builder

public static ToolbarBuilder Toolbar()

Returns

ToolbarBuilder

A new toolbar builder

Tree()

Creates a new tree control builder

public static TreeControlBuilder Tree()

Returns

TreeControlBuilder

A new tree control builder

VerticalSeparator()

Creates a vertical separator control

public static SeparatorControl VerticalSeparator()

Returns

SeparatorControl

A configured separator control

VerticalSeparator(int)

Creates a vertical separator control with horizontal margin

public static SeparatorControl VerticalSeparator(int horizontalMargin)

Parameters

horizontalMargin int

The margin on left and right sides

Returns

SeparatorControl

A configured separator control

Video()

Creates a VideoControl builder for terminal video playback.

public static VideoControlBuilder Video()

Returns

VideoControlBuilder

A new video control builder.

Video(string)

Creates a VideoControl builder with a source pre-set. Accepts file paths, HTTP/HTTPS URLs, RTSP, HLS, RTMP, FTP — anything FFmpeg supports.

public static VideoControlBuilder Video(string source)

Parameters

source string

File path or URL.

Returns

VideoControlBuilder

A new video control builder.

Warning(string)

Creates a warning message (orange color)

public static MarkupControl Warning(string text)

Parameters

text string

The warning text

Returns

MarkupControl

A configured markup control