The Object UI Protocol defines the standard schemas and conventions for describing user interfaces in JSON. This protocol is the foundation of Object UI and ensures consistency across all implementations.
The protocol is organized into several core types, each representing a different aspect of application UI:
- Object - Data models and CRUD operations
- View - Data visualization (list, table, kanban, etc.)
- Page - Page layouts and structure
- Form - Form definitions and validation
- Menu - Navigation menus and breadcrumbs
- App - Application configuration
- Report - Reports and analytics
The protocol follows these key principles:
All UI definitions are valid JSON, making them:
- Easy to serialize and transmit
- Language-agnostic
- Version control friendly
- AI-friendly for generation
Complete TypeScript definitions for all schemas:
interface PageSchema {
type: 'page'
title: string
body: ComponentSchema | ComponentSchema[]
// ... more properties
}Schemas can be nested and reused:
{
"type": "page",
"body": {
"type": "grid",
"items": [
{ "type": "card", ... },
{ "type": "form", ... }
]
}
}Add custom properties for your needs:
{
"type": "button",
"label": "Click Me",
"customData": { ... },
"onCustomEvent": "handleCustom"
}All schemas follow a common structure:
Every schema includes these base properties:
interface BaseSchema {
type: string // Component type
id?: string // Unique identifier
name?: string // Field name for forms
className?: string // Tailwind classes
style?: object // Inline styles
visible?: boolean // Visibility flag
visibleOn?: string // Conditional visibility
}Each type adds its own properties:
{
"type": "input",
"name": "email",
"label": "Email Address",
"required": true,
"placeholder": "you@example.com"
}The protocol includes a powerful expression system for dynamic behavior:
{
"value": "${data.user.name}"
}{
"value": "${data.price * data.quantity}"
}{
"visibleOn": "${user.role === 'admin'}"
}{
"value": "${formatDate(data.createdAt, 'YYYY-MM-DD')}"
}All schemas can be validated using:
- JSON Schema - Standard JSON validation
- Zod - Runtime TypeScript validation
- TypeScript - Compile-time type checking
Example validation:
import { PageSchema } from '@object-ui/protocol'
import { z } from 'zod'
const pageSchema = z.object({
type: z.literal('page'),
title: z.string(),
body: z.any()
})
// Validate at runtime
pageSchema.parse(myPageData)The protocol follows semantic versioning:
- Major version: Breaking changes
- Minor version: New features (backward compatible)
- Patch version: Bug fixes
Current version: 0.1.0 (Preview)
When the protocol changes:
- Backward compatibility: Old schemas continue to work
- Deprecation warnings: Get notified of deprecated features
- Migration tools: Automated schema updates
- Documentation: Clear migration guides
Here's a complete example using multiple protocol types:
{
"type": "page",
"title": "User Management",
"body": {
"type": "crud",
"api": "/api/users",
"columns": [
{
"name": "name",
"label": "Name",
"type": "text"
},
{
"name": "email",
"label": "Email",
"type": "email"
},
{
"name": "role",
"label": "Role",
"type": "select",
"options": ["admin", "user", "guest"]
}
],
"actions": [
{
"type": "button",
"label": "Add User",
"action": "create"
}
]
}
}This single schema creates a complete user management interface with:
- Data table with sorting and pagination
- Search functionality
- Create/edit/delete operations
- Form validation
- API integration
The reference implementation is available in TypeScript:
npm install @object-ui/protocolimport {
PageSchema,
ViewSchema,
ObjectSchema
} from '@object-ui/protocol'Help us improve the protocol:
- Object Protocol - Learn about data models
- View Protocol - Understand data visualization
- Page Protocol - Master page layouts
Version: 0.1.0 (Preview)
Last Updated: January 2026
Status: Active Development