Table of Contents

Namespace SharpConsoleUI.Controls

Classes

BarGraphControl

A horizontal bar graph control for visualizing percentage-based data. Displays a filled/unfilled bar with optional label, value, and custom colors.

ButtonControl

A clickable button control that supports keyboard and mouse interaction.

CheckboxControl

A toggleable checkbox control that displays a label and checked/unchecked state. Supports keyboard interaction with Space or Enter keys to toggle state.

ColumnContainer

A container control that holds child controls vertically within a column of a HorizontalGridControl. Supports layout constraints, focus management, and dynamic content sizing.

DropdownControl

A dropdown/combobox control that displays a list of selectable items. Supports keyboard navigation, type-ahead search, and custom item formatting.

DropdownItem

Represents an item in a DropdownControl with text, optional icon, and metadata.

FigleControl

A control that renders text using FIGlet ASCII art fonts. Wraps the Spectre.Console FigletText component for large decorative text display.

HorizontalGridControl

A grid control that arranges child columns horizontally with optional splitters between them. Supports keyboard and mouse navigation, focus management, and dynamic column resizing.

SIMPLE USAGE (Factory Methods):

// Button row (common pattern)
var buttons = HorizontalGridControl.ButtonRow(
    new ButtonControl { Text = "OK" },
    new ButtonControl { Text = "Cancel" }
);

// Any controls
var grid = HorizontalGridControl.FromControls(control1, control2, control3);

FLUENT USAGE (For Complex Layouts):

var grid = HorizontalGridControl.Create()
    .Column(col => col.Width(48).Add(control1))
    .Column(col => col.Flex(2.0).Add(control2))
    .WithSplitterAfter(0)
    .WithAlignment(HorizontalAlignment.Stretch)
    .Build();

SPLITTER API:

// Add splitters using column references (more intuitive than indices)
grid.AddSplitterAfter(column1);  // Adds splitter between column1 and column2
grid.AddSplitterBefore(column2); // Same result as above

// Or add columns with automatic splitters
grid.AddColumn(column1);
grid.AddColumnWithSplitter(column2); // Creates splitter automatically

TRADITIONAL USAGE (Still Supported):

var grid = new HorizontalGridControl();
var column = new ColumnContainer(grid);
column.AddContent(control);
grid.AddColumn(column);
grid.AddSplitter(0, new SplitterControl()); // Add splitter by index

ARCHITECTURE NOTE:

This control uses HorizontalLayout internally for measuring and arranging columns. The layout algorithm is assigned automatically by Window.cs during tree building. Users don't interact with HorizontalLayout directly.

ListControl

A scrollable list control that supports selection, highlighting, and keyboard navigation.

ListItem

Represents an item in a ListControl.

LogViewerControl

A control that displays log entries from the library's LogService. Automatically updates when new log entries are added. Uses ScrollablePanelControl internally for scrolling with AutoScroll support. Thread-safe: log events can be received from any thread.

MarkupControl

A control that displays rich text content using Spectre.Console markup syntax. Supports text alignment, margins, word wrapping, and sticky positioning.

MenuControl

A full-featured menu control supporting horizontal (menu bar) and vertical (sidebar) orientations, unlimited submenu nesting, keyboard and mouse navigation, and overlay rendering.

MenuItem

Represents a menu item with support for hierarchical menu structures.

MultilineEditControl

A multiline text editing control with support for text selection, scrolling, and word wrap. Provides full cursor navigation, cut/copy/paste-like operations, and configurable scrollbars.

PanelControl

A control that renders a bordered panel with content. Wraps Spectre.Console's Panel with SharpConsoleUI patterns.

ProgressBarControl

A progress bar control with both determinate (percentage) and indeterminate (pulsing) modes. Uses box-drawing character ━ (U+2501) for clean terminal rendering.

PromptControl

A single-line text input control with optional prompt text. Supports text editing, cursor navigation, and horizontal scrolling for overflow text.

RuleControl

A control that renders a horizontal rule (divider line) with optional title text. Wraps the Spectre.Console Rule component.

ScrollEventArgs

Scroll event arguments.

ScrollablePanelControl

A scrollable panel control that can host child controls with automatic scrolling support. Supports vertical and horizontal scrolling, mouse wheel, and visual scrollbars.

SeparatorControl

A simple vertical separator control for visually dividing UI elements. Unlike SplitterControl, this is non-interactive and non-focusable. Uses a single vertical line character for a subtle appearance.

SparklineControl

A vertical column/sparkline graph control for visualizing time-series data. Displays vertical bars showing historical values over time.

SpectreRenderableControl

A control that wraps any Spectre.Console IRenderable for display within the window system. Provides a bridge between Spectre.Console's rich rendering and the SharpConsoleUI framework.

SplitterControl

A vertical splitter control that allows users to resize adjacent columns in a HorizontalGridControl. Supports keyboard-based resizing with arrow keys and provides visual feedback during focus and dragging.

SplitterMovedEventArgs

Provides data for the SplitterMoved event.

TableColumn

Represents a column configuration in a TableControl.

TableControl

A table control that wraps Spectre.Console's Table widget. Provides read-only display of tabular data with theming support.

TableRow

Represents a row in a TableControl with cell data and optional styling.

ToolbarControl

A horizontal toolbar control that contains buttons, separators, and other controls. Supports Tab navigation between focusable items and Enter key activation of buttons.

TreeControl

A hierarchical tree control that displays nodes in a collapsible tree structure with keyboard navigation.

TreeNode

Represents a tree node in the TreeControl.

Structs

ColorThreshold

Represents a color threshold for gradient bar effects. When the bar value reaches or exceeds the threshold percentage, this color is used.

Margin

Represents spacing around a control's content.

Interfaces

IContainer

Represents a container that can host window controls and provides shared properties for rendering.

IDirectionalFocusControl

Interface for controls that support directional focus (for container controls with children)

IFocusableControl

Interface for controls that can receive focus

IInteractiveControl

Represents a control that can receive keyboard input and be focused.

ILayoutAware

Optional interface for controls that participate in layout negotiation. Controls implementing this interface can express their sizing requirements and receive notifications when their allocated space changes.

ILogicalCursorProvider

Interface for controls that can provide logical cursor positions.

IMouseAwareControl

Interface for controls that can handle mouse events

IWindowControl

Represents a UI control that can be displayed within a window or container.

Enums

FocusReason

Reasons for focus changes

ListSelectionMode

Specifies the selection mode for a ListControl.

MenuOrientation

Specifies the orientation of a menu control.

ScrollDirection

Scroll direction enumeration.

ScrollMode

Scroll mode enumeration.

ScrollbarPosition

Scrollbar position enumeration.

ScrollbarVisibility

Specifies when scrollbars should be displayed.

SparklineMode

Specifies the rendering mode for sparkline bars.

StickyPosition

Specifies whether a control should stick to the top or bottom of its container during scrolling.

TitlePosition

Specifies the position of the title relative to the sparkline graph.

WrapMode

Specifies how text wrapping is handled in multiline controls.

Delegates

DropdownControl.ItemFormatterEvent

Delegate for custom item formatting in the dropdown list.

ListControl.ItemFormatterEvent

Delegate for custom item formatting.