IWidget
ConsoleMonster.Layout
The widget contract. A widget is a pure function of its definition, its state, the capabilities and the theme: the same inputs always produce the same cells. Implement it to get theming, glyph tiers, layout, live updates and every output mode for free.
Usage
Explore 310 API references to this type
This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.
Returned or exposed by 106
- Property DashboardFrame.Compact
- Property Accordion.Children
- Property AppBinding.Children
- Property AppScreen.Content
- Property AppScreens.Children
- Property BindingOptions.Content
- Property Choice.Preview
- Property ChoiceField.Preview
- Property Collapsible.Children
- Property Collapsible.Content
- Property CollapsibleInputOptions.Content
- Method ConfirmPrompt.Snapshot
- Property ConsoleAppOptions.Footer
- Method DatePrompt.Snapshot
- Property FormDialogOptions.Content
- Property FormDialog<T>.Content
- Property FormPreset.Preview
- Property MenuItem.Page
- Property MenuItem.Preview
- Property MenuPreset.Preview
- Property MenuRunResult.Details
- Method MultiSelectPrompt<T>.Snapshot
- Property MultiSelectPrompt<T>.Preview
- Method NumberPrompt.Snapshot
- Method ObjectExplorer.Snapshot
- Method PathPrompt.Snapshot
- Method Prompt<T>.Snapshot
- Method SecretPrompt.Snapshot
- Method SelectionQuestion.Snapshot
- Method SelectPrompt<T>.Snapshot
- Property SelectPrompt<T>.Preview
- Property SelectQuestionOptions.Preview
- Property TabOptions.Content
- Method TextPrompt.Snapshot
- Method TypedConfirmPrompt.Snapshot
- Property Align.Children
- Property Align.Content
- Property Columns.Children
- Method ContentBuilder.Build
- Property CultureScope.Child
- Property CultureScope.Children
- Property IContainer.Children
- Property LayoutGrid.Children
- Property Padding.Children
- Property Padding.Content
- Property Panel.Children
- Property Panel.Content
- Property Prioritized.Child
- Property Prioritized.Children
- Property Responsive.Children
- Property Responsive.Fallback
- Property Rows.Children
- Property Sized.Children
- Property Sized.Widget
- Property Stack.Children
- Property Steady.Children
- Property Steady.Content
- Property LiveRunOptions.Summary
- Property LiveSession.Root
- Property LiveSessionOptions.Summary
- Property WatchFrame.Content
- Property WatchOptions.Print
- Property WidgetUpdate.Content
- Method MarkdownViewProvider.Create
- Method TestRunView.Build
- Method UiConstruction.Build
- Method ConsoleView.Auto
- Method ConsoleView.BuildErrors
- Method IConsoleViewProvider.Create
- Method Chart.Create
- Extension method ChartOptions.Build
- Property ConsoleViewFrame.Blocks
- Property ConsoleViewFrame.Children
- Property ConsoleViewFrame.Footer
- Property ConsoleViewFrame.Headline
- Method ConsoleViewStyle.Create
- Method ConsoleViewStyle.Wrap
- Property Dashboard.Children
- Property Dashboard.Content
- Property LayoutRegion.Children
- Property LayoutRegion.Content
- Property LayoutRegions.Children
- Property MarkdownView.Children
- Method Progress.Create
- Extension method ProgressOptions.Build
- Property RecordItem.Widget
- Property RecordView.Children
- Property RegionWidget.Children
- Property RegionWidget.Content
- Property RoleTable.Children
- Property RunBoard.Children
- Property RunBoard.HeaderChart
- Property RunBoard.Stages
- Property RunBoard.Wordmark
- Property RunBoardPanel.Content
- Property RunDashboard.Children
- Property RunDashboardSection.Content
- Method RunView.Build
- Property ScrollView.Children
- Property ScrollView.Content
- Property Splitter.Children
- Property Splitter.First
- Property Splitter.Second
- Property Table.Children
- Property Table<T>.Children
- Property Tabs.Children
Accepted by parameters 204
- Method ContinuousIntegration.AddSummary
- Method ConsoleExporter.Render
- Method ConsoleExporter.ToHtml
- Method ConsoleExporter.ToSvg
- Method ConsoleExporter.ToText
- Method FrameExporter.Render
- Method FrameExporter.Save
- Method IFrameExportProvider.Render
- Method Recording.CaptureFrames
- Method Recording.Render
- Method Recording.Save
- Method Recording.ToAsciicast
- Method Recording.ToHtml
- Method Recording.ToPlayerData
- Method Recording.ToSvg
- Extension method DashboardFrame.CompactBy
- Method DashboardFrameFluent.CompactBy
- Constructor FrameSection.FrameSection
- Method ConsoleGraphicsExtensions.Save
- Method ConsoleGraphicsExtensions.Save
- Method ConsoleGraphicsExtensions.ToPng
- Method PngFrameExportProvider.Render
- Extension method Accordion.Content
- Method AccordionFluent.Content
- Constructor AppBinding.AppBinding
- Constructor AppScreen.AppScreen
- Extension method BindingOptions.ContentBy
- Method BindingOptionsFluent.ContentBy
- Extension method Choice.Preview
- Extension method ChoiceField.PreviewBy
- Method ChoiceFieldFluent.PreviewBy
- Method ChoiceFluent.Preview
- Constructor Collapsible.Collapsible
- Extension method Collapsible.Content
- Method CollapsibleFluent.Content
- Extension method CollapsibleInputOptions.Content
- Method CollapsibleInputOptionsFluent.Content
- Method ConsoleApp.Run
- Method ConsoleApp.RunAsync
- Extension method ConsoleAppOptions.Footer
- Method ConsoleAppOptionsFluent.Footer
- Constructor FocusManager.FocusManager
- Extension method FormDialogOptions.Content
- Method FormDialogOptionsFluent.Content
- Constructor FormDialog<T>.FormDialog
- Extension method FormPreset.Preview
- Method FormPresetFluent.Preview
- Method MenuContext.Run
- Extension method MenuItem.PageBy
- Extension method MenuItem.PreviewBy
- Method MenuItem.MultiSelect``1
- Method MenuItem.Select``1
- Method MenuItemFluent.PageBy
- Method MenuItemFluent.PreviewBy
- Extension method MenuPreset.Preview
- Method MenuPresetFluent.Preview
- Extension method MenuRunResult.Details
- Method MenuRunResultFluent.Details
- Method MultiSelectPromptFluent.PreviewBy``1
- Method SelectPromptFluent.PreviewBy``1
- Extension method SelectQuestionOptions.PreviewBy
- Method SelectQuestionOptionsFluent.PreviewBy
- Extension method TabOptions.Content
- Method TabOptionsFluent.Content
- Method WidgetPager.TryShow
- Constructor Align.Align
- Extension method Align.Content
- Method AlignFluent.Content
- Constructor Columns.Columns
- Extension method Columns.Content
- Method Columns.Add
- Method ColumnsFluent.Content
- Method ContentBuilder.Add
- Method ContentBuilder.Binding
- Method ContentBuilder.Button
- Method ContentBuilder.Chart
- Method ContentBuilder.Progress
- Method ContentBuilder.Select
- Method ContentBuilder.TextInput
- Method ContentBuilder.Toggle
- Constructor CultureScope.CultureScope
- Extension method IWidget.CreateSession
- Extension method IWidget.Fill
- Extension method IWidget.Fixed
- Extension method IWidget.Render
- Extension method IWidget.Save
- Extension method IWidget.Save
- Extension method IWidget.Show
- Extension method IWidget.ToHtml
- Extension method IWidget.ToMarkdown
- Extension method IWidget.ToPng
- Extension method IWidget.ToSvg
- Extension method IWidget.ToText
- Constructor LayoutGrid.LayoutGrid
- Extension method LayoutGrid.Content
- Method LayoutGrid.Add
- Method LayoutGridFluent.Content
- Constructor Padding.Padding
- Extension method Padding.Content
- Method PaddingFluent.Content
- Constructor Panel.Panel
- Extension method Panel.Content
- Method PanelFluent.Content
- Constructor Prioritized.Prioritized
- Constructor Responsive.Responsive
- Extension method Responsive.Fallback
- Method Responsive.When
- Method ResponsiveFluent.Fallback
- Constructor Rows.Rows
- Extension method Rows.Content
- Method Rows.Add
- Method RowsFluent.Content
- Constructor Sized.Sized
- Constructor Stack.Stack
- Extension method Stack.Content
- Method StackFluent.Content
- Constructor Steady.Steady
- Extension method Steady.Content
- Method SteadyFluent.Content
- Method ConsoleWatch.Run
- Method InlineArea.Draw
- Constructor LiveSession.LiveSession
- Method LiveSession.Replay
- Extension method LiveSessionOptions.Summary
- Method LiveSessionOptionsFluent.Summary
- Constructor WatchFrame.WatchFrame
- Extension method WatchOptions.WriteTo
- Method WatchOptionsFluent.WriteTo
- Extension method WidgetUpdate.Content
- Method WidgetUpdateFluent.Content
- Method MarkdownExporter.ReplayToMarkdown
- Method MarkdownExporter.ToMarkdown
- Method MarkdownFrameExportProvider.Render
- Extension method ITerminalTarget.Write
- Method TerminalTargetExtensions.Write
- Method ReplayPlayer.Play
- Method Terminal.Render
- Method Terminal.RenderChunks
- Method Terminal.RenderEncoded
- Method Terminal.RenderText
- Method Terminal.Write
- Method Terminal.WriteError
- Method TestTerminal.Render
- Method TestTerminal.RenderText
- Method UiConstruction.CreateSession
- Method WidgetLayout.Fill
- Method WidgetLayout.Fixed
- Method WidgetPipeline.Render
- Method WidgetPipeline.Save
- Method WidgetPipeline.Show
- Constructor ConsoleViewFrame.ConsoleViewFrame
- Extension method ConsoleViewFrame.Block
- Extension method ConsoleViewFrame.Blocks
- Extension method ConsoleViewFrame.Footer
- Extension method ConsoleViewFrame.Headline
- Method ConsoleViewFrameFluent.Block
- Method ConsoleViewFrameFluent.Blocks
- Method ConsoleViewFrameFluent.Footer
- Method ConsoleViewFrameFluent.Headline
- Method ConsoleViewStyle.Create
- Method ConsoleViewStyle.Wrap
- Constructor ContextWidget.ContextWidget
- Constructor Dashboard.Dashboard
- Extension method Dashboard.Content
- Method DashboardFluent.Content
- Constructor GroupedStreamingTable<T1, T2>.GroupedStreamingTable
- Constructor LayoutRegion.LayoutRegion
- Extension method LayoutRegion.Content
- Method LayoutRegionFluent.Content
- Method LayoutRegions.Add
- Method MarkdownView.Block
- Method RecordView.Widget
- Method RecordView.WidgetAt
- Method RegionHandle.Replace
- Method RegionHandle.Set
- Constructor RegionWidget.RegionWidget
- Extension method RegionWidget.Content
- Method RegionWidget.Set
- Method RegionWidgetFluent.Content
- Extension method RunBoard.HeaderChartBy
- Extension method RunBoard.Stages
- Extension method RunBoard.Wordmark
- Method RunBoard.Panel
- Method RunBoard.Panel
- Method RunBoardFluent.HeaderChartBy
- Method RunBoardFluent.Stages
- Method RunBoardFluent.Wordmark
- Constructor RunBoardPanel.RunBoardPanel
- Constructor RunBoardPanel.RunBoardPanel
- Method RunDashboard.Section
- Method RunDashboard.Section
- Constructor RunDashboardSection.RunDashboardSection
- Constructor RunDashboardSection.RunDashboardSection
- Constructor ScrollView.ScrollView
- Extension method ScrollView.Content
- Method ScrollViewFluent.Content
- Constructor Splitter.Splitter
- Constructor Splitter.Splitter
- Extension method Splitter.First
- Extension method Splitter.Second
- Method SplitterFluent.First
- Method SplitterFluent.Second
- Method Tabs.Add
- Method WatchView.Update
Methods
public abstract Size Measure(Constraints constraints, RenderContext context) #Returns the size the widget wants within the constraints.
Parameters
- constraints ConsoleMonster.Layout.Constraints
- The space offered.
- context ConsoleMonster.Canvas.RenderContext
- Profile, theme and glyphs.
public abstract void Render(Region region, RenderContext context) #Renders into a region. The region may be smaller or larger than the measured size.
Parameters
- region ConsoleMonster.Canvas.Region
- The target region.
- context ConsoleMonster.Canvas.RenderContext
- Profile, theme and glyphs.
Extension Methods
public static LiveSession CreateSession(IWidget widget, LiveSessionOptions? options = null) #Creates an owned live-session lifetime over a configured widget; dispose it after running.
Parameters
- widget ConsoleMonster.Layout.IWidget
- The session root.
- options ConsoleMonster.Live.LiveSessionOptions? = null
- The session options.
public static LiveSession CreateSession(IWidget widget, Action<LiveSessionOptions> configure) #Creates a session with freshly configured options.
Parameters
- widget ConsoleMonster.Layout.IWidget
- The root.
- configure System.Action<ConsoleMonster.Live.LiveSessionOptions>
- Session settings.
public static Sized Fill(IWidget widget, double weight = 1) #Lets the widget take a share of the remaining row height or column width.
Parameters
- widget ConsoleMonster.Layout.IWidget
- The configured widget.
- weight double = 1
- Its relative share.
public static Sized Fixed(IWidget widget, int cells) #Reserves a fixed number of cells for the widget.
Parameters
- widget ConsoleMonster.Layout.IWidget
- The configured widget.
- cells int
- The reserved cells.
public static RenderedOutput Render(IWidget widget, OutputFormat format, ExportOptions? options = null, IFrameExportProvider? provider = null) #Renders the widget in a format and returns the output with its media type.
Parameters
- widget ConsoleMonster.Layout.IWidget
- The configured widget.
- format ConsoleMonster.Export.OutputFormat
- The format.
- options ConsoleMonster.Export.ExportOptions? = null
- Frame size, theme and typography.
- provider ConsoleMonster.Export.IFrameExportProvider? = null
- Optional typed add-on provider.
public static void Save(IWidget widget, string path, ExportOptions? options = null, IFrameExportProvider? provider = null) #Writes the widget to a file in the format its extension implies (.html, .svg, .txt, .md, .png...).
Parameters
- widget ConsoleMonster.Layout.IWidget
- The configured widget.
- path string
- The output file.
- options ConsoleMonster.Export.ExportOptions? = null
- Frame size, theme and typography.
- provider ConsoleMonster.Export.IFrameExportProvider? = null
- Optional typed add-on provider; a registered provider is used when omitted.
public static void Save(IWidget widget, string path, OutputFormat format, ExportOptions? options = null, IFrameExportProvider? provider = null) #Writes the widget to a file in an explicit format.
Parameters
- widget ConsoleMonster.Layout.IWidget
- The configured widget.
- path string
- The output file.
- format ConsoleMonster.Export.OutputFormat
- The format.
- options ConsoleMonster.Export.ExportOptions? = null
- Frame size, theme and typography.
- provider ConsoleMonster.Export.IFrameExportProvider? = null
- Optional typed add-on provider.
public static void Save(IWidget widget, string path, Action<ExportOptions> configure) #Writes the widget to a file with freshly configured output options.
Parameters
- widget ConsoleMonster.Layout.IWidget
- The configured widget.
- path string
- The output file; its extension picks the format.
- configure System.Action<ConsoleMonster.Export.ExportOptions>
- Frame size, theme and typography.
public static void Save(IWidget widget, Stream stream, OutputFormat format, ExportOptions? options = null, IFrameExportProvider? provider = null) #Writes the widget to a stream in a format.
Parameters
- widget ConsoleMonster.Layout.IWidget
- The configured widget.
- stream System.IO.Stream
- The stream; it stays open.
- format ConsoleMonster.Export.OutputFormat
- The format.
- options ConsoleMonster.Export.ExportOptions? = null
- Frame size, theme and typography.
- provider ConsoleMonster.Export.IFrameExportProvider? = null
- Optional typed add-on provider.
public static void Save(IWidget widget, string path, GraphicsExportOptions options) #Renders a widget and saves PNG.
Parameters
- widget ConsoleMonster.Layout.IWidget
- path string
- options ConsoleMonster.Graphics.GraphicsExportOptions
public static void Save(IWidget dashboard, IEnumerable<LiveEvent> events, string path, GraphicsFormat format, GraphicsExportOptions? options = null, CancellationToken cancellationToken = default) #Encodes recorded dashboard events through the existing widget replay engine.
Parameters
- dashboard ConsoleMonster.Layout.IWidget
- events System.Collections.Generic.IEnumerable<ConsoleMonster.Live.LiveEvent>
- path string
- format ConsoleMonster.Graphics.GraphicsFormat
- options ConsoleMonster.Graphics.GraphicsExportOptions? = null
- cancellationToken System.Threading.CancellationToken = default
public static void Show(IWidget widget, TerminalProfile? profile = null, ITerminalWriter? writer = null) #Displays a widget, just as piping it to Show-Console does.
Parameters
- widget ConsoleMonster.Layout.IWidget
- The configured widget.
- profile ConsoleMonster.Capabilities.TerminalProfile? = null
- Optional terminal profile.
- writer ConsoleMonster.Output.ITerminalWriter? = null
- Optional embedding writer.
public static string ToHtml(IWidget widget, ExportOptions? options = null) #Exports a widget as an HTML page.
Parameters
- widget ConsoleMonster.Layout.IWidget
- The widget.
- options ConsoleMonster.Export.ExportOptions? = null
- Size, theme, font and window frame.
Returns
string The HTML.public static string ToMarkdown(IWidget widget, ExportOptions? options = null, bool fenced = false) #Exports tables, records and trees semantically, or preserves the rendered frame when fenced is true.
Parameters
- widget ConsoleMonster.Layout.IWidget
- The widget or layout.
- options ConsoleMonster.Export.ExportOptions? = null
- Size, culture, glyphs and theme.
- fenced bool = false
- Preserves the exact terminal layout in a code block instead of exporting semantic data.
Returns
string The Markdown document.public static byte[] ToPng(IWidget widget, GraphicsExportOptions? options = null) #Renders a widget and encodes PNG.
Parameters
- widget ConsoleMonster.Layout.IWidget
- options ConsoleMonster.Graphics.GraphicsExportOptions? = null
Returns
byte[]public static string ToSvg(IWidget widget, ExportOptions? options = null) #Exports a widget as an SVG image.
Parameters
- widget ConsoleMonster.Layout.IWidget
- The widget.
- options ConsoleMonster.Export.ExportOptions? = null
- Size, theme, font and window frame.
Returns
string The SVG.public static string ToText(IWidget widget, ExportOptions? options = null) #Exports a widget as plain text (trailing spaces and empty last lines trimmed).
Parameters
- widget ConsoleMonster.Layout.IWidget
- The widget.
- options ConsoleMonster.Export.ExportOptions? = null
- Size and glyph tier.
Returns
string The text.