Class Sealed
public sealed class MokaJsonToolbar : ComponentBase

Namespace: Moka.Blazor.Json.Components

Toggleable toolbar providing search, collapse/expand, format, and copy actions.

Inheritance

Inherits from: ComponentBase

Properties

NameDescription
IsBusy Whether a heavy operation is in progress (disables action buttons).
IsFormatted Whether the JSON is currently formatted (pretty-printed).
OnCollapseAll Callback to collapse all nodes.
OnCopyAll Callback to copy all JSON to clipboard.
OnExpandAll Callback to expand all nodes.
OnExport Callback to export/download the JSON as a file.
OnFormatToggle Callback to toggle between formatted and minified display.
OnSearchToggle Callback to toggle the search overlay.
OnSettingsToggle Callback to toggle the settings panel.
ShowSettingsButton Whether the settings gear button is shown. Default is true.
ToolbarExtra Optional extra content to render at the end of the toolbar.
ToolbarMode How toolbar buttons are displayed: text, icons, or both.

IsBusy

bool MokaJsonToolbar.IsBusy { get; set; }

Whether a heavy operation is in progress (disables action buttons).

IsFormatted

bool MokaJsonToolbar.IsFormatted { get; set; }

Whether the JSON is currently formatted (pretty-printed).

OnCollapseAll

EventCallback MokaJsonToolbar.OnCollapseAll { get; set; }

Callback to collapse all nodes.

OnCopyAll

EventCallback MokaJsonToolbar.OnCopyAll { get; set; }

Callback to copy all JSON to clipboard.

OnExpandAll

EventCallback MokaJsonToolbar.OnExpandAll { get; set; }

Callback to expand all nodes.

OnExport

EventCallback MokaJsonToolbar.OnExport { get; set; }

Callback to export/download the JSON as a file.

OnFormatToggle

EventCallback MokaJsonToolbar.OnFormatToggle { get; set; }

Callback to toggle between formatted and minified display.

OnSearchToggle

EventCallback MokaJsonToolbar.OnSearchToggle { get; set; }

Callback to toggle the search overlay.

OnSettingsToggle

EventCallback MokaJsonToolbar.OnSettingsToggle { get; set; }

Callback to toggle the settings panel.

ShowSettingsButton

bool MokaJsonToolbar.ShowSettingsButton { get; set; }

Whether the settings gear button is shown. Default is true.

ToolbarExtra

RenderFragment? MokaJsonToolbar.ToolbarExtra { get; set; }

Optional extra content to render at the end of the toolbar.

ToolbarMode

MokaJsonToolbarMode MokaJsonToolbar.ToolbarMode { get; set; }

How toolbar buttons are displayed: text, icons, or both.

Type Relationships
classDiagram
                    style MokaJsonToolbar fill:#f9f,stroke:#333,stroke-width:2px
                    MokaJsonToolbar --|> ComponentBase : inherits
                
View Source
/// <summary>
///     Toggleable toolbar providing search, collapse/expand, format, and copy actions.
/// </summary>
public sealed partial class MokaJsonToolbar : ComponentBase
{
    /// <summary>Callback to toggle the search overlay.</summary>
    [Parameter]
    public EventCallback OnSearchToggle { get; set; }

    /// <summary>Callback to expand all nodes.</summary>
    [Parameter]
    public EventCallback OnExpandAll { get; set; }

    /// <summary>Callback to collapse all nodes.</summary>
    [Parameter]
    public EventCallback OnCollapseAll { get; set; }

    /// <summary>Callback to toggle between formatted and minified display.</summary>
    [Parameter]
    public EventCallback OnFormatToggle { get; set; }

    /// <summary>Callback to copy all JSON to clipboard.</summary>
    [Parameter]
    public EventCallback OnCopyAll { get; set; }

    /// <summary>Callback to export/download the JSON as a file.</summary>
    [Parameter]
    public EventCallback OnExport { get; set; }

    /// <summary>Whether the JSON is currently formatted (pretty-printed).</summary>
    [Parameter]
    public bool IsFormatted { get; set; } = true;

    /// <summary>Optional extra content to render at the end of the toolbar.</summary>
    [Parameter]
    public RenderFragment? ToolbarExtra { get; set; }

    /// <summary>Whether a heavy operation is in progress (disables action buttons).</summary>
    [Parameter]
    public bool IsBusy { get; set; }

    /// <summary>How toolbar buttons are displayed: text, icons, or both.</summary>
    [Parameter]
    public MokaJsonToolbarMode ToolbarMode { get; set; } = MokaJsonToolbarMode.Text;

    /// <summary>Callback to toggle the settings panel.</summary>
    [Parameter]
    public EventCallback OnSettingsToggle { get; set; }

    /// <summary>Whether the settings gear button is shown. Default is <c>true</c>.</summary>
    [Parameter]
    public bool ShowSettingsButton { get; set; } = true;
    private bool ShowIcon => ToolbarMode is not MokaJsonToolbarMode.Text;
    private bool ShowText => ToolbarMode is not MokaJsonToolbarMode.Icon;
}
Was this page helpful?