The Rendering Engine β
System that controls how each component type is rendered β the "bridge" between React/Vue components and presentation logic.

Renderer System decides which wrapper to use for each component type:
π§ What Renderers Are: β
| Renderer Type | Function | Used For | Example |
|---|---|---|---|
| field | Renders form fields | InputText, Select, etc. | Adds automatic validation |
| container | Renders form containers | FormGroup, Section | Organizes layout |
| menu-item | Renders menu items | MenuLink, MenuButton | Adds navigation |
| menu-container | Renders menu containers | MenuContainer | Organizes hierarchy |
| content | Renders static content | Text, Image | Simple display |
π How They Work: β
Component β Renderer β DOM
InputText Component β FieldRenderer β <input> + validation + propsRenderer Adds:
- Automatic middleware pipeline
- Context injection (form, menu)
- Type-specific props transformation
- Integrated error boundaries
π‘ Result: Components focus on UI, Renderers focus on presentation logic!
π Renderer Types β
Each renderer type has specific responsibilities:
π Field Renderer - Form Fields: β
| Responsibility | Implementation | Benefit |
|---|---|---|
| Form Integration | Automatic useFormContext() | Form props injected |
| Validation Pipeline | withCpfValidation, withRules | Automatic validation |
| Dynamic Props | useReactions() | Props change based on state |
| Debug Integration | useDebug() | Automatic visual debug |
ποΈ Container Renderer - Layout and Organization: β
| Responsibility | Implementation | Benefit |
|---|---|---|
| Child Ordering | x-ui.order sorting | Automatic layout |
| Props Filtering | Remove container props | Clean props |
| Layout Logic | Responsive layout | Adaptive UI |
| Section Management | Group related items | Visual organization |
π§ Menu Renderers - Navigation: β
| Renderer | Function | Features |
|---|---|---|
| menu-item | Individual menu items | Link handling, active states |
| menu-container | Menu organization | Hierarchy, ordering, responsive |
π Content Renderer - Display: β
| Function | Usage | Characteristics |
|---|---|---|
| Static Content | Text, images, etc. | No form integration |
| Minimal Processing | Direct rendering | Optimized performance |
βοΈ How the System Works β
Conceptual flow of how renderers process components:
π Resolution Pipeline: β
Schema JSON
β
Detect Type (Which renderer to use?)
β
Fetch Renderer (In priority hierarchy)
β
Prepare Props (Merge + context)
β
Apply Middleware (Transform + validate)
β
Render (Component + wrapper)
β
Final React/Vue Elementπ― Resolution Hierarchy: β
How the system chooses which renderer to use:
| Priority | Source | When to Use | Example |
|---|---|---|---|
| 1st - Local | Factory props | Specific customization | <FormFactory renderers=\{\{field: CustomField\}\} /> |
| 2nd - Global | scheptaProvider | Application default | <scheptaProvider renderers=\{\{field: AppField\}\} /> |
| 3rd - Registry | registerRenderer() | Global extensions | registerRenderer('field', LibField) |
| 4th - Default | Built-in system | Default behavior | Internal FieldRenderer |
β‘ Central Orchestrator: β
The "maestro" that coordinates the entire process:
Responsibilities:
- Detects which component type to render
- Chooses the appropriate renderer from the hierarchy
- Prepares props by merging contexts
- Applies type-specific middleware pipeline
- Renders the final component with its wrapper
π€ Why Renderers Exist β
The problems that the renderer system solves:
π― Separation of Concerns: β
Without renderers, each component needs to:
- Mix UI logic with business logic
- Manually and inconsistently manage context
- Implement type-specific validation in each field
- Transform props in an ad-hoc and non-standardized way
With renderers, components become:
- Cleaner: exclusive focus on visual presentation
- More consistent: automatic and standardized context injection
- More reusable: validation and logic encapsulated in the renderer
- More predictable: props transformation follows established patterns
π System Flexibility: β
The same component can have different behaviors:
- Form Field: FieldRenderer adds validation + form integration
- Read-only Display: ContentRenderer maintains simple display, without form logic
- Menu Item: ItemRenderer adds navigation + active state
- Custom App: CustomRenderer implements application-specific behavior
This enables: multi-tenant apps, A/B testing, integration with different UI libraries, and custom extensions without modifying base components.
π‘ Related Concepts β
Renderers are the "engine" that connects other concepts:
- 01. Factories: Factories use renderers to process each component
- 04. Schema Resolution: Resolution pipeline detects which renderer to use
- 06. Middleware: Each renderer has a specific pipeline
- 03. Provider: Configures renderers globally
- 07. Debug System: Debug tools show which renderer was chosen