Drupal Installation
apps/docs/src/content/docs/drupal-integration/installation Click to copy Copied!
apps/docs/src/content/docs/drupal-integration/installation Method 1: CDN (Quickest)
Section titled “Method 1: CDN (Quickest)”Add the library via CDN in your theme’s .info.yml:
libraries: - mytheme/wc-2026
# mytheme.libraries.ymlwc-2026: js: https://cdn.jsdelivr.net/npm/@wc-2026/library@latest/dist/wc-2026.bundled.js: type: external attributes: type: moduleMethod 2: npm (Recommended)
Section titled “Method 2: npm (Recommended)”Install via npm and include in your theme’s build process:
cd web/themes/custom/mythemenpm install @wc-2026/libraryThen import in your theme’s JavaScript:
import '@wc-2026/library';Method 3: Drupal Library (Enterprise)
Section titled “Method 3: Drupal Library (Enterprise)”Create a custom module that provides the library:
components: version: 0.0.1 js: /libraries/wc-2026/dist/wc-2026.bundled.js: type: module preprocess: false dependencies: - core/drupalVerification
Section titled “Verification”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.
Next Steps
Section titled “Next Steps”- TWIG Patterns - Template examples
- Behaviors - JavaScript integration
- Troubleshooting - Common issues