shopware/frontends - cms-base
Nuxt module that provides an implementation of all CMS components in Shopware based on utility-classes using unocss/Tailwind.css syntax.
It is useful for projects that want to use the CMS components but design their own layout.
Features
- Vue components for Shopping Experiences CMS
- CMS sections, blocks and elements styled using Tailwind CSS classes
- 🚀 Empowered by @shopware-pwa/composables-next
Setup
Install npm package:
# Using pnpm
pnpm add -D @shopware-pwa/cms-base
# Using yarn
yarn add --dev @shopware-pwa/cms-base
# Using npm
npm i @shopware-pwa/cms-base --save-dev
Then, register the module by editing nuxt.config.js
or (.ts
) file:
/* nuxt.config.ts */
export default defineNuxtConfig({
/* ... */
+ modules: [/* ... */, "@shopware-pwa/cms-base"],
});
⚠️ <RouterLink/>
components used
Some components use RouterLink
component internally, available in Vue Router.
In order to parse CMS components correctly and avoid missing component warning, it's highly recommended to have Vue Router installed or Nuxt router enabled in your application.
Basic usage
Since all CMS components are registered in your Nuxt application, you can now start using them in your template (no imports needed):
/* Vue component */
// response object can be a Product|Category|Landing Page response from Shopware 6 store-api containing a layout (cmsPage object) built using Shopping Experiences
<template>
<CmsPage v-if="response.cmsPage" :content="response.cmsPage"/>
</template>
You can use default styling by installing/importing Tailwind CSS stylesheet in your project.
See a short guide how to use cms-base
package in your project based on Nuxt v3.
TypeScript support
All components are fully typed with TypeScript.
No additional packages needed to be installed.
Links
-
👥 Community (
#shopware-frontends
&#shopware-pwa
channel)
Changelog
Full changelog for stable version is available here