diff --git a/examples/vue-3-cli/.storybook/preview-head.html b/examples/vue-3-cli/.storybook/preview-head.html
new file mode 100644
index 00000000000..940e3e42160
--- /dev/null
+++ b/examples/vue-3-cli/.storybook/preview-head.html
@@ -0,0 +1,14 @@
+
diff --git a/examples/vue-3-cli/.storybook/preview.ts b/examples/vue-3-cli/.storybook/preview.ts
index 6559602cd4d..effa418688b 100644
--- a/examples/vue-3-cli/.storybook/preview.ts
+++ b/examples/vue-3-cli/.storybook/preview.ts
@@ -9,6 +9,22 @@ export const parameters: Parameters = {
actions: { argTypesRegex: '^on[A-Z].*' },
};
+// A toolbar item to set a global theme
+export const globalTypes = {
+ theme: {
+ name: 'Theme',
+ description: 'Global theme for components',
+ defaultValue: 'light-theme',
+ toolbar: {
+ icon: 'paintbrush',
+ items: [
+ { value: 'light-theme', title: 'Light theme' },
+ { value: 'dark-theme', title: 'Dark theme' },
+ ],
+ },
+ },
+};
+
export const decorators: Decorators = [
() => ({
template: '
',
diff --git a/examples/vue-3-cli/src/stories/ThemeDecorator.stories.js b/examples/vue-3-cli/src/stories/ThemeDecorator.stories.js
new file mode 100644
index 00000000000..a4f90893992
--- /dev/null
+++ b/examples/vue-3-cli/src/stories/ThemeDecorator.stories.js
@@ -0,0 +1,36 @@
+// Just going to use the Button component for this example
+import MyButton from './Button.vue';
+
+const withTheme = (Story, context) => {
+ return {
+ data() {
+ return {
+ theme: context.globals.theme,
+ };
+ },
+ template: `
`,
+ };
+};
+
+export default {
+ title: 'Example/Theme Decorator',
+ component: MyButton,
+ argTypes: {
+ backgroundColor: { control: 'color' },
+ size: { control: { type: 'select', options: ['small', 'medium', 'large'] } },
+ onClick: {},
+ },
+ decorators: [withTheme],
+};
+
+const Template = (args, { argTypes }) => ({
+ props: Object.keys(argTypes),
+ components: { MyButton },
+ template: '',
+});
+
+export const ButtonWithTheme = Template.bind({});
+ButtonWithTheme.args = {
+ primary: true,
+ label: 'Button',
+};