Skip to main content
DynamicResource is the core UI abstraction in @veloiq/ui. It provides four React components — DynamicList, DynamicShow, DynamicCreate, and DynamicEdit — that render complete CRUD pages entirely from a ModelDef schema object. You pass the schema and the full model registry; the components handle field rendering, relation display, form validation, pagination, sorting, filtering, and role-based field visibility automatically.

Components

DynamicList

Renders a paginated, sortable, filterable list page. Columns are derived from the model’s FieldDef array. The list integrates with Refine’s data provider for pagination (using _start/_end query parameters) and reads x-total-count from the response header. Bulk actions can be supplied via the BulkActionDef type.

DynamicShow

Renders a detail page for a single record. Displays all readable fields grouped by the model schema. Shows related records using the RelationDef configuration — each relation can render as a table, editable table, list, gallery, calendar, tree, or tree-details view depending on its showViewType. Also renders a relations explorer panel and supports side-by-side Miller-columns tree navigation.

DynamicCreate

Renders a creation form. Each form field is generated from the corresponding FieldDef: type determines the input widget, options populates select inputs, required adds validation, and writeRoles hides inputs that the current user cannot write.

DynamicEdit

Renders an edit form with the same field generation logic as DynamicCreate. Pre-populates fields from the fetched record. Read-only fields (those with readOnly: true or where the user lacks writeRoles) are displayed but not editable.

ModelDef type

ModelDef is the top-level schema object that describes a single resource. All four DynamicResource components accept model: ModelDef as their primary prop.

FieldDef type

Each entry in ModelDef.fields is a FieldDef that controls how a single attribute is displayed and edited.

RelationDef type

Each entry in ModelDef.relations describes a related resource rendered in the show and edit pages.

Auto-generated schemas

veloiq generate creates {module}Schema.gen.ts in each module’s frontend directory. This file contains the ModelDef array for all models in the module and is overwritten on every run — do not edit it directly.

Manual schema overrides

To extend or override the generated schema without losing your changes on the next veloiq generate run:
  1. Create {module}Schema.manual.ts in the same directory.
  2. Merge it into {module}Schema.ts, which you maintain by hand.

generateResources and authSystemModels

generateResources(models, moduleName) converts a ModelDef[] into a Refine ResourceDef[] array with list/show/create/edit paths set. authSystemModels is a static ModelDef[] with built-in definitions for User, Role, and Tenant.

UI Overview

All exports from @veloiq/ui at a glance.

Auth Providers

Wire up authProvider, accessControlProvider, and httpClient.