mirror of
https://github.com/johndoe6345789/metabuilder.git
synced 2026-04-25 22:34:56 +00:00
734 B
734 B
Add Declarative Component
Add a new component using the declarative pattern (not hardcoded TSX):
- Define in package
packages/{pkg}/seed/components.json:
{
"type": "MyComponent",
"category": "ui",
"label": "My Component",
"props": [
{ "name": "title", "type": "string", "required": true }
],
"config": {
"layout": "vertical",
"styling": { "className": "myComponentRoot" }
}
}
Note: styling.className should reference a real CSS class (SCSS/modules), not Tailwind utility classes.
-
Register via
DeclarativeComponentRenderer.registerComponentConfig() -
Render using
<RenderComponent component={...} />
Keep components under 150 LOC. Use composition for complex UIs.