DwsSpinner
A small indeterminate busy indicator: one CSS ring, no JS. It replaces the hand-made spinning icons in DwsButton, DwsList, DwsCalendar, DwsTreeview, DwsTreeTable, DwsFileBrowser, DwsFileViewer, DwsAudio, DwsCamera and DwsMicrophone. Under reduced motion it pulses instead of turning. For progress values use DwsProgressBar.
API ReferenceSizes
Small (the default) and XSmall follow the font size around them, so they fit text and buttons; Medium, Large and XLarge are fixed. Diameter sets pixels.
Show Code
Spinner.razor
<DwsSpinner Name='SpinnerDemo_XSmall' Size='DwsSize.XSmall' />
<DwsSpinner Name='SpinnerDemo_Small' />
<DwsSpinner Name='SpinnerDemo_Medium' Size='DwsSize.Medium' />
<DwsSpinner Name='SpinnerDemo_Large' Size='DwsSize.Large' />
<DwsSpinner Name='SpinnerDemo_XLarge' Size='DwsSize.XLarge' />
<DwsSpinner Name='SpinnerDemo_Diameter' Diameter='72' />Colours and visible labels
Undefined colour follows the text colour; Color takes a theme colour. It announces a localised 'Loading...' (role=status) unless Label says more; ShowLabel shows the label too.
Show Code
Spinner.razor
<DwsSpinner Name='SpinnerDemo_Primary' Color='DwsColor.Primary' Size='DwsSize.Medium' Label='Loading your orders' ShowLabel='true' />
<DwsSpinner Name='SpinnerDemo_Success' Color='DwsColor.Success' Label='Syncing' ShowLabel='true' />Decorative inline spinner
Inside text that already says what is happening, Decorative hides the spinner from assistive technology; it follows the font size and colour of the text.
Saving your draft
Show Code
Spinner.razor
<DwsTypography Name='SpinnerDemo_Inline' Typography='DwsTypographyType.Paragraph' Class='mb-0'>
Saving your draft <DwsSpinner Name='SpinnerDemo_InlineSpinner' Decorative='true' />
</DwsTypography>Interface-Description
| Name | Typ | Default | Description |
|---|---|---|---|
| Size | DwsSize | DwsSize.Small | XSmall 0.75em and Small 1em follow the font size around them; Medium 1.5rem, Large 2.5rem, XLarge 3.5rem. |
| Diameter | int? | null | A size in pixels that overrides Size. |
| Color | DwsColor | DwsColor.Undefined | Undefined follows the current text colour; otherwise a theme colour. |
| Label | string? | null (localised "Loading...") | The text announced by the role=status element. |
| ShowLabel | bool | false | Shows Label next to the ring instead of only announcing it. |
| Decorative | bool | false | Hidden from assistive technology (no role=status, no label), where the surrounding markup already announces the busy state. |
| 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. |
