Porsche Design SystemSearchNavigate to GitHub repository of Porsche Design SystemOpen sidebar
Theme Table of Contents We provide a custom theme for the AG Grid library for cases where a more sophisticated table is required beyond the capabilities of our p-table component. This theme is aligned with the Porsche Design System's visual language and ensures consistency across your application. The Porsche Design System AG Grid theme is based on the default AG Grid theme, ag-theme-quartz, and is available in both light (default) and dark (data-ag-theme-mode="dark") modes. For more information on AG Grid's base themes, you can refer to the official AG Grid Themes documentation. Usage 1. Import the Theme First, import the Porsche Design System AG Grid theme into your application:
import { pdsTheme } from '@porsche-design-system/components-{js|angular|react|vue}/ag-grid';
2. Apply the Theme You can apply the theme using one of the following methods: Global Grid Options (Applies to all grid instances) Use global grid options to set the theme globally:
import { provideGlobalGridOptions } from 'ag-grid-community'; provideGlobalGridOptions({ theme: pdsTheme });
Individual Grid Options (Overrides global options): Set the theme for a specific grid instance:
const gridOptions = { theme: pdsTheme };
Component Prop Assignment Pass the theme directly as a prop:
<AgGridReact theme={pdsTheme} />
3. Change the Theme Mode By default, the Porsche Design System AG Grid theme uses a light color scheme. You can control the color scheme by setting the data-ag-theme-mode attribute on any parent element of the grid, such as the <html> or <body> tag. Available Modes: Light Mode (default) → data-ag-theme-mode is not set. Dark Mode → Set data-ag-theme-mode="dark".
<body data-ag-theme-mode="dark"></body>
Example This example is currently in development and will be added soon.
Global settingsThemeChanges the theme of the application and any Porsche Design System component. It's possible to choose between forced theme light and dark. It's also possible to use auto, which applies light or dark theme depending on the operating system settings automatically.LightDarkAuto (sync with operating system)DirectionChanges the direction of HTML elements, mostly used on<html> tag to support languages which are read from right to left like e.g. Arabic.LTR (left-to-right)RTL (right-to-left)AutoText ZoomChanges the text size and values with unit rem or em relatively. This setting can be defined in browser settings for any website or by an application itself on<html> tag. To achieve WCAG 2.2 AA compliance it's obligatory to support text zoom up to at least 200%.100%130%150%200%