This project is not covered by Drupal’s security advisory policy.
Overview
The Component Entity module transforms Drupal into a modern component-driven CMS while staying 100% Drupal-native. It creates a seamless bridge between Single Directory Components (SDC) and Drupal's entity system, making components first-class citizens with full Drupal functionality.
What Problem Does This Solve?
Traditional Drupal theming often involves scattered templates and complex render arrays. Meanwhile, modern web development uses component-based architectures. This module bridges that gap by:
- Making SDC components manageable as content entities - just like nodes or users
- Enabling dual rendering - choose between SEO-friendly Twig or interactive React per component instance
- Maintaining all standard Drupal patterns - no custom UI, no special workflows
How It Works
Automatic Synchronization
When you create an SDC component, the module automatically creates a corresponding entity bundle with fields mapped from the component's props:
# Your SDC component definition
hero.component.yml:
props:
title: string
subtitle: string
# Automatically becomes:
- Entity bundle: "hero_banner"
- Field: field_title
- Field: field_subtitle
Standard Drupal Features
Components work with all existing Drupal systems:
- Field UI - Add/edit fields through the familiar interface
- Views - List, filter, and sort components
- Entity References - Reference components from any entity
- Permissions - Standard create/edit/delete per bundle
- Revisions & Translation - Full multilingual and version support
- JSON:API & REST - Automatic API exposure
Flexible Rendering
Content editors choose rendering per component instance:
Server-side (Twig) - Traditional SDC rendering for SEO-critical content
Client-side (React) - Interactive components with hydration for dynamic UX
Key Benefits
- No magic - Uses standard entity system with minimal custom code
- Progressive enhancement - Start with Twig, add React when needed
- SEO-friendly - Server-side rendering with optional client hydration
- Developer-friendly - Familiar Drupal patterns, no new concepts to learn
Requirements
- Drupal 10.2+ or Drupal 11
- PHP 8.1+
- SDC module enabled
- Node.js 16+ (optional, for React support)
Project information
- Created by code poet on , updated
This project is not covered by the security advisory policy.
Use at your own risk! It may have publicly disclosed vulnerabilities.
