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.

DevToys provides a complete set of text input components for both tool input and output. The most capable are the Monaco Editor-backed MultiLineTextInput and DiffTextInput, which deliver syntax highlighting, hover tooltips, custom text highlighting, scrollbar synchronisation, and optional full-screen expansion. For shorter values there are SingleLineTextInput, PasswordInput, and NumberInput. All text inputs inherit from IUISingleLineTextInput, which itself extends IUITitledElementWithChildren. This means every text input can have a Title, can be made read-only, and can host extra content in its command bar.

MultiLineTextInput

IUIMultiLineTextInput is powered by Monaco Editor — the same editor used in VS Code. It is the right choice for any multi-line text, especially when syntax highlighting is useful to the user.

Key properties

PropertyTypeDefaultDescription
Textstring""The current text content.
SyntaxColorizationLanguageNamestring""Language ID for syntax highlighting (e.g. "json", "xml", "sql").
IsReadOnlyboolfalsePrevent editing. Adds a Copy button to the command bar.
IsExtendableToFullScreenboolfalseAllow the editor to expand to fill the tool’s boundaries.
WrapModeUITextWrapModeAutoControls line wrapping.
LineNumberModeUITextLineNumberAutoControls line number visibility.
HighlightedSpansIReadOnlyList<UIHighlightedTextSpan>emptySpans to highlight with a custom colour.
HoverTooltipsIReadOnlyList<UIHoverTooltip>emptyTooltips shown when the user hovers a word.
TextInputToSynchronizeScrollBarWithIUIMultiLineTextInput?nullAnother editor whose scrollbars should stay in sync with this one.
SelectionTextSpancaret at 0The primary selection or caret position.

UITextWrapMode

ValueFluent methodBehaviour
Auto.AutoWrap()Respects the user’s global DevToys setting.
Wrap.AlwaysWrap()Always wrap long lines.
NoWrap.NeverWrap()Never wrap; use a horizontal scrollbar.

UITextLineNumber

ValueFluent methodBehaviour
Auto.AutoLineNumber()Respects the user’s global DevToys setting.
Show.AlwaysShowLineNumber()Always display line numbers.
Hide.NeverShowLineNumber()Never display line numbers.

Example

using static DevToys.Api.GUI;

private IUIMultiLineTextInput _inputEditor
    = MultiLineTextInput("json-input")
        .Title("JSON Input")
        .Language("json")
        .Extendable()
        .AlwaysShowLineNumber()
        .OnTextChanged(OnInputTextChanged);

private IUIMultiLineTextInput _outputEditor
    = MultiLineTextInput("json-output")
        .Title("Formatted Output")
        .Language("json")
        .ReadOnly()
        .Extendable()
        .SynchronizeScrollBarWith(_inputEditor);  // ← scrollbars stay in sync

public UIToolView View
    => new UIToolView(
        isScrollable: false,
        SplitGrid()
            .Vertical()
            .WithLeftPaneChild(_inputEditor)
            .WithRightPaneChild(_outputEditor));

SingleLineTextInput

IUISingleLineTextInput is a compact, single-line text field for short values such as URLs, file paths, or API keys.

Key properties

PropertyTypeDefaultDescription
Textstring""The current text.
IsReadOnlyboolfalsePrevent editing.
CanCopyWhenEditableboolfalseShow the Copy button even when the field is editable.
HideCommandBarboolfalseHide the command bar (Copy button and CommandBarExtraContent).
CommandBarExtraContentIUIElement?nullExtra element added to the command bar.

Example

using static DevToys.Api.GUI;

IUISingleLineTextInput urlInput =
    SingleLineTextInput("target-url")
        .Title("Target URL")
        .Text("https://example.com")
        .OnTextChanged(OnUrlChanged);

IUISingleLineTextInput resultField =
    SingleLineTextInput("result")
        .Title("Encoded URL")
        .ReadOnly()
        .CanCopyWhenEditable();

DiffTextInput

IUIDiffTextInput renders a Monaco-backed side-by-side or inline diff between two strings. Use it whenever the tool’s purpose is to compare text — for example a formatter that shows what changed, or a JWT decoder that shows original vs decoded.

Key properties

IUIDiffTextInput extends IUISingleLineTextInput. The base Text property is an alias for OriginalText.
PropertyTypeDefaultDescription
OriginalTextstring""The left-hand (“before”) text. Same as Text.
ModifiedTextstring""The right-hand (“after”) text.
InlineModeboolfalsetrue = unified inline diff; false = split side-by-side view.
IsExtendableToFullScreenboolfalseAllow full-screen expansion.

Example

using static DevToys.Api.GUI;

private IUIDiffTextInput _diffView
    = DiffTextInput("diff")
        .Title("Diff")
        .OriginalText(string.Empty)
        .ModifiedText(string.Empty)
        .SplitView()
        .Extendable();

// After the user provides both texts:
private void ShowDiff(string before, string after)
{
    _diffView
        .OriginalText(before)
        .ModifiedText(after);
}
Call .InlineView() to toggle to a unified diff view, or .SplitView() to return to the side-by-side layout. Both methods are available at any time, not just during initialisation.

PasswordInput

IUIPasswordInput is a single-line text input that masks its characters — suitable for secret keys, tokens, or passwords. It inherits the full IUISingleLineTextInput API.

Example

using static DevToys.Api.GUI;

IUIPasswordInput apiKeyInput =
    PasswordInput("api-key")
        .Title("API Key")
        .OnTextChanged(OnApiKeyChanged);

NumberInput

IUINumberInput constrains the input to numeric values and provides optional minimum, maximum, and step constraints. It extends IUISingleLineTextInput; the underlying Text property stores the string representation of the number, and the Value property returns it as a double (clamped to Min/Max).

Key properties

PropertyTypeDefaultDescription
Valuedouble0 (clamped)The current numeric value, clamped between Min and Max.
Mindoubleint.MinValueMinimum allowed value.
Maxdoubleint.MaxValueMaximum allowed value.
Stepdouble1The increment/decrement step for spinner controls.

Example

using static DevToys.Api.GUI;

IUINumberInput iterationsInput =
    NumberInput("iterations")
        .Title("Hash Iterations")
        .Minimum(1)
        .Maximum(1_000_000)
        .Step(1000)
        .Value(10_000)
        .OnValueChanged(OnIterationsChanged);

IUINumberInput precisionInput =
    NumberInput("decimal-places")
        .Title("Decimal Places")
        .Minimum(0)
        .Maximum(15)
        .Step(1)
        .Value(2)
        .OnValueChanged(OnPrecisionChanged);
NumberInput derives from SingleLineTextInput, so .ReadOnly(), .Title(), and .CommandBarExtraContent() all apply to it as well.

Build docs developers (and LLMs) love