DwsPanel
A bordered container with an optional header (title, icon, collapse toggle), body and footer. With IsTabbed its DwsPanelTab children become a DwsTabGroup: arrow keys and Home/End move between the tabs, and a strip that does not fit scrolls (and swipes on a phone).
API ReferenceBasic
A panel groups content in a bordered container. Title and Icon fill the header; without them (and without IsCollapsible) the header is left out.
Signed in as demo@example.com.
A panel without a header.
Show Code
Panel.razor
<DwsPanel Name='PanelDemo_Basic_Titled' Title='Account' Icon='@Icons.BS.PersonCircle'>
<DwsTypography Name='PanelDemo_Basic_Titled_Text' Typography='DwsTypographyType.Paragraph' Class='mb-0'>Signed in as demo@example.com.</DwsTypography>
</DwsPanel>
<DwsPanel Name='PanelDemo_Basic_Plain'>
<DwsTypography Name='PanelDemo_Basic_Plain_Text' Typography='DwsTypographyType.Paragraph' Class='mb-0'>A panel without a header.</DwsTypography>
</DwsPanel>Header and footer
HeaderContent replaces the Title with custom markup; FooterContent adds a footer below the body.
You have three unread notifications.
Show Code
Panel.razor
<DwsPanel Name='PanelDemo_HeaderFooter' Icon='@Icons.BS.Bell'>
<HeaderContent>
<span>Notifications</span>
<DwsBadge Name='PanelDemo_HeaderFooter_Badge' Content='3' Color='DwsColor.Error' Class='ms-2' />
</HeaderContent>
<ChildContent>
<DwsTypography Name='PanelDemo_HeaderFooter_Text' Typography='DwsTypographyType.Paragraph' Class='mb-0'>You have three unread notifications.</DwsTypography>
</ChildContent>
<FooterContent>
<div class='d-flex justify-content-end flex-wrap gap-2'>
<DwsButton Name='PanelDemo_HeaderFooter_Dismiss' Appearance='DwsAppearance.Outline' ButtonSize='DwsSize.Small'>Dismiss all</DwsButton>
<DwsButton Name='PanelDemo_HeaderFooter_Open' ButtonSize='DwsSize.Small'>Open inbox</DwsButton>
</div>
</FooterContent>
</DwsPanel>Tabbed
IsTabbed shows the DwsPanelTab children as a DwsTabGroup. A tab can be Disabled, or hidden with Visible='false' or by a permission; the panel then falls back to the first tab it can show. Arrow keys move between the tabs; on a narrow screen the strip scrolls sideways.
Show Code
Panel.razor
<DwsPanel Name='PanelDemo_Tabbed' Title='Project' Icon='@Icons.BS.Folder' IsTabbed='true' IsCollapsible='true'>
<DwsPanelTab Name='PanelDemo_Tabbed_Overview' Title='Overview'>
<DwsTypography Name='PanelDemo_Tabbed_Overview_Text' Typography='DwsTypographyType.Paragraph' Class='mb-0'>This is the content of the Overview tab.</DwsTypography>
</DwsPanelTab>
<DwsPanelTab Name='PanelDemo_Tabbed_Files' Title='Files' HeaderOptions='@(new() { StartIcon = Icons.BS.Files, Badge = "4" })'>
<DwsTypography Name='PanelDemo_Tabbed_Files_Text' Typography='DwsTypographyType.Paragraph' Class='mb-0'>A panel tab is a DwsTab: it takes the same header options (icon, badge, tooltip).</DwsTypography>
</DwsPanelTab>
<DwsPanelTab Name='PanelDemo_Tabbed_Archive' Title='Archive' Disabled='true'>
<DwsTypography Name='PanelDemo_Tabbed_Archive_Text' Typography='DwsTypographyType.Paragraph' Class='mb-0'>This tab is disabled.</DwsTypography>
</DwsPanelTab>
<DwsPanelTab Name='PanelDemo_Tabbed_Admin' Title='Admin' Visible='_showAdminTab'>
<DwsTypography Name='PanelDemo_Tabbed_Admin_Text' Typography='DwsTypographyType.Paragraph' Class='mb-0'>This tab is only shown while the toggle below is on.</DwsTypography>
</DwsPanelTab>
</DwsPanel>
<DwsButton Name='PanelDemo_Tabbed_ToggleAdmin' Appearance='DwsAppearance.Outline' ButtonSize='DwsSize.Small' OnClick='ToggleAdminTab'>
@(_showAdminTab ? "Hide Admin tab" : "Show Admin tab")
</DwsButton>Panel.razor.cs
private bool _showAdminTab;
private void ToggleAdminTab() => _showAdminTab = !_showAdminTab;Colours
Color, BackgroundColor and BorderColor resolve through the theme's CSS variables.
Show Code
Panel.razor
<DwsPanel Name='PanelDemo_Styling_Colors' Title='Colored' Icon='@Icons.BS.InfoCircle' Color='DwsColor.Success' BorderColor='DwsColor.Success' IsTabbed='true'>
<DwsPanelTab Name='PanelDemo_Styling_Colors_First' Title='First'>
<DwsTypography Name='PanelDemo_Styling_Colors_First_Text' Typography='DwsTypographyType.Paragraph' Class='mb-0'>The accent color marks the icon and the active tab.</DwsTypography>
</DwsPanelTab>
<DwsPanelTab Name='PanelDemo_Styling_Colors_Second' Title='Second'>
<DwsTypography Name='PanelDemo_Styling_Colors_Second_Text' Typography='DwsTypographyType.Paragraph' Class='mb-0'>Second tab.</DwsTypography>
</DwsPanelTab>
</DwsPanel>Styling the parts
HeaderClass/HeaderStyle, BodyClass/BodyStyle and FooterClass/FooterStyle style the parts; Class and Style apply to the container.
Header, body and footer styled separately.
Show Code
Panel.razor
<DwsPanel Name='PanelDemo_Styling_Parts'
Title='Custom parts'
HeaderClass='fst-italic'
HeaderStyle='background-color: var(--primary); color: var(--primary-text);'
BodyStyle='min-height: 80px;'
FooterClass='text-end small'
Style='max-width: 420px;'>
<ChildContent>
<DwsTypography Name='PanelDemo_Styling_Parts_Text' Typography='DwsTypographyType.Paragraph' Class='mb-0'>Header, body and footer styled separately.</DwsTypography>
</ChildContent>
<FooterContent>Footer</FooterContent>
</DwsPanel>Disabled
A disabled panel - by parameter or by page permission - is dimmed, and its toggle and tabs no longer respond.
Show Code
Panel.razor
<DwsPanel Name='PanelDemo_Disabled' Title='Locked' IsCollapsible='true' IsTabbed='true' Disabled='true'>
<DwsPanelTab Name='PanelDemo_Disabled_First' Title='First'>
<DwsTypography Name='PanelDemo_Disabled_First_Text' Typography='DwsTypographyType.Paragraph' Class='mb-0'>Content of the first tab.</DwsTypography>
</DwsPanelTab>
<DwsPanelTab Name='PanelDemo_Disabled_Second' Title='Second'>
<DwsTypography Name='PanelDemo_Disabled_Second_Text' Typography='DwsTypographyType.Paragraph' Class='mb-0'>Content of the second tab.</DwsTypography>
</DwsPanelTab>
</DwsPanel>Interface-Description
| Name | Typ | Default | Description |
|---|---|---|---|
| Collapsed | bool | false | Whether the body is currently collapsed. |
| ActiveTab | DwsPanelTab? | null | The tab whose content is shown, or null when the panel has no visible tabs (or is not tabbed). |
| TabGroup | DwsTabGroup? | null | The DwsTabGroup of a tabbed panel (null otherwise), for its API: ActivateNextTabAsync, ScrollToActiveTabAsync ... |
| Name | Typ | Parameters | Description |
|---|---|---|---|
| ExpandAsync | Task | Expands the panel. Does nothing unless IsCollapsible is set. | |
| CollapseAsync | Task | Collapses the panel. Does nothing unless IsCollapsible is set. | |
| ToggleAsync | Task | Expands a collapsed panel and collapses an expanded one. Does nothing unless IsCollapsible is set. | |
| SelectTabAsync | Task<bool> | DwsPanelTab tab | Shows the given tab and returns whether it is now active. Does nothing for a tab that is not part of this panel, hidden or disabled, or while the panel is disabled. |
| Name | Typ | Default | Description |
|---|---|---|---|
| Title | string? | null | Header text. Ignored when HeaderContent is set. |
| Icon | string? | null | Icon at the start of the header, e.g. Icons.BS.InfoCircle. Drawn in Color. |
| HeaderContent | RenderFragment? | null | Custom header content, rendered instead of Title. The collapse toggle stays on the right. |
| ChildContent | RenderFragment? | null | Panel body. In tabbed mode, the DwsPanelTab children. |
| FooterContent | RenderFragment? | null | Footer below the body. Hidden together with the body while collapsed. |
| IsCollapsible | bool | false | Shows a toggle button in the header that collapses and expands the body and footer. The header is always shown when set. |
| IsCollapsed | bool | false | Whether the body is collapsed. Supports @bind-IsCollapsed. Only applies when IsCollapsible is set. Collapsed content stays rendered, so child components keep their state. |
| ExpandIcon | string | Icons.BS.ChevronDown | Toggle icon shown while collapsed. |
| CollapseIcon | string | Icons.BS.ChevronUp | Toggle icon shown while expanded. |
| IsTabbed | bool | false | Shows the DwsPanelTab children as a DwsTabGroup (in the panel's accent colour, without add, close, reorder or context menu): arrow keys and Home/End move between the tabs, and a strip that does not fit scrolls sideways (swipe on a phone). A Disabled tab carries aria-disabled, is skipped by the arrow keys and cannot be activated. |
| Haptic | DwsHapticFeedback | DwsHapticFeedback.Selection | The haptic a tap on a tab plays on phones while the app has haptics on (IDwsHapticService). None switches it off. |
| TabContentMode | DwsTabContentMode | DwsTabContentMode.ActiveOnly | When a tab's content is rendered: ActiveOnly (only the active tab, fresh every time), Lazy (on first activation, then kept hidden with its state) or Eager (all tabs up front, kept). |
| Color | DwsColor | DwsColor.Primary | Accent color of the header icon and the active tab, resolved through the theme's CSS variables. |
| BackgroundColor | DwsColor | DwsColor.Undefined | Panel background. Undefined keeps the theme's surface color. |
| BorderColor | DwsColor | DwsColor.Undefined | Border and divider color. Undefined keeps a faint line derived from the text color. |
| HeaderClass | string? | null | CSS classes for the header. |
| HeaderStyle | string? | null | Inline styles for the header. |
| BodyClass | string? | null | CSS classes for the body. |
| BodyStyle | string? | null | Inline styles for the body. |
| FooterClass | string? | null | CSS classes for the footer. |
| FooterStyle | string? | null | Inline styles for the footer. |
| Name | Typ | Description |
|---|---|---|
| IsCollapsedChanged | EventCallback<bool> | Raised when the collapsed state changes; used by @bind-IsCollapsed. |
| OnExpand | EventCallback | Raised after the panel expands. |
| OnCollapse | EventCallback | Raised after the panel collapses. |
| OnToggle | EventCallback<bool> | Raised on every expand or collapse, with the new collapsed state (true = collapsed). |
| OnActiveTabChanged | EventCallback<DwsPanelTab> | Raised when the user or SelectTabAsync switches to another tab. |
| 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
| Name | Typ | Default | Description |
|---|---|---|---|
| ParentPanel | DwsPanel? | null | The panel the tab belongs to. |
| Name | Typ | Default | Description |
|---|---|---|---|
| Title | string | "" | Text of the tab header. |
| ChildContent | RenderFragment? | null | Content shown while the tab is active. |
| HeaderOptions / PanelOptions / ... | - | null | A DwsPanelTab is a DwsTab of the panel's DwsTabGroup, so every DwsTab parameter applies: HeaderOptions (icons, badge, tooltip), PanelOptions (heights), ValidationOptions, OnShowTab ... See the DwsTab API reference on the Tab page. |
| 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 | CSS classes for the tab's panel (role=tabpanel). The tab group draws the tab header. | |
| 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. |
