DwsDivider
A horizontal or vertical line between content, optionally with a label - the library's replacement for an hr element. Inside a DwsList use DwsListDivider and inside a DwsNavMenu DwsNavDivider: they follow their container.
API ReferenceHorizontal
The default: a full-width separator (role=separator) with 16px above and below. Spacing changes that space, Thickness the line, Variant its style.
Account settings
Notification settings
Show Code
Divider.razor
<DwsTypography Name="Above" Typography="DwsTypographyType.Paragraph" Class="mb-0">Account settings</DwsTypography>
<DwsDivider Name="DividerDefault" />
<DwsTypography Name="Below" Typography="DwsTypographyType.Paragraph" Class="mb-0">Notification settings</DwsTypography>
<DwsDivider Name="DividerDashed" Variant="DwsDividerVariant.Dashed" Thickness="2" Spacing="24" />
<DwsDivider Name="DividerDotted" Variant="DwsDividerVariant.Dotted" Color="DwsColor.Primary" Thickness="3" />With a label
Text puts a label in the line and names the separator for screen readers. TextPosition moves it to the start or end (they follow the text direction). A long label wraps instead of widening the page.
Show Code
Divider.razor
<DwsDivider Name="DividerCenter" Text="or" />
<DwsDivider Name="DividerStart" Text="Today" TextPosition="DwsDividerTextPosition.Start" />
<DwsDivider Name="DividerEnd" Text="Older messages" TextPosition="DwsDividerTextPosition.End" />
<DwsDivider Name="DividerLong" Text="A very long label that wraps on a phone instead of pushing the page wider than the screen" />Custom label content
ChildContent takes custom content, such as an icon and text. Still pass Text, so the separator keeps its accessible name.
Show Code
Divider.razor
<DwsDivider Name="DividerPremium" Text="Premium" Color="DwsColor.Warning">
<DwsIcon Name="PremiumIcon" Icon="@Icons.BS.StarFill" Color="DwsColor.Warning" Size="DwsSize.Small" /> Premium
</DwsDivider>Vertical
Orientation Vertical draws a line between the items of a row, as tall as the row (or 1em in running text). The row below wraps on narrow screens.
Home Settings Help
Show Code
Divider.razor
<div class="d-flex flex-wrap align-items-center gap-1">
<DwsButton Name="Bold" Appearance="DwsAppearance.Icon" Icon="@Icons.BS.TypeBold"
AdditionalAttributes="@(new Dictionary<string, object> { ["aria-label"] = "Bold" })" />
<DwsButton Name="Italic" Appearance="DwsAppearance.Icon" Icon="@Icons.BS.TypeItalic"
AdditionalAttributes="@(new Dictionary<string, object> { ["aria-label"] = "Italic" })" />
<DwsDivider Name="ToolbarDivider" Orientation="DwsLayoutOrientation.Vertical" Decorative="true" />
<DwsButton Name="AlignLeft" Appearance="DwsAppearance.Icon" Icon="@Icons.BS.TextLeft"
AdditionalAttributes="@(new Dictionary<string, object> { ["aria-label"] = "Align left" })" />
<DwsButton Name="AlignCenter" Appearance="DwsAppearance.Icon" Icon="@Icons.BS.TextCenter"
AdditionalAttributes="@(new Dictionary<string, object> { ["aria-label"] = "Center" })" />
</div>
<DwsTypography Name="InlineLinks" Typography="DwsTypographyType.Paragraph" Class="mt-3 mb-0">
Home <DwsDivider Name="Inline1" Orientation="DwsLayoutOrientation.Vertical" Decorative="true" />
Settings <DwsDivider Name="Inline2" Orientation="DwsLayoutOrientation.Vertical" Decorative="true" /> Help
</DwsTypography>Inset
Inset starts the line further in, to line up with text beside an icon column. Decorative hides this purely visual line from assistive technology.
Show Code
Divider.razor
<div class="d-flex align-items-center gap-3">
<DwsAvatar Name="Avatar1" Initials="AB" Size="DwsSize.Small" />
<span>Anna Berg</span>
</div>
<DwsDivider Name="InsetLine" Inset="56" Spacing="8" Decorative="true" />
<div class="d-flex align-items-center gap-3">
<DwsAvatar Name="Avatar2" Initials="CD" Size="DwsSize.Small" />
<span>Carl Dahl</span>
</div>Interface-Description
| Name | Typ | Default | Description |
|---|---|---|---|
| Orientation | DwsLayoutOrientation | DwsLayoutOrientation.Horizontal | Horizontal: a full-width line between blocks. Vertical: a line between the items of a row, as tall as the row (1em in running text). |
| Text | string? | null | A label in the line. Also the separator's accessible name (aria-label). |
| ChildContent | RenderFragment? | null | Custom label content (an icon and text). Wins over Text; still pass Text to name the separator. |
| TextPosition | DwsDividerTextPosition | DwsDividerTextPosition.Center | Center, Start or End. Start and End follow the text direction. |
| Variant | DwsDividerVariant | DwsDividerVariant.Solid | Solid, Dashed or Dotted line. |
| Color | DwsColor | DwsColor.Undefined | Line colour from the theme. Undefined: a neutral line (the text colour at 22%) that reads in every theme. |
| Thickness | int? | null (1px) | Line thickness in pixels. |
| Spacing | int? | null (16px horizontal, 8px vertical) | Space before and after the line in pixels. 0 is allowed. |
| Inset | int? | null | Indents a horizontal line from the start, in pixels. |
| Decorative | bool | false | Hides the line from assistive technology (no role=separator). For lines that only decorate. |
| 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. |
