Skip to content

Flexible dashboard

Flexible dashboards are an extension of static dashboards that allow users to customize the content according to their specific needs.

Usage

Flexible dashboards offers a personalized experience by enabling users to tailor the dashboards content itself.

Users can enter the edit mode to add, move and remove widgets, as well as restoring the dashboard to its default settings.

Flexible dashboard

When to use

  • Use it when there is a large amount of widgets that users can choose from.
  • Use it if the application is used by a diverse group of users with different needs and goals.
  • Use it if users may need to prioritize certain types of information over others based on their current tasks or goals.
  • Be mindful about its use. Providing too many customization options can overwhelm users and make the dashboard more difficult to use.

Design

Default mode

In default mode, the dashboard displays a pre-defined set of widgets, providing users with a view of the data and insights based on their chosen configuration.

Flexible dashboard default

  1. Title (optional), 2. Dashboard options (optional), 3. Content area 4. Edit mode button

The dashboard options area on top of the widgets can be used for actions such as filtering, which affect the whole dashboard.

Edit mode

In edit mode, users can customize the dashboard to fit their specific needs. The dashboard options area is replaced by editing options that allow users to add widgets and perform other actions.

Flexible dashboard edit

  1. Title (optional), 2. Editing options (optional), 3. Content area, 4. Save and cancel button

Add widget

  1. Select Add widget to open the widget library.
  2. Select the desired widget.
  3. Click Add. The library will be closed and the new widget will be added at the bottom of the page.

Flexible dashboard add

Resize

Users can use the resize handler at the bottom right corner and drag horizontally to change the width, vertically to change the height, or diagonally to change both dimensions. A light blue box appears to indicate the area a widget will snap to, once the user releases the resize handle.

Flexible dashboard resize

Move

Users can select a widget within the content area and drag it to the desired location. As with resizing, a light blue box appears to indicate where the widget will be positioned upon letting it go.

Flexible dashboard move

Code

The flexible dashboards are based on gridstack.js.

See README for details about including to your app.

Direct Link to dashboard demo.

SiFlexibleDashboardComponent API Documentation

Source
import { SiFlexibleDashboardComponent } from '@siemens/dashboards-ng';

The component implements a dashboard with adding, removing and resizing widgets. It consists and connects a toolbar, a grid with widgets, and a widget catalog.

Project si-inline-notification elements directly into this component to display dashboard-level notifications below the toolbar and above the widget grid in the dashboard view. Other element types are not accepted.

Input Properties

NameTypeDefaultDescription
config
Config | undefined inject(SI_DASHBOARD_CONFIGURATION)

Option to configure a dashboard instance. Default is the optional value from the SI_DASHBOARD_CONFIGURATION.

dashboardId
string | undefined

Optionally, but it is recommended to include an id for a dashboard. The id is utilized in the persistence calls on the SiWidgetStorage.

editable
boolean false

Input to change the dashboard editable state.

heading
string | undefined

Heading for the dashboard.

To show a custom header instead, e.g. with a description or page actions, project it using the header attribute. The heading is ignored in that case. While adding or editing widgets, the respective title is shown instead.

hideAddWidgetInstanceButton
boolean false

Option to remove the add widget instance button from the primary toolbar.

hideEditButton
boolean false

Option to hide the dashboard edit button.

hideProgressIndicator
boolean false

Option to turn off the loading spinner on save and load operations.

multiSelect
boolean false

Option to enable multi-select in the widget catalog. When enabled, the user can select multiple widgets to add to the dashboard at once.

primaryEditActions
DashboardToolbarItem[] []

Primary action menu items shown in the edit mode of the dashboard.

searchPlaceholder
TranslatableString $localize`:@@DASHBOARD.WIDGET_LIBRARY.SEARCH_PLACEHOLDER:Search…`

Placeholder text for the search input field in the widget catalog.

secondaryEditActions
DashboardToolbarItem[] []

Secondary action menu items shown in the edit mode of the dashboard.

showEditButtonLabel
boolean false

Option to display the edit button as a text button instead, only if the window is larger than xs SiResponsiveContainerDirective.

widgetCatalog
Widget[] []

Sets the available widgets for the widget catalog to the dashboard.

widgetCatalogComponent
Type<SiWidgetCatalogComponent> | undefined

Optionally, provide a custom subclass of the SiWidgetCatalogComponent to use your own catalog component.

widgetInstanceEditorDialogComponent
Type<SiWidgetInstanceEditorDialogComponent> | undefined

Optionally, provide a custom subclass of the SiWidgetInstanceEditorDialogComponent to use your own implementation.

Output Properties

NameTypeDescription
editableChange
boolean

Input to change the dashboard editable state.

isModified
boolean

Emits the modification state of the grid. It is unmodified when the visible state is equal to the loaded state from the widget storage. When the user modifies the dashboard by e.g. while moving the widgets, the dashboard is marked as modified and emits true and when the user persists the change by saving, or reverts the state by canceling, the state is unmodified again and emits false.

SiGridComponent API Documentation

Source
import { SiGridComponent } from '@siemens/dashboards-ng';

The grid component is the actual component on which the widget instances are placed and visualized. You can think of a headless dashboard, without a title, toolbar or edit buttons.

Input Properties

NameTypeDefaultDescription
dashboardId
string | undefined

An optional, but recommended dashboard id that is used in persistence and passed to the widget store for saving and loading data.

editable
boolean false

Sets the grid into editable mode, in which the widget instances can be moved, resized, removed or new ones added.

emitWidgetInstanceEditEvents
boolean false

When the user clicks edit on a widget instance, an editor need to appear and the widget editor component need to be loaded. When the grid is used standalone, it takes care and opens a modal dialog and loads the configured widget editor component. When the grid is used in a container like the flexible dashboard, the container manages where the widget instance editor is displayed. In this case this options prevents the grid from showing the editor in the dialog, and emits on widgetInstanceEdit on clicking the widget edit action.

gridConfig
GridConfig | undefined inject(SI_DASHBOARD_CONFIGURATION)?.grid

Configuration options for a grid instance. Default is the optional value from the SI_DASHBOARD_CONFIGURATION.

hideProgressIndicator
boolean false

Option to turn off the loading spinner on save and load operations.

widgetCatalog
Widget[] []

Provides the available widgets to the grid. When loading the widget configurations from the storage, we need to have the widget definition available to be able to create the widget instances on the grid.

widgetInstanceEditorDialogComponent
Type<SiWidgetInstanceEditorDialogComponent> | undefined

Option to configure a custom widget instance editor dialog component. The component provides the editor hosting and the buttons to save and cancel.

Output Properties

NameTypeDescription
editableChange
boolean

Sets the grid into editable mode, in which the widget instances can be moved, resized, removed or new ones added.

isModified
boolean

Emits the modification state of the grid. It is unmodified when the visible state is equal to the loaded state from the widget storage. When the user modifies the dashboard by e.g. while moving the widgets, the dashboard is marked as modified and emits true and when the user persists the change by saving, or reverts the state by canceling, the state is unmodified again and emits false.

widgetInstanceEdit
WidgetConfig

Emits to notify about edit events of widget instances. Only emits if emitWidgetInstanceEditEvents is set to true.

Attributes and Methods

NameTypeDefaultDescription
addWidgetInstance()
(widgetInstanceConfig: Omit<WidgetConfig, "id">) => void

Adds a new widget instance configuration to the dashboard grid. It is not persisted yet and is added to the transient widget instances.

Parameters
cancel()
() => void

Cancel current changes and restore last saved state.

edit()
() => void

Set dashboard grid in editable mode to modify widget instances.

editWidgetInstance()
(widgetInstanceConfig: WidgetConfig) => void

Opens the provided widget configuration in the related editor or emits on widgetInstanceEdit, if emitWidgetInstanceEditEvents is true.

Parameters
(readonly) gridStackWrapper
Signal<SiGridstackWrapperComponent> viewChild.required(SiGridstackWrapperComponent)
(readonly) isLoading
BehaviorSubject<boolean> new BehaviorSubject<boolean>(false)

Indication for load and save operations.

removeWidgetInstance()
(widgetInstanceId: string) => void

Removes a widget instance from the visible widgets and puts it in the markedForRemoval array.

Parameters
save()
() => void

Persists the current widget instances to the widget storage and changes the editable and isModified modes.

updateWidgetInstance()
(editedWidgetConfig: WidgetConfig) => void

Updates the visible widgets with an updated configuration. Will update the user interface and emit on isModified.

Parameters

Custom header

Like the dashboard, the flexible dashboard supports a custom header, e.g. with a description or page actions. Project it using the header attribute and follow the page header guidelines. The custom header replaces the heading in the dashboard view. While adding or editing widgets, the respective title is shown instead.

<si-flexible-dashboard [dashboardId]="dashboardId" [widgetCatalog]="widgetCatalog">
  <div class="si-layout-header" header>
    <h2 class="si-layout-title si-layout-top-element">Dashboard</h2>
    <p class="si-layout-subtitle">Description</p>
  </div>
</si-flexible-dashboard>

Dashboard notifications

Project si-inline-notification elements directly into <si-flexible-dashboard>. Other elements are not accepted by this slot. Notifications are displayed below the dashboard toolbar and above the widget grid. They stay pinned with the dashboard header while the widget grid scrolls, and the region collapses completely when no notification is projected.

Use this region for important, persistent states that affect the entire dashboard or multiple widgets, such as outdated data or failed widget loading. Keep messages concise and avoid using the region for routine or transient widget updates.

<si-flexible-dashboard [dashboardId]="dashboardId" [widgetCatalog]="widgetCatalog">
  <si-inline-notification
    severity="warning"
    heading="Some data is outdated"
    message="The dashboard could not refresh all widgets."
  />
</si-flexible-dashboard>

Persistence of dashboard configuration

Widget storage api to provide the persistence layer of the widgets of a dashboard (typically from a web service). The dashboard grid uses this API to load and save the widget configurations. Applications using siemens-dashboard needs to implement this abstract class and provide it in the module configuration.

Constructor
Properties
Methods
  • load (dashboardId?: string) => Observable<WidgetConfig[]>

    Returns an observable with the dashboard widget configuration. The dashboard subscribes to the observable and updates when a new value emits.

    Parameters
  • save (modifiedWidgets: WidgetConfig[], addedWidgets: WidgetConfig[], removedWidgets?: WidgetConfig[], dashboardId?: string) => Observable<WidgetConfig[]>

    Saves the given widget configuration. New widgets have id generated through the SiWidgetIdProvider.generateWidgetId implementation and if ids comes from backend then it is in the responsibility of the implementor to update the ids of the new widgets with the ids returned from backend upon save. In addition, the implementor needs to check if objects that have been available before are missing. These widgets have been removed by the user. As a result of this method, the observables returned by the load() method should emit the new widget config objects, before also returning them.

    Returns: An observable that emits the saved widget config objects with their ids.

    Parameters

SiWidgetCatalogComponent API Documentation

Source
import { SiWidgetCatalogComponent } from '@siemens/dashboards-ng';

Default widget catalog implementation to show all available widgets that can be added to a dashboard. It consists of a list view, that lists all available widgets and after selection, a host in which the widget specific editor is loaded. Applications can either stay with the default catalog or implement their own by extending this class.

Input Properties

NameTypeDefaultDescription
multiSelect
boolean false

Option to enable multi-select in the widget catalog. When enabled, the user can select multiple widgets to add to the dashboard at once.

searchPlaceholder
TranslatableString $localize`:@@DASHBOARD.WIDGET_LIBRARY.SEARCH_PLACEHOLDER:Search…`

Placeholder text for the search input field in the widget catalog.

Output Properties

NameTypeDescription
closed
Omit<WidgetConfig, "id">[] | undefined

Emits when the catalog is closed, either by canceling or by adding or saving widget configurations. On cancel undefined is emitted, otherwise an array of the related widget configurations is emitted. In single-select mode the array always contains exactly one entry.

Attributes and Methods

NameTypeDefaultDescription
widgetCatalogdeprecated
Widget[] []

Property to provide the available widgets to the catalog. The flexible dashboard creates the catalog by Angular's createComponent() method and sets the available widgets to this attribute.

Deprecated: This property will be removed in v52. Use the signal widgetList instead.

(readonly) widgetList
WritableSignal<Widget[]> []

Property to provide the available widgets to the catalog. The flexible dashboard creates the catalog by Angular's createComponent() method and sets the available widgets to this attribute.

SiWidgetInstanceEditorDialogComponent API Documentation

Source
import { SiWidgetInstanceEditorDialogComponent } from '@siemens/dashboards-ng';

The Dialog component is utilized when editing a widget instance within a dashboard. It dynamically loads and creates the associated widget editor and incorporates it into its content. The dialog component is accountable for interacting with the dashboard and offers options for saving changes or terminating the editing process.

Input Properties

NameTypeDescription
widgetrequired
Widget

Input for the widget definition. It is required to retrieve the component factory to instantiate the widget editor.

widgetConfigrequired
WidgetConfig

Input for the widget instance configuration. It is used to populate the widget editor.

Output Properties

NameTypeDescription
closed
WidgetConfig | undefined

Emits the edited widget instance configuration if the user confirms by saving, or undefined if the user cancels the dialog.

editorSetupCompleted
void

Emits when the editor instantiation is completed.

widgetConfigChangerequired
WidgetConfig

Input for the widget instance configuration. It is used to populate the widget editor.

Widget renderer

The SiWidgetRendererComponent is a presentational (dumb) component that renders a single widget instance from a WidgetConfig, without the surrounding dashboard or grid infrastructure. It takes the exact Widget definition to render and delegates the actual rendering to the widget host.

Use it to display an individual widget outside of a flexible dashboard, for example in kiosk mode or within a custom layout such as a carousel. The component is a self-contained widget cell that can be placed anywhere a single widget needs to be shown.

It requires two inputs: the widgetConfig describing the widget instance to render and the matching widget definition. The widget must match the config's widgetId.

<!-- Render a single widget instance -->
<si-widget-renderer [widgetConfig]="widgetConfig" [widget]="widget" />

SiWidgetRendererComponent API Documentation

Source
import { SiWidgetRendererComponent } from '@siemens/dashboards-ng';

A presentational (dumb) component that renders a single widget instance from a WidgetConfig using the provided Widget definition. It delegates the actual rendering to the SiWidgetHostComponent.

Intended Usage

This component renders an individual widget outside of a dashboard or grid, without requiring manual host wiring. It is a self-contained widget cell that can be placed anywhere a single widget needs to be shown, for example in kiosk mode or within a custom layout such as a carousel.

Example

<!-- Render a single widget instance -->
<si-widget-renderer [widgetConfig]="widgetConfig" [widget]="widget" />

Input Properties

NameTypeDescription
widgetrequired
Widget

The Widget definition used to render the given widgetConfig. It must match the config's widgetId.

widgetConfigrequired
WidgetConfig

The configuration of the widget instance to render.

Security considerations

Widgets can be loaded via Module Federation, Native Federation or as web components from a URL. The loaded code is executed in your application. Only register widget factories that point to trusted sources.

Types Documentation

Dashboard configuration object. Inject globally using the SI_DASHBOARD_CONFIGURATION or configure individual dashboard instances.

Configuration object for the si-grid component, including the options of gridstack.

Properties

Represents a translatable string. This can either be a translation key, e.g. ACTIONS.EDIT that will be automatically translated when displayed on the UI or a pre-translated string, e.g. Edit. Equivalent to a normal string in usage and functionality.

Widgets describe the entries within the widget catalog and holds all default configuration and factory functionality to instantiate a widget instance, represented as WidgetConfig objects.

Properties

A WidgetConfig holds the configuration of a widget instance component that is visible on a dashboard. It can be persisted and used to restore a dashboards state.

Properties
  • Optional type of the accent line.

    accentLine?: AccentLineType

  • actionBarViewType?: ViewType

  • Defines whether the widget instance component can be expanded and enlarged over the dashboard.

    expandable?: boolean

  • grid item header text.

    heading?: TranslatableString

  • Icon name or a single-entry map of camelCase icon name to SVG data URI.

    headingIcon?: string | Record<string, string>

  • Height of the grid item, where number represents how many rows it takes. (default?: 1)

    height?: number

  • A unique id of a widget instance

    id: string

  • Optional configuration for an image to be displayed on the widget instance.

    image?: WidgetImage

  • immutable?: boolean

  • isNotRemovable?: boolean

  • minimum height allowed during resize/creation (default?: undefined = un-constrained)

    minHeight?: number

  • minimum width allowed during resize/creation (default?: undefined = un-constrained)

    minWidth?: number

  • A widget specific payload object. Placeholder to pass in additional configuration.

    payload?: any

  • If true, the widget host renders a placeholder and waits for explicit configuration before instantiating the widget instance component.

    Indicates that initial setup by the user is still pending. The flag flips to false once the setup has been completed.

    setupPending?: boolean

  • Optionally, the version widget description that was used to create the widget config.

    version?: string

  • The id of the widget descriptor that was used to instantiate the WidgetConfig and the widget instance component.

    widgetId: string

  • Width of the grid item, where number represents how many columns it spans (default?: 1)

    width?: number

  • Grid item position on x axis of the grid (default?: 0)

    x?: number

  • Grid item position on y axis of the grid (default?: 0)

    y?: number

The MenuItem is used to configure clickable items in menus. They support a name, link, icons and sub-menu items.

Deprecated: This interface should no longer be used. Use a corresponding alternative based on your use case:

• for SiMenuFactoryComponent use @siemens/element-ng/menu#MenuItem

• for SiContentActionBarComponent use @siemens/element-ng/menu#MenuItem and ContentActionBarMainItem

• for SiNavbarVerticalComponent use NavbarVerticalItem

• for @siemens/dashboards-ng#SiFlexibleDashboardComponent use @siemens/dashboards-ng#DashboardToolbarItem

Properties
  • A function that will be invoked when clicking on the menu item. When passed as a string, use together with SiLinkActionService to receive events. This is meant for repetitive things in lists/tables/etc.

    action?: string | ((param?: any) => void | any) Inherited from Link

  • Defines the content of the optional badge. Should be a number or something like "100+". if undefined or empty string, no badge is displayed

    badge?: string | number

  • Defines the background color of the badge. Default is specific to Element flavour.

    badgeColor?: string

  • Show a dot badge without content?

    badgeDot?: boolean

  • Defines the badge style

    badgeStyle?: "" | "inline" | "dot"

  • Defines if custom content is chosen in account dropdown (otherwise accountItems are used)

    customContent?: boolean

  • A boolean that lets the link know whether it is disabled or not.

    disabled?: boolean Inherited from Link

  • Whether the menu items sub-menu should open upwards instead of downwards.

    dropUpwards?: boolean

  • If the menu item has children you can specify if they are visible or not.

    expanded?: boolean

  • Defines a href URI that the menu item will be linked to. Will be used to set the href attribute of the a element. Will only be used if link and function is not set.

    href?: string Inherited from Link

  • The web font icon class name (e.g. element-settings-outline).

    icon?: string

  • Defines if only the icon is shown in the default navigation bar.

    iconOnly?: boolean

  • An optional id to uniquely identify the menu item.

    id?: string

  • The value for an image src tag. Maybe a relative or absolute link to an jpg or gif image.

    image?: string

  • A boolean that lets the link know whether it is active or not. It is useful when action() is executed instead of link route.

    isActive?: boolean Inherited from Link

  • Whether the menu item should be displayed as a heading/title, will also disable links and actions.

    isHeading?: boolean

  • A navigation bar item can have a sub-menu, if these items are set. They define the sub-menu content.

    items?: MenuItem[]

  • The navigation extras provide additional routing options when using the router link.

    navigationExtras?: NavigationExtras Inherited from Link

  • For single/multi choice items: the kind of icon to show.

    selectionState?: "" | "check" | "radio"

  • The target attribute specifies where to open the linked document. If no target is specified, the link will open in the current tab.

    target?: string Inherited from Link

  • The title of the menu item. Can be either the title to be displayed or the translation key.

    title?: TranslatableString Inherited from Link

  • The optional tooltip of the link. Can be either the text to be displayed or the translation key.

    tooltip?: TranslatableString Inherited from Link

  • Type to distinguish between check and radio menu items. Needs to be set for correct interaction and used for a11y.

    type?: "check" | "radio"

Interface representing an action item in the dashboard toolbar.

Properties

Interface representing a router link item in the dashboard toolbar.

Interface representing a link item in the dashboard toolbar.

FederatedModule

CommonFactoryFields & LoadRemoteModuleOptions & { factoryType: 'module-federation' | 'native-federation'; [index: string]: any; }
type alias

Factory configuration for loading widget components from a federated module. Supports both Module Federation and Native Federation patterns for micro-frontend architectures. Use this when the widget component is hosted in a separate, independently deployed application.

WebComponent

CommonFactoryFields & { factoryType: 'web-component'; url: string; [index: string]: any; }
type alias
Index Signatures

FederatedBridgeModule

CommonFactoryFields & LoadRemoteBridgeOptions & { factoryType: 'native-federation-module-bridge'; [index: string]: any; }
type alias

Use this when having native federation shell and remote module is using module federation.

Index Signatures

ViewType

'collapsible' | 'expanded' | 'mobile'
type alias

Image is used to configure an image to be displayed on a widget instance.

Properties

AccentLineType

StatusType | 'caution' | 'primary' | 'inactive'
type alias

CommonFactoryFields

{ componentName: string; editorComponentName?: string; /** * CSS class that is added to the modal dialog when component editor dialog is shown. * Provides the option to change the size if the dialog. */ editorModalClass?: string; }
type alias
Properties

ModuleOptions

WidgetComponentTypeBaseConfig & { moduleName: string; moduleLoader: (name: string) => Promise<any>; componentLoader?: never; }
type alias

Use when component is not standalone and part of a module

StandaloneOptions

WidgetComponentTypeBaseConfig & { componentLoader: <T = unknown>(componentName: string) => Promise<Type<T>>; moduleName?: never; moduleLoader?: never; }
type alias

Use when component is standalone

Properties

The Remote Module definition is based on @angular-architects. We take it over into this file to prevent adding a hard dependency.

LoadRemoteBridgeOptions

{ id: string; options?: | { loadFactory?: boolean | undefined; from: 'build' | 'runtime'; } | undefined; }
type alias

Definition is based on @module-federation/enhanced loadRemote options. We take it over into this file to prevent adding a hard dependency.

ObjectFit

'contain' | 'cover' | 'fill' | 'none' | 'scale-down'
type alias

ObjectFit configuration options for a widget image.

See: https://developer.mozilla.org/en-US/docs/Web/CSS/object-fit

StatusType

'success' | 'info' | 'warning' | 'danger' | 'caution' | 'critical'
type alias

WidgetComponentTypeBaseConfig

{ factoryType?: 'default'; [index: string]: any; }
type alias
Properties
Index Signatures

LoadRemoteModuleScriptOptions

{ type?: 'script'; remoteEntry?: string; remoteName: string; exposedModule: string; /** * Optional nonce value applied to the script element for Content Security Policy (CSP) support. * Supported in Module Federation v21.2.0+; safely ignored by earlier versions. */ nonce?: string; }
type alias

LoadRemoteModuleEsmOptions

{ type: 'module'; remoteEntry: string; exposedModule: string; }
type alias

LoadRemoteModuleManifestOptions

{ type: 'manifest'; remoteName: string; exposedModule: string; }
type alias

Except where otherwise noted, content on this site is licensed under MIT License.