Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/DevToys-app/DevToys/llms.txt

Use this file to discover all available pages before exploring further.

Display components present information to the user without accepting direct text input. They range from simple labels and icons to full data grids, image viewers, and progress indicators. All are created through the static GUI factory class (namespace DevToys.Api) and expose a fluent builder API.

IUILabel

A text display component that renders a string in one of several typographic styles. Factory:
public static IUILabel Label()
public static IUILabel Label(string? id)
public static IUILabel Label(string? id, string text)

Properties

PropertyTypeDefaultDescription
Textstring?nullThe text to display.
StyleUILabelStyleBodyThe typographic style applied to the text.
AutoWrapbooltrueWhen true, text wraps to the next line when it cannot fit horizontally.

Events

TextChanged, StyleChanged, AutoWrapChanged

Fluent Methods

IUILabel Text(this IUILabel element, string? text)
IUILabel Style(this IUILabel element, UILabelStyle style)
IUILabel WrapIfNeeded(this IUILabel element)   // AutoWrap = true
IUILabel NeverWrap(this IUILabel element)      // AutoWrap = false

UILabelStyle Enum

ValueDescription
CaptionSmallest style — fine print, helper text
BodyDefault body text (default)
BodyStrongBold body text
BodyLargeLarger body text
SubtitleSection subtitle
TitlePage/section title
TitleLargeLarge page title
DisplayHero / display text

Example

GUI.Label("section-header")
   .Text("Output")
   .Style(UILabelStyle.Subtitle)
   .WrapIfNeeded();

IUIInfoBar

A dismissible notification banner used to surface status messages, errors, warnings, or success confirmations. The bar is hidden by default and must be opened explicitly. Factory:
public static IUIInfoBar InfoBar()
public static IUIInfoBar InfoBar(string? id)
public static IUIInfoBar InfoBar(string? id, string title)
public static IUIInfoBar InfoBar(string? id, string title, string description)
public static IUIInfoBar InfoBar(string? id, string title, string description, UIInfoBarSeverity severity)

Properties

PropertyTypeDefaultDescription
IsOpenedboolfalseWhether the bar is currently visible.
IsClosablebooltrueWhether the user can close the bar with its close button.
IsIconVisiblebooltrueWhether the severity icon is shown.
Titlestring?nullBold title text.
Descriptionstring?nullBody text beneath the title.
SeverityUIInfoBarSeverityInformationalDetermines the icon and colour scheme.
ActionButtonTextstring?nullOptional button label. The bar closes when clicked. Hidden if null or empty.
IsActionButtonAccentboolfalseRenders the action button in accent style.
OnCloseActionFunc<ValueTask>?nullInvoked when the user explicitly closes the bar.
OnActionButtonClickFunc<ValueTask>?nullInvoked when the action button is clicked.

Events

IsOpenedChanged, IsClosableChanged, IsIconVisibleChanged, TitleChanged, DescriptionChanged, SeverityChanged, ActionButtonTextChanged, IsActionButtonAccentChanged, OnCloseActionChanged, OnActionButtonClickChanged

Fluent Methods

// Severity
IUIInfoBar Informational(this IUIInfoBar element)
IUIInfoBar Success(this IUIInfoBar element)
IUIInfoBar Warning(this IUIInfoBar element)
IUIInfoBar Error(this IUIInfoBar element)

// Content
IUIInfoBar Title(this IUIInfoBar element, string? title)
IUIInfoBar Description(this IUIInfoBar element, string? description)
IUIInfoBar WithActionButton(this IUIInfoBar element, string text, bool isAccent, Func<ValueTask> actionOnClick)
IUIInfoBar WithActionButton(this IUIInfoBar element, string text, bool isAccent, Action actionOnClick)

// Visibility
IUIInfoBar Open(this IUIInfoBar element)
IUIInfoBar Close(this IUIInfoBar element)
IUIInfoBar Closable(this IUIInfoBar element)
IUIInfoBar NonClosable(this IUIInfoBar element)
IUIInfoBar ShowIcon(this IUIInfoBar element)
IUIInfoBar HideIcon(this IUIInfoBar element)

// Close callback
IUIInfoBar OnClose(this IUIInfoBar element, Func<ValueTask>? actionOnClose)
IUIInfoBar OnClose(this IUIInfoBar element, Action? actionOnClose)

UIInfoBarSeverity Enum

ValueIconColour
Informationalℹ informationNeutral
Success✓ checkGreen
Warning⚠ warningYellow
Error✗ errorRed

Example

private readonly IUIInfoBar _errorBar
    = GUI.InfoBar("error-bar")
         .Error()
         .Title("Conversion failed")
         .NonClosable();

// Later, when an error occurs:
_errorBar.Description(ex.Message).Open();

// And when the input is cleared:
_errorBar.Close();

IUIImageViewer

Displays an image with built-in zoom, pan, and save-as functionality. Supports FileInfo, Image (ImageSharp), and SandboxedFileReader sources. By default the viewer handles BMP, GIF, JPEG, PBM, PNG, TIFF, TGA, WEBP, and SVG formats. Factory:
public static IUIImageViewer ImageViewer()
public static IUIImageViewer ImageViewer(string? id)

Properties

PropertyTypeDefaultDescription
ImageSourceOneOf<FileInfo, Image, SandboxedFileReader>?nullThe current image source.
CustomActionPerFileExtensionOnSavingIReadOnlyDictionary<string, Func<FileStream, ValueTask>>emptyCustom save handlers per file extension.

Events

ImageSourceChanged, CustomActionPerFileExtensionOnSavingChanged

Fluent Methods

// Set image source
IUIImageViewer WithFile(this IUIImageViewer element, FileInfo imageFile)
IUIImageViewer WithPickedFile(this IUIImageViewer element, SandboxedFileReader pickedFile, bool disposeAutomatically)
IUIImageViewer WithImage(this IUIImageViewer element, Image image, bool disposeAutomatically)

// Clear
IUIImageViewer Clear(this IUIImageViewer element)

// Custom save handlers
IUIImageViewer ManuallyHandleSaveAs(this IUIImageViewer element, string fileExtension, Func<FileStream, ValueTask> action)
IUIImageViewer RemoveManuallyHandleSaveAs(this IUIImageViewer element, string fileExtension)

Example

private readonly IUIImageViewer _viewer = GUI.ImageViewer("result-image");

// Display an ImageSharp Image object:
_viewer.WithImage(myImage, disposeAutomatically: true);

// Display a file picked by the user:
_viewer.WithPickedFile(selectedFile, disposeAutomatically: true);
When disposeAutomatically: true, the viewer disposes the image or SandboxedFileReader when a new source is set or when the viewer itself is disposed. Set disposeAutomatically: false if you manage the lifecycle externally.

IUIDataGrid

A tabular data display with named columns, observable rows, and optional row selection. Rows and cells are created with GUI.Row(...) and GUI.Cell(...). Factory:
public static IUIDataGrid DataGrid()
public static IUIDataGrid DataGrid(string? id)

Properties

PropertyTypeDefaultDescription
Columnsstring[]emptyColumn header names.
RowsObservableCollection<IUIDataGridRow>emptyObservable collection of rows.
CanSelectRowbooltrueWhether rows can be selected by the user.
SelectedRowIUIDataGridRow?nullThe currently selected row.
IsExtendableToFullScreenboolfalseWhether the grid can expand to fill the tool pane.
CommandBarExtraContentIUIElement?nullExtra element in the grid’s command bar.
OnRowSelectedActionFunc<IUIDataGridRow?, ValueTask>?nullInvoked when row selection changes.

Events

CanSelectRowChanged, SelectedRowChanged, IsExtendableToFullScreenChanged, CommandBarExtraContentChanged

Fluent Methods

IUIDataGrid WithColumns(this IUIDataGrid element, params string[] columns)
IUIDataGrid WithRows(this IUIDataGrid element, params IUIDataGridRow[] rows)
IUIDataGrid Select(this IUIDataGrid element, IUIDataGridRow? row)
IUIDataGrid Select(this IUIDataGrid element, int index)
IUIDataGrid AllowSelectItem(this IUIDataGrid element)
IUIDataGrid ForbidSelectItem(this IUIDataGrid element)
IUIDataGrid Extendable(this IUIDataGrid element)
IUIDataGrid NotExtendable(this IUIDataGrid element)
IUIDataGrid CommandBarExtraContent(this IUIDataGrid element, IUIElement? extraElement)
IUIDataGrid OnRowSelected(this IUIDataGrid element, Func<IUIDataGridRow?, ValueTask>?)
IUIDataGrid OnRowSelected(this IUIDataGrid element, Action<IUIDataGridRow?>?)

IUIDataGridRow and IUIDataGridCell

// Create a row with cell elements
IUIDataGridRow Row(object? value, params IUIDataGridCell[] cells)

// Create a row with plain string cells (auto-wrapped in labels)
IUIDataGridRow Row(object? value, params string[] cells)

// Create a row with a detail element (shown on expansion)
IUIDataGridRow Row(object? value, IUIElement? details, params IUIDataGridCell[] cells)
IUIDataGridRow Row(object? value, IUIElement? details, params string[] cells)

// Create a cell from a string
IUIDataGridCell Cell(string? text)

// Create a cell from any IUIElement
IUIDataGridCell Cell(IUIElement uiElement)
IUIDataGridRow.Value holds the associated data object for the row.

Example

GUI.DataGrid("hash-results")
   .WithColumns("Algorithm", "Hash", "Length")
   .Extendable()
   .OnRowSelected(row =>
   {
       if (row?.Value is HashResult result)
           _selectedHash = result;
   })
   .WithRows(
       GUI.Row(md5Result,    "MD5",    md5Hash,    md5Hash.Length.ToString()),
       GUI.Row(sha1Result,   "SHA-1",  sha1Hash,   sha1Hash.Length.ToString()),
       GUI.Row(sha256Result, "SHA-256",sha256Hash, sha256Hash.Length.ToString()));

IUIList

A simple scrollable list of IUIListItem entries. Each item wraps an IUIElement for display and an optional associated value object. Factory:
public static IUIList List()
public static IUIList List(string? id)

Properties

PropertyTypeDefaultDescription
ItemsObservableCollection<IUIListItem>emptyObservable collection of list items.
CanSelectItembooltrueWhether items can be selected.
SelectedItemIUIListItem?nullThe currently selected item.
OnItemSelectedActionFunc<IUIListItem?, ValueTask>?nullInvoked when selection changes.

Events

CanSelectItemChanged, SelectedItemChanged

Fluent Methods

IUIList WithItems(this IUIList element, params IUIListItem[] items)
IUIList Select(this IUIList element, IUIListItem? item)
IUIList Select(this IUIList element, int index)
IUIList AllowSelectItem(this IUIList element)
IUIList ForbidSelectItem(this IUIList element)
IUIList OnItemSelected(this IUIList element, Func<IUIListItem?, ValueTask>?)
IUIList OnItemSelected(this IUIList element, Action<IUIListItem?>?)

// Helper on ObservableCollection<IUIListItem>:
void RemoveValue(this ObservableCollection<IUIListItem> listItems, object? value)

IUIListItem

IUIListItem Item(IUIElement uiElement, object? value)
PropertyTypeDescription
UIElementIUIElementThe element rendered for this item.
Valueobject?The data value associated with the item.

Example

GUI.List("results-list")
   .OnItemSelected(item =>
   {
       if (item?.Value is SearchResult result)
           ShowDetails(result);
   })
   .WithItems(
       GUI.Item(GUI.Label(null, "First result"),  firstResult),
       GUI.Item(GUI.Label(null, "Second result"), secondResult));

IUIProgressBar

A horizontal progress bar indicating operation progress. Supports both determinate (percentage-based) and indeterminate (continuous animation) modes. Factory:
public static IUIProgressBar ProgressBar()
public static IUIProgressBar ProgressBar(string? id)

Properties

PropertyTypeDefaultDescription
Valuedouble0Progress percentage, from 0 to 100.
IsIndeterminateboolfalseShows continuous animation when true.

Events

ValueChanged, ValueChangingAsynchronously, IsIndeterminateChanged

Fluent Methods

// Synchronous update (use on UI thread)
T Progress<T>(this T element, double percentage) where T : IUIProgressBar

// Asynchronous throttled update (use off UI thread)
ValueTask ProgressAsync<T>(this T element, double percentage) where T : IUIProgressBar

// Indeterminate mode
T StartIndeterminateProgress<T>(this T element) where T : IUIProgressBar
T StopIndeterminateProgress<T>(this T element) where T : IUIProgressBar
Progress(double) accepts values between 0 and 100 inclusive.

Example

private readonly IUIProgressBar _progressBar
    = GUI.ProgressBar("convert-progress");

// During a long operation (off UI thread):
for (int i = 0; i < files.Length; i++)
{
    await ProcessFileAsync(files[i]);
    await _progressBar.ProgressAsync((i + 1.0) / files.Length * 100);
}

// Or use indeterminate mode when duration is unknown:
_progressBar.StartIndeterminateProgress();
await DoWorkAsync();
_progressBar.StopIndeterminateProgress();
Use ProgressAsync when updating the progress bar from a background thread. It is throttled to avoid overwhelming the UI thread. Use Progress only when already on the UI thread.

IUIProgressRing

A circular spinner indicating progress. Inherits all members of IUIProgressBar — including Value, IsIndeterminate, Progress(...), ProgressAsync(...), StartIndeterminateProgress(), and StopIndeterminateProgress(). The visual difference is that a ring is rendered instead of a bar. Factory:
public static IUIProgressRing ProgressRing()
public static IUIProgressRing ProgressRing(string? id)

Example

private readonly IUIProgressRing _spinner
    = GUI.ProgressRing("load-spinner");

// Show a spinner during async work:
_spinner.StartIndeterminateProgress();
await LoadDataAsync();
_spinner.StopIndeterminateProgress();

IUIIcon

Renders a single glyph from a registered icon font. Useful for decorating labels, cards, or any layout position that calls for a standalone icon. Factory:
public static IUIIcon Icon(string fontName, char glyph)
public static IUIIcon Icon(string? id, string fontName, char glyph)

Properties

PropertyTypeDefaultDescription
FontNamestring(required)The registered font name containing the glyph.
Glyphchar(required)The Unicode character within FontName.
Sizeint16Icon size in device-independent pixels.

Events

FontNameChanged, GlyphChanged, SizeChanged

Fluent Methods

IUIIcon FontName(this IUIIcon element, string fontName)
IUIIcon Glyph(this IUIIcon element, char glyph)
IUIIcon Size(this IUIIcon element, int size)

Example

GUI.Icon("FluentSystemIcons", '\uE8A5')
   .Size(24);

// Inside a stack with a label to create a labelled icon:
GUI.Stack()
   .Horizontal()
   .SmallSpacing()
   .WithChildren(
       GUI.Icon("FluentSystemIcons", '\uE8A5').Size(20),
       GUI.Label(null, "Encode").Style(UILabelStyle.BodyStrong));

Build docs developers (and LLMs) love