Porsche Design SystemSearchNavigate to GitHub repository of Porsche Design SystemOpen sidebar
Meta Tags And Icon Links Table of Contents Function name: getMetaTagsAndIconLinks() Meta Icons are a set of icons to be used for the following purposes: Favicon, Apple Touch Icons, Android Touch Icons and Microsoft Windows Tiles. To simplify the implementation process we provide a getMetaTagsAndIconLinks partial. Therefore, we provide a ready to use partial in all @porsche-design-system/components-{js|angular|react|vue} packages which needs to be injected into the <head> of your index.html. This partial also provides some default Open Graph and Twitter meta tags which will display a thumbnail image when sharing a link on social media. If you want to define your own information you can set the ogImage option to false. Supported options OptionDescriptionTypeDefaultappTitleMandatory: Title of your app which will be reflected in the meta tag.stringundefinedcdnDecides from which CDN the resources are loaded.'auto' | 'cn''auto'formatDefines the output format of the partial. By default, it returns a html string, with jsx it returns valid jsx elements. When using the js option a javascript object is returned.'html' | 'jsx' | 'js''html'ogImageBoolean attribute to decide whether the Open Graph and Twitter meta tags should be included.booleantrue When using jsx in the format option, it is necessary to have react/jsx-runtime as a dependency in the project included. Examples Project integration differs based on the project setup. The following showcases the most common ways.
<!-- index.html -->
<head>
  <!--PLACEHOLDER_META_TAGS_AND_ICON_LINKS-->
</head>

<!-- package.json (tested on macOS, the script may need to be adjusted depending on the operating system used) -->
<!-- make sure to adjust the path to the index.html file -->
"scripts": {
  "prestart": "yarn replace",
  "replace": "placeholder='<!--PLACEHOLDER_META_TAGS_AND_ICON_LINKS-->' && partial=$placeholder$(node -e 'console.log(require(\"@porsche-design-system/components-js/partials\").getMetaTagsAndIconLinks({ appTitle: \"TITLE_OF_YOUR_APP\" }))') && regex=$placeholder'.*' && sed -i '' -E -e \"s^$regex^$partial^\" index.html"
  <!-- Alternative: Force using China CDN -->
  "replace": "placeholder='<!--PLACEHOLDER_META_TAGS_AND_ICON_LINKS-->' && partial=$placeholder$(node -e 'console.log(require(\"@porsche-design-system/components-js/partials\").getMetaTagsAndIconLinks({ appTitle: \"TITLE_OF_YOUR_APP\", cdn: \"cn\" }))') && regex=$placeholder'.*' && sed -i '' -E -e \"s^$regex^$partial^\" index.html"
}
OutputThe result of this partial looks like this:
<meta property=og:title content="TITLE_OF_YOUR_APP">
<meta property=og:image content=https://cdn.ui.porsche.com/porsche-design-system/meta-icons/og-image.c880d39.png>
<meta name=twitter:title content="TITLE_OF_YOUR_APP">
<meta name=twitter:card content=summary_large_image>
<meta name=twitter:image content=https://cdn.ui.porsche.com/porsche-design-system/meta-icons/og-image.c880d39.png>
<meta name=theme-color content=#FFF media=(prefers-color-scheme:light)>
<meta name=theme-color content=#0E1418 media=(prefers-color-scheme:dark)>
<meta name=mobile-web-app-capable content=yes>
<meta name=apple-mobile-web-app-status-bar-style content=default>
<meta name=apple-mobile-web-app-title content="TITLE_OF_YOUR_APP">
<meta name=msapplication-TileImage content=https://cdn.ui.porsche.com/porsche-design-system/meta-icons/mstile-270x270.f58081f.png>
<meta name=msapplication-TileColor content=#FFF>
<link rel=icon sizes=any href=https://cdn.ui.porsche.com/porsche-design-system/meta-icons/favicon.ed9a926.ico>
<link rel=icon type=image/png sizes=32x32 href=https://cdn.ui.porsche.com/porsche-design-system/meta-icons/favicon-32x32.d42ac28.png>
<link rel=apple-touch-icon href=https://cdn.ui.porsche.com/porsche-design-system/meta-icons/apple-touch-icon-180x180.bdf11cc.png>
<link rel=manifest href=https://cdn.ui.porsche.com/porsche-design-system/meta-icons/manifest.b904b15.webmanifest>

// Alternative: Force using China CDN
<meta property=og:title content="TITLE_OF_YOUR_APP">
<meta property=og:image content=https://cdn.ui.porsche.cn/porsche-design-system/meta-icons/og-image.c880d39.png>
<meta name=twitter:title content="TITLE_OF_YOUR_APP">
<meta name=twitter:card content=summary_large_image>
<meta name=twitter:image content=https://cdn.ui.porsche.cn/porsche-design-system/meta-icons/og-image.c880d39.png>
<meta name=theme-color content=#FFF media=(prefers-color-scheme:light)>
<meta name=theme-color content=#0E1418 media=(prefers-color-scheme:dark)>
<meta name=mobile-web-app-capable content=yes>
<meta name=apple-mobile-web-app-status-bar-style content=default>
<meta name=apple-mobile-web-app-title content="TITLE_OF_YOUR_APP">
<meta name=msapplication-TileImage content=https://cdn.ui.porsche.cn/porsche-design-system/meta-icons/mstile-270x270.f58081f.png>
<meta name=msapplication-TileColor content=#FFF>
<link rel=icon sizes=any href=https://cdn.ui.porsche.cn/porsche-design-system/meta-icons/favicon.ed9a926.ico>
<link rel=icon type=image/png sizes=32x32 href=https://cdn.ui.porsche.cn/porsche-design-system/meta-icons/favicon-32x32.d42ac28.png>
<link rel=apple-touch-icon href=https://cdn.ui.porsche.cn/porsche-design-system/meta-icons/apple-touch-icon-180x180.bdf11cc.png>
<link rel=manifest href=https://cdn.ui.porsche.cn/porsche-design-system/meta-icons/manifest.cn.7d59be6.webmanifest>
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)DirectionThe dir global attribute in HTML changes the direction of text and other content within an element. It's most often used on the <html> tag to set the entire page's direction, which is crucial for supporting languages that are written from right to left (RTL), such as Arabic and Hebrew. For example, using <html dir="rtl"> makes the entire page display from right to left, adjusting the layout and text flow accordingly.LTR (left-to-right)RTL (right-to-left)Text ZoomTo ensure accessibility and comply with WCAG 2.2 AA standards, it is mandatory for web content to support text resizing up to at least 200% without loss of content or functionality. Using relative units like rem is a best practice for achieving this, as they allow the text to scale uniformly based on the user's browser settings.100%130%150%200%