Porsche Design SystemSearchNavigate to GitHub repository of Porsche Design SystemOpen sidebar
Getting StartedAdvanced
Vue Table of Contents Quick start To build your own Vue application with the Vue components of the Porsche Design System, follow these steps: Create a new application by executing:
# install with yarn: yarn create vite # install with npm: npm create vite
Follow the installation wizard to set everything up:
✔ Package name: my-app
✔ Select a framework: › Vue
✔ Select a variant: › TypeScript
Install the Porsche Design System within your project directory (e.g. "my-app"):
# install with yarn: cd my-app yarn add @porsche-design-system/components-vue # install with npm: cd my-app npm install @porsche-design-system/components-vue
You are ready to start building your own application. Integration After adding the @porsche-design-system/components-vue package to your project, you've to extend your standard vue setup by the PorscheDesignSystemProvider by adding it to your App.vue file The following setup is a standard Vue setup with the following adaptions: Extend App.vue by the necessary PorscheDesignSystemProvider:
// pages/App.vue <script setup lang="ts"> import AppComponent from './components/AppComponent.vue'; import { PorscheDesignSystemProvider } from '@porsche-design-system/components-vue'; </script> <template> <PorscheDesignSystemProvider> <AppComponent /> </PorscheDesignSystemProvider> </template>
Change your AppComponent to use at least one Porsche Design System component, for example:
// AppComponent.vue <script setup lang="ts"> import { ref } from 'vue'; import { PHeading } from '@porsche-design-system/components-vue'; </script> <template> <PHeading>Heading</PHeading> </template>
Run yarn vite or npm start and check if the components are displayed correctly. Plugin Currently, the plugin approach is in development. When are Porsche Design System components initialized? See componentsReady() for further information.
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%