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.
- BaseControl
Abstract base class for all UI controls, providing shared layout fields, properties, and default implementations of IWindowControl and IDOMPaintable. Implements INotifyPropertyChanged for MVVM data binding support.
- ButtonControl
A clickable button control that supports keyboard and mouse interaction.
- CanvasControl
A free-form drawing surface control that exposes CharacterBuffer drawing primitives through a local-coordinate API. Supports both async/on-demand painting via BeginPaint()/EndPaint() and event-driven painting via the Paint event. Both modes can be combined.
- 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.
- CompoundFilterExpression
A compound filter expression: one or more terms combined with AND. Space-separated terms are AND; pipe-separated alternatives within a term are OR.
- DatePickerControl
A locale-aware date picker control with inline segment editing and a calendar portal overlay. Supports keyboard navigation, digit entry, and mouse interaction.
- 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. Uses a custom FIGlet parser for direct rendering without Spectre.Console dependency.
- FilterExpression
Represents a parsed filter expression.
- FilterTerm
A filter term: one or more alternative expressions combined with OR.
- GutterClickEventArgs
Event arguments for a mouse click in the gutter area.
- 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 indexARCHITECTURE 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.
- HorizontalSplitterControl
A horizontal splitter control that allows users to resize vertically-stacked controls by dragging up/down. Renders as a thin horizontal bar (═══) and supports keyboard and mouse interaction. Works in any container: Window, ColumnContainer, ScrollablePanelControl.
- HorizontalSplitterMovedEventArgs
Provides data for the SplitterMoved event.
- ImageControl
Displays a PixelBuffer as a half-block image in a console window. Each character cell represents 2 vertical pixels.
- LineGraphControl
A line graph control for visualizing time-series data using braille or ASCII rendering. Supports multiple named series rendered as connected lines.
- LineGraphSeries
Represents a named data series in a line graph.
- LineNumberGutterRenderer
Built-in gutter renderer that displays source line numbers. Highlights the current line number using the control's foreground color.
- 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.
- NavigationItem
Represents a single item in a NavigationView control.
- NavigationView
A navigation view control with a left navigation pane and a right content area. Inspired by WinUI's NavigationView pattern, encapsulating nav item selection, content switching, and header updates into a single reusable control.
- PanelControl
A control that renders a bordered panel with content. Renders directly to CharacterBuffer using BoxChars and MarkupParser.
- PortalContentBase
Abstract base class for portal content controls (overlay panels used by dropdowns, menus, etc.). Provides default implementations of IWindowControl, IDOMPaintable, IMouseAwareControl, and IHasPortalBounds to eliminate boilerplate.
- PortalContentContainer
A portal content control that acts as a proper container for child controls. Unlike DropdownPortalContent and MenuPortalContent which paint manually, this container hosts arbitrary child controls (ListControl, ButtonControl, ScrollablePanelControl, etc.) with layout, mouse routing, keyboard delegation, and focus tracking.
- 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.
- RangeSliderControl
A dual-thumb range slider control that allows users to select a range of values by dragging two thumbs along a track. Supports keyboard and mouse interaction, minimum range enforcement, and optional value and min/max labels.
- ReferenceLine
Represents a horizontal reference line drawn at a fixed Y-axis value across the graph area. Used to indicate thresholds, targets, or other significant values.
- RuleControl
A control that renders a horizontal rule (divider line) with optional title text. Renders directly to CharacterBuffer using BoxChars.
- 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.
- SliderControl
A slider control that allows users to select a value from a range by dragging a thumb along a track. Supports both horizontal and vertical orientations, keyboard and mouse interaction, and optional value and min/max labels.
- 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.
- StatusBarControl
A single-row status bar with left/center/right alignment zones, clickable items, and optional shortcut key hints. Does not receive keyboard focus — display and click only.
- StatusBarItem
Represents a single item in a StatusBarControl. Changing properties triggers parent invalidation unless inside a BatchUpdate.
- StatusBarItemClickedEventArgs
Event args for status bar item click events.
- SyntaxLineState
Opaque parser state carried from the end of one line to the start of the next. Highlighter implementations subclass this to hold language-specific fields. The control stores and forwards the value; it never inspects its contents.
- TabControl
A tab control that displays multiple pages of content, with tab headers for switching between them. Uses visibility toggling to show/hide tab content efficiently.
- TabPage
Represents a single tab page with a title and content.
- TableColumn
Represents a column configuration in a TableControl.
- TableControl
A table control that renders tabular data directly to CharacterBuffer. Supports both read-only display and interactive mode with selection, keyboard navigation, scrolling, sorting, multi-selection, column resizing, inline editing, draggable scrollbars, and virtual data binding.
- TableRow
Represents a row in a TableControl with cell data and optional styling.
- TimePickerControl
A time picker control with segmented hour/minute/second/AM-PM fields. Supports 12h and 24h formats, keyboard digit entry, and mouse interaction.
- 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.
- ValueMarker
Represents a labeled arrow marker pointing at a specific Y-axis value on the graph edge. Used to highlight current values, targets, or notable data points.
- VideoControl
Plays video files in the terminal using half-block, ASCII, or braille rendering. Decodes frames via FFmpeg subprocess and renders at up to 30 fps. Requires FFmpeg to be installed and on the system PATH.
Structs
- ColorThreshold
Represents a color threshold for gradient bar effects. When the bar value reaches or exceeds the threshold percentage, this color is used.
- GutterRenderContext
Provides rendering context for a single row of a gutter renderer. Passed by-ref to avoid heap allocation on every row/renderer combination.
- Margin
Represents spacing around a control's content.
- SyntaxToken
Represents a colored token span within a source line for syntax highlighting.
Interfaces
- IContainer
Represents a container that can host window controls and provides shared properties for rendering.
- IContainerControl
Interface for controls that contain child controls. All GUI frameworks expose children from containers - this is fundamental. Enables focus system to build flattened list of all focusable controls, including deeply nested controls within containers.
- IFocusScope
Implemented by container controls that manage Tab navigation within themselves. Replaces IDirectionalFocusControl and IFocusTrackingContainer.
- IFocusableContainerWithHeader
A focusable container whose header row is itself a Tab focus stop, but whose visible children are also exposed to Tab traversal immediately after it. This produces the natural flow: Tab → header (arrows switch content) → Tab → first child control.
- IFocusableControl
Interface for controls that can receive focus
- IGutterRenderer
Defines a pluggable gutter renderer for MultilineEditControl. Multiple renderers are stacked left-to-right in the gutter area.
- 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
- IPortalHost
Interface for containers that can host portals (Window and DesktopPortal). Portals are overlay LayoutNodes that render on top of normal content.
- IScrollableContainer
Interface for containers that can scroll to bring children into view. Used by BringIntoFocus to notify parent containers when nested child receives focus.
- ISyntaxHighlighter
Provides syntax highlighting by tokenizing source lines into colored spans. Implement this interface to provide custom syntax coloring for specific languages or formats.
- ITableDataSource
Interface for virtual/lazy data binding to a TableControl. Enables large datasets (millions of rows) without memory overhead by querying only visible rows on demand.
- IWindowControl
Represents a UI control that can be displayed within a window or container.
Enums
- ActiveThumb
Identifies which thumb is currently active on a RangeSliderControl.
- ButtonBorderStyle
Defines the border style for a button control.
- FigletSize
FIGlet text size based on embedded fonts.
- FilterMode
Filter mode for the table's inline filter.
- FilterOperator
Filter operator for column-specific filtering.
- FocusReason
Reasons for focus changes
- LabelPosition
Specifies where a reference line label is displayed relative to the line.
- LineGraphMode
Specifies the rendering mode for line graphs.
- MarkerSide
Specifies which side of the graph a value marker arrow and label appear on.
- MenuOrientation
Specifies the orientation of a menu control.
- NavigationItemType
Specifies the type of a navigation item in a NavigationView.
- NavigationViewDisplayMode
Specifies how the NavigationView navigation pane is displayed.
- ScrollDirection
Scroll direction enumeration.
- ScrollMode
Scroll mode enumeration.
- ScrollbarPosition
Scrollbar position enumeration.
- ScrollbarVisibility
Specifies when scrollbars should be displayed.
- SliderOrientation
Orientation for slider controls.
- SortDirection
Sort direction for table columns.
- 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.
- TabHeaderStyle
Controls how the tab header area is rendered.
- TitlePosition
Specifies the position of the title relative to the sparkline graph.
- TreeGuide
Defines the line style used for tree control guide lines.
- 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.