@synergy-design-system/vue

Vue3 wrappers for the Synergy Design System
22,885 45
Install
npm install @synergy-design-system/vue
Latest Version:3.29.0
Vue:3
License:MIT
Last Updated:Oct 20, 2026
Links: GitHub  ·  npm
Maintainer: schilchsickag

@synergy-design-system/vue

This package provides vue.js wrappers for Synergy Web Components.

It aims to provide an improved developer experience in Vue applications:

  • Provides two way data binding and v-model
  • Autocompletion and Types
  • Better custom event handling of synergy events

Known issues and limitations

Got any problems using our Vue wrappers? Please take a look at our list of known issues and limitations before creating a ticket.

Getting started

1. Usage example

If you want to see a usage example, please check out our test Vue repository.

2. Package installation

Run the following steps to install the required packages.

# Install wrapper components and required css files
npm install --save @synergy-design-system/vue @synergy-design-system/tokens

# Native components + type-only wrappers:
# @synergy-design-system/vue only provides TypeScript support here,
# therefore installing it as a devDependency is sufficient.
npm install --save-dev @synergy-design-system/vue
npm install --save @synergy-design-system/components

# Optional: Install the styles utility package
npm install --save @synergy-design-system/styles

# Optional: if icons shall be used, install the assets package
npm install --save @synergy-design-system/assets

⚠️ Note we do not ship Vue in this package. You will have to install it by yourself first!

3. Load the desired theme (required) and utility classes (recommended)

The components will not display correctly without the needed theme and utility classes. Please include either light or dark theme in your application, for example in a newly installed Vue application:

// src/main.ts
// Add this line to enable the light theme for your application
import "@synergy-design-system/tokens/themes/light.css";
import "@synergy-design-system/components/index.css";

// Optional: Import the styles package
import "@synergy-design-system/styles/index.css";

import { createApp } from "vue";
import App from "./App.vue";

createApp(App).mount("#app");

4. Using native Synergy components in Vue (type-only wrappers)

Vue has first-class support for custom elements, so you can use native syn-* elements directly. For TypeScript template support and autocompletion, this package also provides type-only wrappers.

When using this native + type-only approach, @synergy-design-system/vue is only needed for TypeScript declarations and can be installed as a devDependency.

For TypeScript projects, make sure the module augmentation is loaded once in your project. You can do this in an env.d.ts file (recommended in Vue/Vite projects):

/// <reference types="vite/client" />

import "@synergy-design-system/vue";

Then import the required Synergy custom elements and use them natively:

<script setup lang="ts">
  import "@synergy-design-system/components/components/button/button.js";
  import "@synergy-design-system/components/components/input/input.js";

  const onChange = (e: Event) => {
    console.log(e);
  };
</script>

<template>
  <syn-button type="submit">Submit me</syn-button>
  <syn-input name="my-input" required @syn-change="onChange" />
</template>

This enables automatic type checks and autocompletion for Synergy intrinsic elements in Vue templates.

4.1. Migrating from Vue wrappers to native components
  1. Upgrade @synergy-design-system/vue to the latest version.
  2. Ensure your TypeScript setup loads @synergy-design-system/vue once (for example via env.d.ts).
  3. Replace wrapper components with native counterparts (for example <SynVueButton> -> <syn-button>).
  4. Keep custom event names in native form (for example @syn-change).
  5. For two-way data binding on form controls, add SynModelPlugin and configure synIsCustomElement in vite.config.ts (see section 10.1).
  6. Run vue-tsc and your tests to verify behavior.

5. Importing and rendering components

You may now use the components by importing them from the @synergy-design-system/vue package and rendering them in your own Vue components.

<script setup lang="ts">
  // Note the name includes Vue here.
  // This is done because it would
  // clash with our native components otherwise
  import { SynVueButton } from "@synergy-design-system/vue";
</script>

<template>
  <SynVueButton type="submit"> Submit me </SynVueButton>
</template>

6. Usage of the components

All information about which components exist as well as the available properties, events and usage of a component, can be found at components in our documentation. The documentation is written for no specific web framework but only vanilla html and javascript.

An example demo repository with the usage of the Vue wrapper components can be found here.

The naming of the components for Vue changes from kebab-case to PascalCase with an appended Vue after the syn. syn-button becomes SynVueButton:

<!-- Webcomponents example -->
<syn-button> My Button </syn-button>
<!-- Vue wrapper example -->
<SynVueButton> My Button </SynVueButton>

7. Usage of attributes

The attribute naming of the components are the same as in the documentation.

<!-- Webcomponents example -->
<syn-input
  label="Nickname"
  help-text="What would you like people to call you?"
  required
></syn-input>
<!-- Vue wrapper example -->
<SynVueInput
  label="Nickname"
  help-text="What would you like people to call you?"
  required
/>

8. Usage of events

Custom events are named in the documentation as following: syn-change, syn-clear, ... They stay the same for the Vue components:

<SynVueButton
  @syn-blur="handleBlur"
  @syn-focus="handleFocus"
  @syn-invalid="handleInvalid"
>
  My Button
</SynVueButton>

If typescript is used, you can get the correct types for components and events from the @synergy-design-system/components package.

An example for how these types can be used in case of event handling, is shown below:

<script setup lang="ts">
  import { SynVueInput } from "@synergy-design-system/vue";
  import type {
    SynChangeEvent,
    SynInput,
  } from "@synergy-design-system/components";

  const synChange = (e: SynChangeEvent) => {
    const input = e.target as SynInput;
    // Now we get access to all properties, methods etc. of the syn-input
    const surname = input.value;
    doSomething(surname);
  };
</script>

<template>
  <SynVueInput label="Surname" @syn-change="synChange" />
</template>

9. Obtaining a reference to the underlying native element (e.g. for usage of methods)

Sometimes, there is a need to interact directly with the underlying native web-component. For this reason, the library exposes a nativeElement property for all vue components.

<script setup lang="ts">
  import { SynVueInput, SynVueButton } from "@synergy-design-system/vue";
  import { ref } from "vue";

  const count = ref<InstanceType<typeof SynVueInput> | null>(null);

  const handleClick = () => {
    // Increment the count via calling the method
    count.value?.nativeElement?.stepUp();
  };
</script>

<template>
  <SynVueInput ref="count" label="My count" type="number" value="5" />
  <SynVueButton @click="handleClick"> Increment </SynVueButton>
</template>

10. Using two way databinding

We support Vue two way data binding for form components out of the box. You may use it in one of the following ways:

<script setup lang="ts">
  import { ref } from "vue";
  import {
    SynVueButton,
    SynVueCheckbox,
    SynVueTextarea,
    SynVueInput,
  } from "@synergy-design-system/vue";

  const formValues = ref({
    checkboxValue: false,
    inputValue: "",
    textAreaValue: "",
  });

  const submit = (e: Event) => {
    e.preventDefault();
    e.stopPropagation();
    const target = e.target as HTMLFormElement;

    const isValid = target.reportValidity();
    if (isValid) {
      const data = [...new FormData(target)]
        .map(v => {
          return `${v[0]}: ${v[1]}`;
        })
        .join(",\n")
        .trim();
      // Do something with the data
      console.log(data);
    }
  };
</script>

<template>
  <form @submit="submit">
    <SynVueInput
      label="Input Example"
      name="inputValue"
      required
      v-model="formValues.inputValue"
    />
    <SynVueTextarea v-model="formValues.textAreaValue" name="textAreaValue" />
    <SynVueCheckbox
      v-model="formValues.checkboxValue"
      required
      name="checkboxValue"
      >Agree</SynVueCheckbox
    >
    >
  </form>
</template>
10.1. Two way binding for native syn-* elements via plugin

When using native syn-* elements instead of SynVue* wrappers, you can enable standard v-model support via SynModelPlugin. The plugin registers transparent Vue components for supported Synergy form controls so v-model works with no extra syntax.

Step 1: Configure the Vue template compiler in vite.config.ts

Import synIsCustomElement to tell the compiler which syn-* elements the plugin handles (resolved as Vue components) and which remain native pass-throughs (suppressing warnings):

// vite.config.ts
import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import { synIsCustomElement } from "@synergy-design-system/vue";

export default defineConfig({
  plugins: [
    vue({
      template: {
        compilerOptions: {
          isCustomElement: synIsCustomElement(false),
        },
      },
    }),
  ],
});

If you are not using SynModelPlugin (type-only usage, no v-model), omit the argument or pass true: isCustomElement: synIsCustomElement() — this suppresses warnings for all syn-* elements.

Step 2: Register the plugin in your app entry

// src/main.ts
import { createApp } from "vue";
import { SynModelPlugin } from "@synergy-design-system/vue";
import App from "./App.vue";

createApp(App).use(SynModelPlugin).mount("#app");

Step 3: Use v-model directly on native elements

All supported Synergy form controls now accept standard v-model bindings — exactly as you would with SynVue* wrappers:

<script setup lang="ts">
  import { ref } from "vue";

  const name = ref("");
  const formValues = ref({
    email: "",
    agreed: false,
    rating: 5,
  });
</script>

<template>
  <syn-input v-model="name" label="Name" required />
  <syn-input v-model="formValues.email" label="E-Mail" type="email" />
  <syn-checkbox v-model="formValues.agreed">Agree to terms</syn-checkbox>
  <syn-range v-model="formValues.rating" :min="0" :max="10" />
</template>

The following elements support v-model via the plugin:

Element Bound property
syn-input value
syn-textarea value
syn-select value
syn-combobox value
syn-radio-group value
syn-range value
syn-checkbox checked
syn-switch checked
syn-file files

11. Using the chart component

For details on chart components, see the chart overview and the Vue-specific chart documentation.


Development

To create a new version of this package, proceed in the following way:

  1. Check out the Synergy Design System Repository.
  2. Run pnpm i -r to install all dependencies.
  3. Build the @synergy-design-system/components package (or run pnpm build in the project root to build everything).
  4. Move to to packages/_private/vue-demo and use pnpm start to spin up a local vite project using Vue and typescript to validate the build.

⚠️ The build process will always try to sync this packages package.json.version field with the latest version from @synergy-design-system/components! Therefore, it is best to not alter the version string

Related Packages

@opencloud-eu/design-system

OpenCloud Design System is used to design OpenCloud UI components

33,591 292
@geoblink/design-system

Geoblink Design System for Vue.js

26,645 28
@ownclouders/design-system

ownCloud Design System is based on VueDesign Systems and is used to design ownCl...

15,467 2,163
iztech-design-system-neo

Design System of project IZtech

12,821 2,195
@aap/periodic

A design system for AAP's Vue components

9,886 1

Version History

Version Released License
3.29.0 MIT
3.28.0 MIT
3.27.0 MIT
3.26.1 MIT
3.26.0 MIT
Pre-releases (11)
Version Released License
2.31.0-numeric.5 MIT
2.31.0-numeric.4 MIT
2.31.0-numeric.3 MIT
2.31.0-numeric.2 MIT
2.31.0-numeric.1 MIT