The @object-ui/core package provides the foundational type definitions, schemas, and core logic for Object UI.
This package is framework-agnostic with zero React dependencies, making it suitable for use in Node.js environments, build tools, or other frameworks.
npm install @object-ui/coreimport type {
BaseSchema,
PageSchema,
FormSchema,
ViewSchema,
ComponentSchema
} from '@object-ui/core'All schemas extend from BaseSchema:
interface BaseSchema {
type: string
id?: string
name?: string
className?: string
style?: React.CSSProperties
visible?: boolean
visibleOn?: string
}interface PageSchema extends BaseSchema {
type: 'page'
title: string
description?: string
body: ComponentSchema | ComponentSchema[]
}interface FormSchema extends BaseSchema {
type: 'form'
title?: string
body: FieldSchema[]
actions?: ActionSchema[]
onSubmit?: string
}interface InputSchema extends BaseSchema {
type: 'input'
name: string
label: string
placeholder?: string
required?: boolean
disabled?: boolean
inputType?: 'text' | 'email' | 'password' | 'number'
}import { PageSchema } from '@object-ui/core'
import { z } from 'zod'
const pageValidator = z.object({
type: z.literal('page'),
title: z.string(),
body: z.any()
})
// Validate
const result = pageValidator.safeParse(mySchema)import { isPageSchema, isFormSchema } from '@object-ui/core'
if (isPageSchema(schema)) {
// TypeScript knows schema is PageSchema
console.log(schema.title)
}The core package provides a framework-agnostic component registry:
import { ComponentRegistry } from '@object-ui/core'
const registry = new ComponentRegistry()
registry.register('button', buttonMetadata)Data scope management for expression evaluation:
import { DataScope } from '@object-ui/core'
const scope = new DataScope({ user: { name: 'John' } })
const value = scope.get('user.name') // 'John'For detailed API documentation, see: