Skip to content

Drupal Installation

apps/docs/src/content/docs/drupal-integration/installation Click to copy
Copied! apps/docs/src/content/docs/drupal-integration/installation

Add the library via CDN in your theme’s .info.yml:

mytheme.info.yml
libraries:
- mytheme/wc-2026
# mytheme.libraries.yml
wc-2026:
js:
https://cdn.jsdelivr.net/npm/@wc-2026/library@latest/dist/wc-2026.bundled.js:
type: external
attributes:
type: module

Install via npm and include in your theme’s build process:

Terminal window
cd web/themes/custom/mytheme
npm install @wc-2026/library

Then import in your theme’s JavaScript:

mytheme.js
import '@wc-2026/library';

Create a custom module that provides the library:

wc_2026.libraries.yml
components:
version: 0.0.1
js:
/libraries/wc-2026/dist/wc-2026.bundled.js:
type: module
preprocess: false
dependencies:
- core/drupal

After installation, verify components render:

<!-- Add to any TWIG template -->
<wc-button variant="primary">Test Button</wc-button>

If the button renders with proper styling, the installation is complete.