Renderers Documentation
Overview (Non-Technical)
The Renderers system is the execution engine that takes visual designs (forms, dashboards, reports, dataviews) and converts them into interactive, fully-functional components. Think of it as a "compiler" that reads configuration JSON and produces React components. This separation of configuration from code enables non-technical users to design complex pages while the system handles all the technical details.
Key Purpose: Transform page configurations into interactive, responsive, properly-validated React components that handle data binding, user interaction, and error states automatically.
Standards
Renderer Architecture
Rendering Pipeline:
Configuration JSON
↓
Parser (Validates schema)
↓
Component Factory (Creates React components)
↓
Data Binding Engine (Connects to data sources)
↓
Validation Engine (Attaches validators)
↓
Styling Engine (Applies theme)
↓
Interactive Component
```text
### Renderer Types
```text
┌─────────────────────────────────────────────────────┐
│ RENDERERS │
├─────────────────────────────────────────────────────┤
│ │
│ FormRenderer DashboardRenderer ReportRenderer
│ └─ Validates └─ Visualizes data └─ Formats
│ └─ Binds data └─ Auto-refreshes └─ Exports
│ └─ Submits └─ Filters └─ Paginates
│ └─ Shows errors └─ Aggregates │
│ └─ Prints
│ │
│ ContentRenderer │ DataViewRenderer
│ └─ Rich text └─ Displays tables
│ └─ Markdown └─ Sorting/Filtering
│ └─ HTML render └─ Bulk actions
│ └─ Parent-child expand
│
└─────────────────────────────────────────────────────┘
```text
### File Organization
```text
renderers/
├── core/
│ ├── RendererRegistry.tsx # Factory for all renderers
│ ├── ConfigurationValidator.ts # Schema validation
│ ├── DataBindingEngine.ts # Variable substitution
│ └── ThemeApplier.ts # CSS variable application
├── form/
│ ├─ ─ FormRenderer.tsx # Main form component
│ ├── FieldRenderer.tsx # Individual field mapper
│ ├── FieldComponents/ # Actual field implementations
│ │ ├── TextInput.tsx
│ │ ├── SelectDropdown.tsx
│ │ ├── DatePicker.tsx
│ │ ├── FileUpload.tsx
│ │ ├── RepeaterField.tsx
│ │ └── ... (20+ field types)
│ ├── ValidationEngine.ts # Form validation logic
│ ├── FormState.ts # Form state management
│ └── hooks/
│ ├── useFormState.ts
│ ├── useFieldValidation.ts
│ └── useFormSubmission.ts
├── dashboard/
│ ├── DashboardRenderer.tsx # Main dashboard component
│ ├── WidgetRenderer.tsx # Widget factory
│ ├── widgets/
│ │ ├── ChartWidget.tsx # Chart visualization
│ │ ├── MetricWidget.tsx # Single metric card
│ │ ├── TableWidget.tsx # Data table
│ │ ├── GaugeWidget.tsx # Gauge visualization
│ │ └── ... (10+ widget types)
│ ├── FilterPanel.tsx # Dashboard filters
│ ├── hooks/
│ │ └── useDashboardData.ts
│ └── utils/
│ └── chartConfig.ts # Chart.js configuration
├── report/
│ ├── ReportRenderer.tsx # Main report component
│ ├── ReportSection.tsx # Section renderer
│ ├── sections/
│ │ ├── HeaderSection.tsx
│ │ ├── TableSection.tsx
│ │ ├── ChartSection.tsx
│ │ └── SummarySection.tsx
│ ├── ReportExporter.ts # PDF/Excel export
│ └── printing.ts # Print styling
├── dataview/
│ ├── DataViewRenderer.tsx # Main dataview component
│ ├── TableRenderer.tsx # Table view
│ ├── CardRenderer.tsx # Card view
│ ├── TimelineRenderer.tsx # Timeline view