Skip to main content

View Engine

The View Engine is the core of the @repo/view package, responsible for rendering views based on schemas and handling interactions.

Overview

The View Engine provides the following functionality:
  • Schema validation and normalization
  • View rendering based on schema type
  • Integration with CRUD components
  • Error handling and fallbacks
  • Internationalization support

API Reference

createViewEngine

Creates a new instance of the View Engine with the specified options.

renderView

Renders a view based on the provided schema and options.

validateViewSchema

Validates a view schema and returns a validation result.

safeValidateViewSchema

Safely validates a view schema without throwing errors.

Schema Types

The View Engine supports the following schema types:

Form Schema

Table Schema

Detail Schema

Audit Log Schema

Import Schema

Export Schema

Integration with CRUD Components

The View Engine integrates with CRUD components from the @repo/crud package:

Error Handling

The View Engine includes comprehensive error handling:

Internationalization

The View Engine supports internationalization using next-intl:

Examples

Basic Form View

Table View with Pagination and Sorting

Detail View with Sections