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.

Input components capture user interaction — text entry, toggles, selections, and file picks. All are created through the static GUI factory class (namespace DevToys.Api) and expose a fluent builder API. Event handlers may be synchronous (Action) or asynchronous (Func<..., ValueTask>); both overloads are provided for every event.

IUISingleLineTextInput

A single-line text field for displaying or editing plain text. It serves as the base interface for IUIMultiLineTextInput, IUINumberInput, IUIPasswordInput, and IUIDiffTextInput. Factory:
public static IUISingleLineTextInput SingleLineTextInput()
public static IUISingleLineTextInput SingleLineTextInput(string? id)

Key Properties

PropertyTypeDefaultDescription
Textstring""The current text content.
IsReadOnlyboolfalseWhen true, the user cannot edit the text.
CanCopyWhenEditableboolfalseShows the copy button even when the control is editable.
CommandBarExtraContentIUIElement?nullExtra element rendered in the command bar above the input.
HideCommandBarboolfalseHides the command bar (and CommandBarExtraContent) entirely.

Key Events

TextChanged, IsReadOnlyChanged, CanCopyWhenEditableChanged, CommandBarExtraContentChanged, HideCommandBarChanged

Fluent Methods

T ReadOnly<T>(this T element) where T : IUISingleLineTextInput
T Editable<T>(this T element) where T : IUISingleLineTextInput
T CanCopyWhenEditable<T>(this T element) where T : IUISingleLineTextInput
T CannotCopyWhenEditable<T>(this T element) where T : IUISingleLineTextInput
T Text<T>(this T element, string text) where T : IUISingleLineTextInput
T HideCommandBar<T>(this T element) where T : IUISingleLineTextInput
T ShowCommandBar<T>(this T element) where T : IUISingleLineTextInput
T CommandBarExtraContent<T>(this T element, IUIElement? extraElement) where T : IUISingleLineTextInput
T OnTextChanged<T>(this T element, Func<string, ValueTask>) where T : IUISingleLineTextInput
T OnTextChanged<T>(this T element, Action<string>) where T : IUISingleLineTextInput

Example

GUI.SingleLineTextInput("url-input")
   .Text("https://example.com")
   .OnTextChanged(text => Console.WriteLine($"URL changed: {text}"));

IUIMultiLineTextInput

A multi-line code/text editor powered by Monaco Editor. Inherits all members of IUISingleLineTextInput and adds syntax highlighting, line numbers, wrap modes, text span highlighting, and hover tooltips. Factory:
public static IUIMultiLineTextInput MultiLineTextInput()
public static IUIMultiLineTextInput MultiLineTextInput(string? id)
public static IUIMultiLineTextInput MultiLineTextInput(string? id, string programmingLanguageName)

Additional Properties

PropertyTypeDefaultDescription
SyntaxColorizationLanguageNamestring""Programming language name for syntax highlighting (e.g. "json", "xml", "csharp").
IsExtendableToFullScreenboolfalseWhether the editor can expand to fill the entire tool pane.
WrapModeUITextWrapModeAutoLine wrap behaviour: Auto, Wrap, or NoWrap.
LineNumberModeUITextLineNumberAutoLine number display: Auto, Show, or Hide.
HighlightedSpansIReadOnlyList<UIHighlightedTextSpan>emptySpans of text to highlight with a specific colour.
HoverTooltipsIReadOnlyList<UIHoverTooltip>emptyTooltips shown when the user hovers over a word.
TextInputToSynchronizeScrollBarWithIUIMultiLineTextInput?nullAnother editor whose scroll position is synchronised with this one.
SelectionTextSpan(0,0)The current selection or caret position.

Additional Events

SyntaxColorizationLanguageNameChanged, IsExtendableToFullScreenChanged, WrapModeChanged, LineNumberModeChanged, HighlightedSpansChanged, HoverTooltipChanged, TextInputToSynchronizeScrollBarWithChanged, SelectionChanged

Additional Fluent Methods

// Language
IUIMultiLineTextInput Language(this IUIMultiLineTextInput element, string programmingLanguageName)

// Full-screen support
IUIMultiLineTextInput Extendable(this IUIMultiLineTextInput element)
IUIMultiLineTextInput NotExtendable(this IUIMultiLineTextInput element)

// Wrap mode
IUIMultiLineTextInput AutoWrap(this IUIMultiLineTextInput element)
IUIMultiLineTextInput AlwaysWrap(this IUIMultiLineTextInput element)
IUIMultiLineTextInput NeverWrap(this IUIMultiLineTextInput element)

// Line numbers
IUIMultiLineTextInput AutoLineNumber(this IUIMultiLineTextInput element)
IUIMultiLineTextInput AlwaysShowLineNumber(this IUIMultiLineTextInput element)
IUIMultiLineTextInput NeverShowLineNumber(this IUIMultiLineTextInput element)

// Highlighting
IUIMultiLineTextInput Highlight(this IUIMultiLineTextInput element, params UIHighlightedTextSpan[] spans)

// Hover tooltips
IUIMultiLineTextInput HoverTooltip(this IUIMultiLineTextInput element, params UIHoverTooltip[] tooltips)

// Scroll sync
IUIMultiLineTextInput SynchronizeScrollBarWith(this IUIMultiLineTextInput element, IUIMultiLineTextInput? otherElement)

// Selection
IUIMultiLineTextInput Select(this IUIMultiLineTextInput element, TextSpan span)
IUIMultiLineTextInput Select(this IUIMultiLineTextInput element, int start, int length)

Example

private readonly IUIMultiLineTextInput _inputEditor
    = GUI.MultiLineTextInput("json-input", "json")
         .Extendable()
         .AlwaysShowLineNumber()
         .OnTextChanged(OnInputChangedAsync);

private readonly IUIMultiLineTextInput _outputEditor
    = GUI.MultiLineTextInput("json-output", "json")
         .ReadOnly()
         .Extendable();

IUIDiffTextInput

A side-by-side or inline diff view that highlights differences between an original and a modified text. Inherits from IUISingleLineTextInput; the base Text property maps to OriginalText. Factory:
public static IUIDiffTextInput DiffTextInput()
public static IUIDiffTextInput DiffTextInput(string? id)

Additional Properties

PropertyTypeDefaultDescription
OriginalTextstring""The left-hand (original) text. Same as IUISingleLineTextInput.Text.
ModifiedTextstring""The right-hand (modified) text.
InlineModeboolfalseWhen true, differences are shown inline instead of side by side.
IsExtendableToFullScreenboolfalseWhether the control can expand to fill the tool pane.

Additional Fluent Methods

T OriginalText<T>(this T element, string text) where T : IUIDiffTextInput
T ModifiedText<T>(this T element, string text) where T : IUIDiffTextInput
IUIDiffTextInput InlineView(this IUIDiffTextInput element)
IUIDiffTextInput SplitView(this IUIDiffTextInput element)
IUIDiffTextInput Extendable(this IUIDiffTextInput element)
IUIDiffTextInput NotExtendable(this IUIDiffTextInput element)

Example

GUI.DiffTextInput("diff-view")
   .SplitView()
   .Extendable()
   .OriginalText("Hello World")
   .ModifiedText("Hello DevToys");

IUIPasswordInput

A single-line input that masks typed characters. Inherits all members of IUISingleLineTextInput with no additional API surface — the masking is applied automatically by the rendering layer. Factory:
public static IUIPasswordInput PasswordInput()
public static IUIPasswordInput PasswordInput(string? id)
All fluent methods from IUISingleLineTextInput (ReadOnly, Text, OnTextChanged, etc.) apply unchanged.

IUINumberInput

A single-line numeric input with optional minimum, maximum, and step constraints. Inherits all members of IUISingleLineTextInput; Value is derived from the parsed Text. Factory:
public static IUINumberInput NumberInput()
public static IUINumberInput NumberInput(
    string? id,
    double min   = int.MinValue,
    double max   = int.MaxValue,
    double step  = 1)

Additional Properties

PropertyTypeDefaultDescription
Mindoubleint.MinValueMinimum allowed value.
Maxdoubleint.MaxValueMaximum allowed value.
Stepdouble1Interval between legal values.
Valuedouble(derived)The parsed numeric value, clamped to [Min, Max].

Additional Events

MinChanged, MaxChanged, StepChanged, ValueChanged

Additional Fluent Methods

IUINumberInput Minimum(this IUINumberInput element, double minimum)
IUINumberInput Maximum(this IUINumberInput element, double maximum)
IUINumberInput Step(this IUINumberInput element, double step)
IUINumberInput Value(this IUINumberInput element, double value)
IUINumberInput OnValueChanged(this IUINumberInput element, Func<double, ValueTask>)
IUINumberInput OnValueChanged(this IUINumberInput element, Action<double>)

Example

GUI.NumberInput("indent-size")
   .Minimum(1)
   .Maximum(8)
   .Step(1)
   .Value(4)
   .OnValueChanged(size => _indentSize = (int)size);

IUIButton

A clickable button that can display text, an icon, or both. Supports accent, neutral, and hyperlink visual styles. Factory:
public static IUIButton Button()
public static IUIButton Button(string? id)
public static IUIButton Button(string? id, string text)

Properties

PropertyTypeDefaultDescription
Textstring?nullLabel text displayed on the button.
IsAccentboolfalseRenders the button in the theme’s accent colour.
IsHyperlinkboolfalseRenders the button as a hyperlink. Mutually exclusive with IsAccent.
IconFontNamestring?nullFont name for the button’s icon glyph.
IconGlyphchar'\0'Glyph character in IconFontName.
OnClickActionFunc<ValueTask>?nullAction invoked on click.

Events

TextChanged, IsAccentChanged, IconFontNameChanged, IconGlyphChanged

Fluent Methods

IUIButton Text(this IUIButton element, string? text)
IUIButton AccentAppearance(this IUIButton element)
IUIButton NeutralAppearance(this IUIButton element)
IUIButton HyperlinkAppearance(this IUIButton element)
IUIButton Icon(this IUIButton element, string fontName, char glyph)
IUIButton OnClick(this IUIButton element, Func<ValueTask>? actionOnClick)
IUIButton OnClick(this IUIButton element, Action? actionOnClick)

Example

GUI.Button("convert-btn")
   .Text("Convert")
   .AccentAppearance()
   .OnClick(OnConvertClickedAsync);

GUI.Button("clear-btn")
   .Text("Clear")
   .Icon("FluentSystemIcons", '\uE75C')
   .OnClick(() => _editor.Text(string.Empty));

IUISwitch

A toggle control with on/off state. Displays customisable “On” and “Off” labels (defaults: "On" / "Off"). Factory:
public static IUISwitch Switch()
public static IUISwitch Switch(string? id)

Properties

PropertyTypeDefaultDescription
IsOnboolfalseCurrent state of the switch.
OnTextstring?"On"Label shown when the switch is on.
OffTextstring?"Off"Label shown when the switch is off.

Events

IsOnChanged, OnTextChanged, OffTextChanged

Fluent Methods

IUISwitch On(this IUISwitch element)
IUISwitch Off(this IUISwitch element)
IUISwitch OnText(this IUISwitch element, string? text)
IUISwitch OffText(this IUISwitch element, string? text)
IUISwitch OnToggle(this IUISwitch element, Func<bool, ValueTask>? actionOnToggle)
IUISwitch OnToggle(this IUISwitch element, Action<bool>? actionOnToggle)
The toggle action receives the new bool state as its argument.

Example

GUI.Switch("pretty-print-switch")
   .OnText("Pretty")
   .OffText("Minified")
   .Off()
   .OnToggle(isOn => _prettyPrint = isOn);

IUISelectDropDownList

A drop-down list from which the user selects one IUIDropDownListItem. Factory:
public static IUISelectDropDownList SelectDropDownList()
public static IUISelectDropDownList SelectDropDownList(string? id)

Properties

PropertyTypeDefaultDescription
ItemsIUIDropDownListItem[]?nullThe list of items.
SelectedItemIUIDropDownListItem?nullThe currently selected item.
OnItemSelectedActionFunc<IUIDropDownListItem?, ValueTask>?nullInvoked when selection changes.

Events

ItemsChanged, SelectedItemChanged

Fluent Methods

IUISelectDropDownList WithItems(this IUISelectDropDownList element, params IUIDropDownListItem[] items)
IUISelectDropDownList Select(this IUISelectDropDownList element, IUIDropDownListItem? item)
IUISelectDropDownList Select(this IUISelectDropDownList element, int index)
IUISelectDropDownList OnItemSelected(this IUISelectDropDownList element, Func<IUIDropDownListItem?, ValueTask>?)
IUISelectDropDownList OnItemSelected(this IUISelectDropDownList element, Action<IUIDropDownListItem?>?)

IUIDropDownListItem

Items are created with GUI.Item(...):
IUIDropDownListItem Item(object? value)                  // text = value.ToString()
IUIDropDownListItem Item(string? text, object? value)
PropertyTypeDescription
Textstring?Label shown in the list.
Valueobject?Associated data value.

Example

private enum OutputFormat { Json, Yaml, Xml }

private readonly IUISelectDropDownList _formatList
    = GUI.SelectDropDownList("format-list")
         .WithItems(
             GUI.Item("JSON", OutputFormat.Json),
             GUI.Item("YAML", OutputFormat.Yaml),
             GUI.Item("XML",  OutputFormat.Xml))
         .Select(0)  // select first item by index
         .OnItemSelected(item =>
         {
             if (item?.Value is OutputFormat fmt)
                 _outputFormat = fmt;
         });

IUIFileSelector

A drag-and-drop zone and file picker button. Selected files are exposed as SandboxedFileReader[] — a sandboxed stream abstraction for cross-platform file access. Factory:
public static IUIFileSelector FileSelector()
public static IUIFileSelector FileSelector(string? id)

Properties

PropertyTypeDefaultDescription
SelectedFilesSandboxedFileReader[]emptyFiles currently selected.
CanSelectManyFilesboolfalseAllows multi-file selection when true.
AllowedFileExtensionsstring[]empty (all)Extensions the file picker will accept. Empty means any file type.
OnFilesSelectedActionFunc<SandboxedFileReader[], ValueTask>?nullInvoked when files are selected.

Events

CanSelectManyFilesChanged, AllowedFileExtensionsChanged

Fluent Methods

IUIFileSelector CanSelectOneFile(this IUIFileSelector element)
IUIFileSelector CanSelectManyFiles(this IUIFileSelector element)
IUIFileSelector LimitFileTypesTo(this IUIFileSelector element, params string[] fileExtensions)
IUIFileSelector LimitFileTypesToImages(this IUIFileSelector element)
IUIFileSelector WithFiles(this IUIFileSelector element, params SandboxedFileReader[] files)
IUIFileSelector OnFilesSelected(this IUIFileSelector element, Func<SandboxedFileReader[], ValueTask>?)
IUIFileSelector OnFilesSelected(this IUIFileSelector element, Action<SandboxedFileReader[]>?)

Example

GUI.FileSelector("image-picker")
   .CanSelectOneFile()
   .LimitFileTypesToImages()
   .OnFilesSelected(async files =>
   {
       foreach (SandboxedFileReader file in files)
       {
           using Stream stream = await file.GetNewAccessToFileContentAsync(CancellationToken.None);
           // process stream...
           // Remember to dispose the SandboxedFileReader when done:
           file.Dispose();
       }
   });
SandboxedFileReader contains a stream that is not disposed automatically. Always call Dispose() on each reader once you have finished reading the file, to avoid resource leaks.

Build docs developers (and LLMs) love