DwsAdornment
A text, icon or button attached to the start or end of an input group. DwsInput renders one through its Adornment* parameters; the examples below place it next to a plain input so each option stands on its own.
Tooltips
Tooltip shows on hover and on keyboard focus, on the side TooltipPosition picks. Screen readers get it as the description. A text or icon adornment with a tooltip becomes focusable, so Tab reaches it too; Escape hides the tooltip until the pointer or focus leaves.
Show Code
Adornment.razor
<div class="d-flex flex-wrap gap-4 py-4 px-5">
@foreach (DwsTooltipPosition position in Enum.GetValues<DwsTooltipPosition>())
{
<div class="input-group" style="width: 12rem;">
<input class="form-control" placeholder="@position.ToString()" />
<DwsAdornment Name="@($"AdornmentDemo_Tooltip_{position}")" AdornmentType="DwsAdornmentType.Icon" AdornmentText="@Icons.BS.InfoCircle"
Tooltip="@($"Tooltip position: {position}")" TooltipPosition="@position" />
</div>
}
</div>Icon size
IconSize scales the icon of the Icon and IconButton types along the theme's font sizes. IconSizePx sets an exact size and wins over IconSize. Without either the icon inherits the input group's font size.
Show Code
Adornment.razor
@foreach (DwsSize size in Enum.GetValues<DwsSize>())
{
<div class="input-group mb-2" style="max-width: 20rem;">
<input class="form-control" placeholder="@size.ToString()" />
<DwsAdornment Name="@($"AdornmentDemo_IconSize_{size}")" AdornmentType="DwsAdornmentType.Icon" AdornmentText="@Icons.BS.Star" IconSize="@size" />
</div>
}
<div class="input-group mb-2" style="max-width: 20rem;">
<input class="form-control" placeholder="IconSizePx = 28" />
<DwsAdornment Name="AdornmentDemo_IconSize_Px" AdornmentType="DwsAdornmentType.Icon" AdornmentText="@Icons.BS.Star" IconSizePx="28" />
</div>Interface-Description
| Name | Typ | Default | Description |
|---|---|---|---|
| AdornmentText | string | "" | The text, or for Icon and IconButton the icon's CSS class. The adornment renders nothing while this and ChildContent are both empty. |
| AdornmentType | DwsAdornmentType | DwsAdornmentType.Text | Text and Icon are decoration (the icon is a decorative DwsIcon in the adornment's colour). TextButton and IconButton render a native button: focusable, activated by Enter and Space, and raising OnAdornmentClick; at least 44px in both directions on a touch screen. |
| AdornmentPosLeft | bool | false | Rounds the corners for the start of an input group instead of the end. The badge moves to the left corner. |
| Tooltip | string | "" | Shown on hover and on keyboard focus, and read by screen readers as the description. Escape hides it until the pointer or focus leaves. A text or icon adornment with a tooltip becomes focusable. |
| TooltipPosition | DwsTooltipPosition | DwsTooltipPosition.Top | Side of the adornment the tooltip appears on. |
| IconSize | DwsSize? | null | Icon size of the Icon and IconButton types, along the theme's font sizes (XSmall to XLarge). Null inherits the input group's font size. |
| IconSizePx | int? | null | Icon size in px. Takes priority over IconSize. |
| Badge | string? | null | A counter or short status shown as a badge on the adornment's outer top corner. Null or empty hides it. On a button it is added to the accessible name. |
| BadgeColor | DwsColor | DwsColor.Error | Background color of the badge, from the theme. |
| BadgeTextColor | DwsColor | DwsColor.Undefined | Text color of the badge, from the theme. Undefined: the theme's text for status fills, readable on every status color. |
| ChildContent | RenderFragment? | null | Custom content that replaces AdornmentText, e.g. a live value. The adornment keeps its box, click and tooltip. |
| AriaLabel | string? | null | Accessible name. A button falls back to Tooltip (IconButton) or its text (TextButton), then to a localized "Field action". On an Icon it exposes the icon as an image. |
| ControlsId | string? | null | The id of the field a button adornment acts on. Rendered as aria-controls on TextButton / IconButton, so assistive technology knows which field the button belongs to; ignored by Text and Icon. DwsInput sets it for its own adornment. |
| Name | Typ | Description |
|---|---|---|
| OnAdornmentClick | EventCallback | Raised on click, Enter or Space. Only the button types raise it, and not while disabled or in permission select mode (a click then selects the adornment). |
| 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. |
