liferay-custom-elements
CommunityEmbed React widgets in Liferay as Web Components
AuthorJoaoPedroAmaral
Version1.0.0
Installs0
System Documentation
What problem does it solve?
Embedding standalone React (or any framework) frontend widgets into Liferay pages while preserving lifecycle management, styling isolation choices, authenticated portal integration, and safe bundling for portal deployment.
Core Features & Use Cases
- Web Component wrapper: Guide to wrap a React app as an HTMLElement, mount a React root in connectedCallback, and unmount in disconnectedCallback to avoid memory leaks.
- CSS isolation options: When to use Shadow DOM for strict isolation and when to rely on portal CSS inheritance for Clay UI compatibility.
- Build and deployment: Vite and rollup output configuration, client-extension.yaml properties mapping, and ESM-friendly bundling for Liferay Client Extensions.
- Portal integration: Using Liferay global APIs for auth tokens, secure fetches, and detaching event listeners; using MemoryRouter to avoid altering the browser URL.
- Dev ergonomics: Local liferay stub for development and anti-patterns to avoid duplicate registration and missing cleanup.
Quick Start
Create a React app wrapped as a custom element named my-widget, guard customElements.define to prevent duplicates, unmount the React root in disconnectedCallback, configure client-extension.yaml properties, and set Vite build output for ESM deployment.
Dependency Matrix
Required Modules
None requiredComponents
references
💻 Claude Code Installation
Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.
Please help me install this Skill: Name: liferay-custom-elements Download link: https://github.com/JoaoPedroAmaral/backBarbearia/archive/main.zip#liferay-custom-elements Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
Agent Skills Search Helper
Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.