DeepWorks Studios Blazor Component Library

Demo user Administrator ยท Blazor Server Library 20261206222504-6e8ff32.dirty

DwsButton

Looking for a link-styled or navigation button? Use DwsLink instead - DwsButton stays focused on actions.

API Reference — Button API Reference — Button Group API Reference — Split Button

Common patterns

Button reference

Appearances

Appearance ranks the actions of one place: Filled for the main action (one per view), Outline for a secondary one, Text for quiet actions such as Discard, Hypertext for an action that reads like a link, and Icon for compact toolbars, named by its Tooltip.

Show Code
Button.razor

<div class="d-flex flex-wrap align-items-center gap-2">
    <DwsButton Name="ButtonDemo_Appearance_Filled" Appearance="DwsAppearance.Filled">Publish</DwsButton>
    <DwsButton Name="ButtonDemo_Appearance_Outline" Appearance="DwsAppearance.Outline">Preview</DwsButton>
    <DwsButton Name="ButtonDemo_Appearance_Text" Appearance="DwsAppearance.Text">Discard</DwsButton>
    <DwsButton Name="ButtonDemo_Appearance_Hypertext" Appearance="DwsAppearance.Hypertext">View history</DwsButton>
    <DwsButton Name="ButtonDemo_Appearance_Icon" Appearance="DwsAppearance.Icon" Icon="@Icons.Solid.ShareNodes" Tooltip="Share" />
</div>

Disabled, with a reason

Disabled turns a button of any appearance off: it is dimmed, announced as unavailable and ignores clicks. Its Tooltip still shows on hover, so it can say why - hover Publish while the switch is off.

Show Code
Button.razor

<DwsSwitch Name="ButtonDemo_Disabled_Reviewed" Label="I have reviewed the changes" @bind-Value="_changesReviewed" />
<div class="d-flex flex-wrap align-items-center gap-2 mt-2">
    <DwsButton Name="ButtonDemo_Disabled_Publish" Appearance="DwsAppearance.Filled" Disabled="@(!_changesReviewed)" Tooltip="@PublishTooltip">Publish</DwsButton>
    <DwsButton Name="ButtonDemo_Disabled_Preview" Appearance="DwsAppearance.Outline" Disabled="@(!_changesReviewed)">Preview</DwsButton>
    <DwsButton Name="ButtonDemo_Disabled_Discard" Appearance="DwsAppearance.Text" Disabled="@(!_changesReviewed)">Discard</DwsButton>
    <DwsButton Name="ButtonDemo_Disabled_History" Appearance="DwsAppearance.Hypertext" Disabled="@(!_changesReviewed)">View history</DwsButton>
    <DwsButton Name="ButtonDemo_Disabled_Share" Appearance="DwsAppearance.Icon" Icon="@Icons.Solid.ShareNodes" Tooltip="Share" Disabled="@(!_changesReviewed)" />
</div>
Button.razor.cs
private bool _changesReviewed;

// The tooltip of a disabled button still shows on hover: it says why the button is off.
private string PublishTooltip => _changesReviewed ? string.Empty : "Review the changes before publishing";

Colours with a meaning

Color gives an action its meaning: Primary for the main action, Secondary for neutral ones, Success to confirm, Warning for an action with consequences, Info for help and details, Error for destructive actions. Every appearance takes the colour.

Show Code
Button.razor

@foreach ((DwsColor color, string icon) in _colorActions)
{
    <div class="d-flex flex-wrap align-items-center gap-2 mb-2">
        <DwsButton Name="@($"ButtonDemo_Color_{color}_Filled")" Appearance="DwsAppearance.Filled" Color="color">@ColorAction(color)</DwsButton>
        <DwsButton Name="@($"ButtonDemo_Color_{color}_Outline")" Appearance="DwsAppearance.Outline" Color="color">@ColorAction(color)</DwsButton>
        <DwsButton Name="@($"ButtonDemo_Color_{color}_Hypertext")" Appearance="DwsAppearance.Hypertext" Color="color">@ColorAction(color)</DwsButton>
        <DwsButton Name="@($"ButtonDemo_Color_{color}_Icon")" Appearance="DwsAppearance.Icon" Color="color" Icon="@icon" Tooltip="@ColorAction(color)" />
    </div>
}
Button.razor.cs
private readonly (DwsColor Color, string Icon)[] _colorActions =
[
    (DwsColor.Primary, Icons.Solid.FloppyDisk),
    (DwsColor.Secondary, Icons.Solid.BoxArchive),
    (DwsColor.Success, Icons.Solid.Check),
    (DwsColor.Warning, Icons.Solid.TriangleExclamation),
    (DwsColor.Info, Icons.Solid.Info),
    (DwsColor.Error, Icons.Solid.TrashCan),
];

private static string ColorAction(DwsColor color) => color switch
{
    DwsColor.Primary => "Save",
    DwsColor.Secondary => "Archive",
    DwsColor.Success => "Approve",
    DwsColor.Warning => "Report a problem",
    DwsColor.Info => "Show details",
    DwsColor.Error => "Delete",
    _ => color.ToString(),
};

Neutral buttons: Text and Link colour

Color=Text gives a neutral button in the theme's text colour, for tools that should not compete with the main action: an Outline button with a text-coloured border (filled while hovered or pressed) and an Icon button that does not take the primary colour. Color=Link draws an Icon button in the link colour, for an action that leaves the page.

Show Code
Button.razor

<div class="d-flex flex-wrap align-items-center gap-2">
    <DwsButton Name="ButtonDemo_TextColor_Filter" Appearance="DwsAppearance.Outline" Color="DwsColor.Text" StartIcon="@Icons.Solid.Filter">Filter</DwsButton>
    <DwsButton Name="ButtonDemo_TextColor_Export" Appearance="DwsAppearance.Outline" Color="DwsColor.Text" StartIcon="@Icons.Solid.Download" Disabled="true">Export</DwsButton>
    <DwsButton Name="ButtonDemo_TextColor_Settings" Appearance="DwsAppearance.Icon" Color="DwsColor.Text" Icon="@Icons.BS.Gear" Tooltip="Column settings" />
    <DwsButton Name="ButtonDemo_TextColor_Open" Appearance="DwsAppearance.Icon" Color="DwsColor.Link" Icon="@Icons.BS.BoxArrowUpRight" Tooltip="Open in a new tab" />
</div>

Sizes

ButtonSize sets Small, Medium (the default) or Large, for text and icon buttons alike: Small for actions inside dense content such as a comment, Large for a call to action that should stand out.

Show Code
Button.razor

<div class="d-flex flex-wrap align-items-center gap-2">
    <DwsButton Name="ButtonDemo_Size_Small" Appearance="DwsAppearance.Outline" ButtonSize="DwsSize.Small" StartIcon="@Icons.Solid.Reply">Reply</DwsButton>
    <DwsButton Name="ButtonDemo_Size_Medium" Appearance="DwsAppearance.Filled" ButtonSize="DwsSize.Medium" StartIcon="@Icons.Solid.Comment">Add comment</DwsButton>
    <DwsButton Name="ButtonDemo_Size_Large" Appearance="DwsAppearance.Filled" ButtonSize="DwsSize.Large" StartIcon="@Icons.Solid.Rocket">Start free trial</DwsButton>
</div>
<div class="d-flex flex-wrap align-items-center gap-2 mt-2">
    <DwsButton Name="ButtonDemo_Size_IconSmall" Appearance="DwsAppearance.Icon" ButtonSize="DwsSize.Small" Icon="@Icons.Solid.Heart" Tooltip="Like" />
    <DwsButton Name="ButtonDemo_Size_IconMedium" Appearance="DwsAppearance.Icon" ButtonSize="DwsSize.Medium" Icon="@Icons.Solid.Heart" Tooltip="Like" />
    <DwsButton Name="ButtonDemo_Size_IconLarge" Appearance="DwsAppearance.Icon" ButtonSize="DwsSize.Large" Icon="@Icons.Solid.Heart" Tooltip="Like" />
</div>

Width and height

MinWidth makes OK and Cancel equally wide. Width and Height give a touch kiosk button a fixed size. MaxWidth with MinHeight and MaxHeight lets a long label wrap onto at most two lines. FullWidth stretches a button across its container, but an explicit Width always wins - Back to cart stays 200px. A MaxWidth is never wider than the container.

Show Code
Button.razor

@* MinWidth: OK and Cancel equally wide *@
<div class="d-flex flex-wrap gap-2 mb-3">
    <DwsButton Name="ButtonDemo_Box_Cancel" Appearance="DwsAppearance.Outline" MinWidth="96">Cancel</DwsButton>
    <DwsButton Name="ButtonDemo_Box_Ok" Appearance="DwsAppearance.Filled" MinWidth="96">OK</DwsButton>
</div>

@* Width / Height: a fixed touch target. MaxWidth + MinHeight / MaxHeight: a long label wraps onto two lines at most. *@
<div class="d-flex flex-wrap align-items-start gap-2 mb-3">
    <DwsButton Name="ButtonDemo_Box_CheckIn" Appearance="DwsAppearance.Filled" Color="DwsColor.Success" ButtonSize="DwsSize.Large"
               Width="200" Height="56" StartIcon="@Icons.Solid.CircleCheck">Check in</DwsButton>
    <DwsButton Name="ButtonDemo_Box_Attachments" Appearance="DwsAppearance.Outline" MaxWidth="220" MinHeight="44" MaxHeight="72"
               StartIcon="@Icons.Solid.Download">Download all attachments (12 files)</DwsButton>
</div>

@* FullWidth fills the container; an explicit Width wins over it. *@
<div style="max-width: 360px;">
    <DwsButton Name="ButtonDemo_Box_Payment" Appearance="DwsAppearance.Filled" FullWidth="true" Class="mb-2">Continue to payment</DwsButton>
    <DwsButton Name="ButtonDemo_Box_BackToCart" Appearance="DwsAppearance.Outline" FullWidth="true" Width="200">Back to cart</DwsButton>
</div>

Icons

StartIcon and EndIcon put an icon before or after the label - a forward arrow belongs at the end. Icon uses the icon slot before the label, which IsLoading replaces with the spinner. An Icon button shows Icon only, so give it a Tooltip as its name. The icons are hidden from screen readers: the label names the action.

Show Code
Button.razor

<div class="d-flex flex-wrap align-items-center gap-2">
    <DwsButton Name="ButtonDemo_Icons_New" Appearance="DwsAppearance.Filled" StartIcon="@Icons.Solid.Plus">New invoice</DwsButton>
    <DwsButton Name="ButtonDemo_Icons_Next" Appearance="DwsAppearance.Outline" EndIcon="@Icons.Solid.ArrowRight">Next step</DwsButton>
    <DwsButton Name="ButtonDemo_Icons_Approve" Appearance="DwsAppearance.Filled" Color="DwsColor.Success" StartIcon="@Icons.Solid.Check" EndIcon="@Icons.Solid.ArrowRight">Approve and continue</DwsButton>
    <DwsButton Name="ButtonDemo_Icons_Print" Appearance="DwsAppearance.Outline" Color="DwsColor.Secondary" Icon="@Icons.Solid.Print">Print</DwsButton>
    <DwsButton Name="ButtonDemo_Icons_Docs" Appearance="DwsAppearance.Hypertext" EndIcon="@Icons.BS.BoxArrowUpRight">Open documentation</DwsButton>
</div>

DwsButtonGroup

DwsSplitButton

Interface-Description Button

Name Typ Default Description
ToggleState bool false The current state of the toggle button. When the state changes, the OnToggleChanged event is raised.
Autofocus bool? null Whether the button automatically receives focus when the page loads.
Appearance DwsAppearance DwsAppearance.Filled The appearance of the button. Defaults to 'Filled'.
ButtonSize DwsSize DwsSize.Medium The size of the button, 'Medium' by default.
ChildContent RenderFragment? null The content of the button, provided as a RenderFragment.
Color DwsColor DwsColor.Undefined The color of the button. Undefined draws it in Primary (Link for the Hypertext appearance) on every render; the None appearance has no color.
ToggleOnHighlightColor DwsColor? null The color shown when the button is toggled on.
ToggleOffHighlightColor DwsColor? null The color shown when the button is toggled off.
Tooltip string string.Empty The tooltip text shown when the mouse pointer hovers over the button. It is still shown via CSS on a disabled button.
TooltipPosition DwsTooltipPosition DwsTooltipPosition.Top Kept so existing markup still compiles: the tooltip is the browser's native title, which has no position.
Icon string string.Empty The icon shown in the button. Replaced by a spinner while IsLoading is true.
StartIcon string string.Empty The icon shown at the start of the button.
EndIcon string string.Empty The icon shown at the end of the button.
IconStyle string string.Empty The style of the main icon.
StartIconStyle string string.Empty The style of the start icon.
EndIconStyle string string.Empty The style of the end icon.
Width int? null The width of the button.
MinWidth int? null The minimum width of the button.
MaxWidth int? null The maximum width of the button.
Height int? null The height of the button.
MaxHeight int? null The maximum height of the button.
MinHeight int? null The minimum height of the button.
ToggleMode bool false Whether the button operates in toggle mode.
OnClickPropagation bool false By default the click stops at the button: an @onclick on a parent element (clickable card, table row, list item) does NOT run when the button is pressed. Set true when the parent should receive the click as well - the button's OnClick runs first, then the parent's handler. See the 'Click propagation' section.
OnClickPreventDefault bool false Prevents the default behavior of the click event when true.
FullWidth bool false Stretches the button to 100% of the container width; an explicit Width takes priority.
IsLoading bool false Shows a spinner instead of the icon and blocks clicks. Controlled entirely by the caller.
AllowConcurrentClicks bool false By default a click is ignored while the async OnClick of the previous click is still running (no double submit). true runs every click.
LoadingText string string.Empty Overrides the spinner's aria-label while IsLoading is true.
Type DwsButtonType DwsButtonType.Button The native button type (Button/Submit/Reset). Always reset to Button when Disabled or IsLoading.
OnKeyDownPropagation bool true Whether a key pressed on the button reaches the Blazor key handlers of its ancestors. Set false for a button inside an element that acts on Enter or Space itself (a clickable banner). Blazor-level only: native listeners (a popover's Escape) still see the key. Works without an OnKeyDown handler.
Haptic DwsHapticFeedback DwsHapticFeedback.None Tactile feedback played inside the tap (no server round trip, so also on iOS) while the app has haptics switched on. Not played while the button is disabled, loading, part of a submitting form or armed for permission selection.
Name Typ Description
OnClick EventCallback<MouseEventArgs> Raised when the button is clicked.
OnKeyUp EventCallback<KeyboardEventArgs> Raised when a key is released while the button has focus. Wired only when bound (0.1.5): an unbound key handler cost a server round trip per key press on a focused button. Enter and Space reach OnClick through the click either way.
OnKeyDown EventCallback<KeyboardEventArgs> Raised when a key is pressed while the button has focus. Wired only when bound, like OnKeyUp.
OnFocus EventCallback<FocusEventArgs> Raised when the button gets the focus. Wired only when bound.
OnBlur EventCallback<FocusEventArgs> Raised when the button loses the focus. Wired only when bound.
OnToggleChanged EventCallback<bool> Raised when the toggle state of the button changes.
ToggleStateChanged EventCallback<bool> Delivers the new toggle state after a click so that @bind-ToggleState works. Without a binding, the parent's next render restores the old value.
IsLoadingChanged EventCallback<bool> Supports two-way binding of IsLoading.
Name Typ Default Description
Element ElementReference The associated web component. May be null if accessed before the component is rendered.
ComponentGuid Guid Unique identifier for the component.
TypeString string The name of the component type, obtained from reflection.
Authorized_RegisterEnabled bool false Indicates whether this component is enabled through a permission registry.
Authorized_RegisterSelected bool false Indicates whether this component is selected in permission selection mode.
GetInitializedState bool false Returns whether the component is initialized.
GetRenderModeState DwsRenderMode Returns the current render mode.
GetComponentState DwsComponentStateType Returns the current component state.
GetIsInteractiveState bool false Returns whether the component is interactive.
GetIsPrerenderingState bool false Returns whether the component is prerendering.
GetComponentLoadingState bool false Returns whether the component is loading.
IsFormBusy bool false Whether the DwsForm (or DwsFormBusyRegion) around the component is locked because its submit handler is running. The state itself is the cascaded FormBusyState (IDwsFormBusyState).
Name Typ Parameters Description
DebugInfo void Logs debug information about the component.
UpdateState void Updates the component's state and triggers StateHasChanged.
UpdateStateAsync Task Asynchronously updates the component's state and triggers StateHasChanged.
Dispose void Disposes the component and releases resources.
FocusAsync ValueTask bool containedInScrollableList Sets focus to the component's element.
Name Typ Default Description
Name string Required unique identifier for the component within its container.
Visible bool true Determines if the component is visible in the UI.
Disabled bool false Disables the form control, ensuring it doesn't participate in form submission.
ComponentNameSpace string The namespace for permission-based access control.
PermissionKey string? null A stable key that takes the place of Name in the generated permission namespace (Page.PermissionKey): the stored permission survives a rename, and components that share a key share one permission entry. Null: keyed by Name. Read once, when the component registers; an explicit ComponentNameSpace wins.
Class string Optional CSS class names.
Style string Optional in-line styles.
Tag object An optional user-defined object to store any additional data with the component.
BackReference DwsReference A reference to the enclosing component.
ID string The HTML ID attribute for the component.
AdditionalAttributes Dictionary<string, object> Further attributes of the <button> (aria-*, data-*, tabindex, id - the button renders no id of its own). The button's own class, style, title, aria-disabled, aria-busy, aria-pressed and data-dws-haptic win, and fall back to the dictionary's value where the button has none.
IgnorePermissionChecks bool false Bypasses all permission checks for this component.
IgnorePermissionSelection bool false Ignore permission selection mode for this component.
IgnoreFormBusy bool false Takes the component out of the submit lock of the DwsForm (or DwsFormBusyRegion) around it: IsFormBusy stays false for it.
Name Typ Description
OnInitializedCallbackStarted EventCallback Callback when OnInitialized starts.
OnInitializedCallback EventCallback Callback during OnInitialized.
OnInitializedCallbackCompleted EventCallback Callback when OnInitialized completes.
OnInitializedAsyncCallbackStarted EventCallback Callback when OnInitializedAsync starts.
OnInitializedAsyncCallback EventCallback Callback during OnInitializedAsync.
OnInitializedAsyncCallbackCompleted EventCallback Callback when OnInitializedAsync completes.
OnIsComponentLoadingChanged EventCallback<bool> Callback when IsComponentLoading changes.
OnCurrentRenderModeChanged EventCallback<DwsRenderMode> Callback when CurrentRenderMode changes.
OnComponentStateChanged EventCallback<DwsComponentStateType> Callback when ComponentState changes.

Interface-Description Button Group

Name Typ Default Description
Width int? null The width of the button group in pixels. Can be null if not set.
MinWidth int? null The minimum width of the button group in pixels.
MaxWidth int? null The maximum width of the button group in pixels.
Height int? null The height of the button group in pixels. Can be null if not set.
MinHeight int? null The minimum height of the button group in pixels.
MaxHeight int? null The maximum height of the button group in pixels.
Padding int? null The padding inside the button group in pixels.
ChildContent RenderFragment? null The content of the button group, provided as a RenderFragment.
Mode DwsButtonGroupMode DwsButtonGroupMode.None The mode of the button group: None (plain click passthrough), SingleToggle (only one button active; clicking the active button again deselects it) or MultipleToggle (each button can be toggled independently).
GroupSize DwsSize? null The size of the button group, which controls the proportions of the buttons.
Orientation DwsLayoutOrientation DwsLayoutOrientation.Horizontal The orientation of the button group, either horizontal or vertical.
Tooltip string string.Empty The tooltip text shown when hovering over the button group.
AriaLabel string? null Accessible name of the group (aria-label). If not set, the group is only announced through its buttons.
InitToggleState List<bool?>? new List<bool?>() Initial toggle states of the buttons in the group, provided as a list of nullable Boolean values.
DefaultToggleState bool? null The initial toggle state for all buttons in the group if no specific state is given (applied only at registration, not as a fallback on deselection).
TooltipPosition DwsTooltipPosition DwsTooltipPosition.Top Kept so existing markup still compiles: the tooltip is the browser's native title, which has no position.
Name Typ Description
OnToggleStateChanged EventCallback<int[]> Raised when the toggle state of one or more buttons in the group changes. Delivers an array of the indexes of the toggled buttons.
Name Typ Default Description
Element ElementReference The associated web component. May be null if accessed before the component is rendered.
ComponentGuid Guid Unique identifier for the component.
TypeString string The name of the component type, obtained from reflection.
Authorized_RegisterEnabled bool false Indicates whether this component is enabled through a permission registry.
Authorized_RegisterSelected bool false Indicates whether this component is selected in permission selection mode.
GetInitializedState bool false Returns whether the component is initialized.
GetRenderModeState DwsRenderMode Returns the current render mode.
GetComponentState DwsComponentStateType Returns the current component state.
GetIsInteractiveState bool false Returns whether the component is interactive.
GetIsPrerenderingState bool false Returns whether the component is prerendering.
GetComponentLoadingState bool false Returns whether the component is loading.
IsFormBusy bool false Whether the DwsForm (or DwsFormBusyRegion) around the component is locked because its submit handler is running. The state itself is the cascaded FormBusyState (IDwsFormBusyState).
Name Typ Parameters Description
DebugInfo void Logs debug information about the component.
UpdateState void Updates the component's state and triggers StateHasChanged.
UpdateStateAsync Task Asynchronously updates the component's state and triggers StateHasChanged.
Dispose void Disposes the component and releases resources.
FocusAsync ValueTask bool containedInScrollableList Sets focus to the component's element.
Name Typ Default Description
Name string Required unique identifier for the component within its container.
Visible bool true Determines if the component is visible in the UI.
Disabled bool false Disables the form control, ensuring it doesn't participate in form submission.
ComponentNameSpace string The namespace for permission-based access control.
PermissionKey string? null A stable key that takes the place of Name in the generated permission namespace (Page.PermissionKey): the stored permission survives a rename, and components that share a key share one permission entry. Null: keyed by Name. Read once, when the component registers; an explicit ComponentNameSpace wins.
Class string Optional CSS class names.
Style string Optional in-line styles.
Tag object An optional user-defined object to store any additional data with the component.
BackReference DwsReference A reference to the enclosing component.
ID string The HTML ID attribute for the component.
AdditionalAttributes Dictionary<string, object> Additional HTML attributes for the component's root element.
IgnorePermissionChecks bool false Bypasses all permission checks for this component.
IgnorePermissionSelection bool false Ignore permission selection mode for this component.
IgnoreFormBusy bool false Takes the component out of the submit lock of the DwsForm (or DwsFormBusyRegion) around it: IsFormBusy stays false for it.
Name Typ Description
OnInitializedCallbackStarted EventCallback Callback when OnInitialized starts.
OnInitializedCallback EventCallback Callback during OnInitialized.
OnInitializedCallbackCompleted EventCallback Callback when OnInitialized completes.
OnInitializedAsyncCallbackStarted EventCallback Callback when OnInitializedAsync starts.
OnInitializedAsyncCallback EventCallback Callback during OnInitializedAsync.
OnInitializedAsyncCallbackCompleted EventCallback Callback when OnInitializedAsync completes.
OnIsComponentLoadingChanged EventCallback<bool> Callback when IsComponentLoading changes.
OnCurrentRenderModeChanged EventCallback<DwsRenderMode> Callback when CurrentRenderMode changes.
OnComponentStateChanged EventCallback<DwsComponentStateType> Callback when ComponentState changes.

Interface-Description Split Button

Name Typ Default Description
IsOpen bool false Whether the menu is open.
Name Typ Parameters Description
OpenAsync Task Opens the menu below the caret. Does nothing while disabled or without interactivity.
CloseAsync Task Closes the menu.
Name Typ Default Description
ChildContent RenderFragment? null The primary button's label content.
Icon string string.Empty The primary button's icon.
StartIcon string string.Empty The primary button's start icon.
EndIcon string string.Empty The primary button's end icon.
Appearance DwsAppearance DwsAppearance.Filled The appearance shared by both the primary and caret buttons.
Color DwsColor DwsColor.Undefined The color shared by both the primary and caret buttons.
ButtonSize DwsSize DwsSize.Medium The size shared by both the primary and caret buttons.
Tooltip string string.Empty The primary button's tooltip.
TooltipPosition DwsTooltipPosition DwsTooltipPosition.Top Kept so existing markup still compiles: the tooltip is the browser's native title, which has no position.
CaretTooltip string string.Empty Overrides the caret button's tooltip; defaults to the localized "More actions" label.
Items IReadOnlyList<DwsSplitButtonItemData>? null The menu's entries: DwsSplitButtonItemData(Text, Icon, Disabled, OnClick), with the init properties Color (e.g. DwsColor.Error for a destructive entry) and SeparatorBefore (a divider above the entry). The menu is a DwsContextMenu opened below the caret: in the top layer (never clipped), flipped when there is no room below, arrow keys, Home / End and type-ahead move between entries, Escape, Tab and an outside press close it and focus returns to the caret.
Haptic DwsHapticFeedback DwsHapticFeedback.None Tactile feedback of a tap on the primary button while the app has haptics switched on.
Name Typ Description
OnClick EventCallback<MouseEventArgs> Fires when the primary button is clicked - independent from opening the menu.
OnOpen EventCallback Fires when the popup menu opens.
OnClose EventCallback Fires when the popup menu closes (an entry chosen, Escape, Tab, an outside press, scrolling or CloseAsync).
Name Typ Default Description
Element ElementReference The associated web component. May be null if accessed before the component is rendered.
ComponentGuid Guid Unique identifier for the component.
TypeString string The name of the component type, obtained from reflection.
Authorized_RegisterEnabled bool false Indicates whether this component is enabled through a permission registry.
Authorized_RegisterSelected bool false Indicates whether this component is selected in permission selection mode.
GetInitializedState bool false Returns whether the component is initialized.
GetRenderModeState DwsRenderMode Returns the current render mode.
GetComponentState DwsComponentStateType Returns the current component state.
GetIsInteractiveState bool false Returns whether the component is interactive.
GetIsPrerenderingState bool false Returns whether the component is prerendering.
GetComponentLoadingState bool false Returns whether the component is loading.
IsFormBusy bool false Whether the DwsForm (or DwsFormBusyRegion) around the component is locked because its submit handler is running. The state itself is the cascaded FormBusyState (IDwsFormBusyState).
Name Typ Parameters Description
DebugInfo void Logs debug information about the component.
UpdateState void Updates the component's state and triggers StateHasChanged.
UpdateStateAsync Task Asynchronously updates the component's state and triggers StateHasChanged.
Dispose void Disposes the component and releases resources.
FocusAsync ValueTask bool containedInScrollableList Sets focus to the component's element.
Name Typ Default Description
Name string Required unique identifier for the component within its container.
Visible bool true Determines if the component is visible in the UI.
Disabled bool false Disables the form control, ensuring it doesn't participate in form submission.
ComponentNameSpace string The namespace for permission-based access control.
PermissionKey string? null A stable key that takes the place of Name in the generated permission namespace (Page.PermissionKey): the stored permission survives a rename, and components that share a key share one permission entry. Null: keyed by Name. Read once, when the component registers; an explicit ComponentNameSpace wins.
Class string Optional CSS class names.
Style string Optional in-line styles.
Tag object An optional user-defined object to store any additional data with the component.
BackReference DwsReference A reference to the enclosing component.
ID string The HTML ID attribute for the component.
AdditionalAttributes Dictionary<string, object> Additional HTML attributes for the component's root element.
IgnorePermissionChecks bool false Bypasses all permission checks for this component.
IgnorePermissionSelection bool false Ignore permission selection mode for this component.
IgnoreFormBusy bool false Takes the component out of the submit lock of the DwsForm (or DwsFormBusyRegion) around it: IsFormBusy stays false for it.
Name Typ Description
OnInitializedCallbackStarted EventCallback Callback when OnInitialized starts.
OnInitializedCallback EventCallback Callback during OnInitialized.
OnInitializedCallbackCompleted EventCallback Callback when OnInitialized completes.
OnInitializedAsyncCallbackStarted EventCallback Callback when OnInitializedAsync starts.
OnInitializedAsyncCallback EventCallback Callback during OnInitializedAsync.
OnInitializedAsyncCallbackCompleted EventCallback Callback when OnInitializedAsync completes.
OnIsComponentLoadingChanged EventCallback<bool> Callback when IsComponentLoading changes.
OnCurrentRenderModeChanged EventCallback<DwsRenderMode> Callback when CurrentRenderMode changes.
OnComponentStateChanged EventCallback<DwsComponentStateType> Callback when ComponentState changes.
An error has occurred. This app may no longer respond until reloaded.