| title | UI Protocol (ObjectUI) |
|---|---|
| description | Comprehensive specification for the ObjectStack UI Layer - server-driven UI definitions and rendering. |
import { Layout, Monitor, Palette, Zap } from 'lucide-react';
The UI Protocol (ObjectUI) defines how user interfaces are expressed as metadata. Instead of hardcoding React/Vue components, you define UI as JSON configurations that renderers interpret.
Traditional: Code UI → Build → Deploy → Update Requires Rebuild
ObjectUI: Define JSON → Instant Update → No Rebuild Needed
-
- Server-Driven UI philosophy
- JSON-based component definitions
- Renderer architecture
-
- ListView (Grid, Kanban, Calendar, Gantt)
- FormView (Simple, Tabbed, Wizard)
- DetailView (Record pages)
-
- Button, Input, Select components
- Custom component registration
- Component props and events
-
- Grid-based layouts
- Responsive breakpoints
- Flexbox patterns
-
- Button actions
- URL navigation
- Flow launches
- Custom actions
- Report Template
- Report types (Tabular, Summary, Matrix)
- Chart configurations
- Dashboard widgets
Display collections of records in various formats:
ListView.create({
viewType: 'grid', // or 'kanban' | 'calendar' | 'gantt'
columns: [...],
filters: {...},
sorting: [...],
});Supported View Types:
- Grid: Traditional table with sorting, filtering, pagination
- Kanban: Drag-and-drop board with swimlanes
- Calendar: Timeline view with date-based events
- Gantt: Project timeline with dependencies
Edit individual records with custom layouts:
FormView.create({
layout: {
sections: [
{
label: 'Basic Info',
columns: 2,
fields: ['name', 'email'],
},
],
},
});Features:
- Multi-section layouts
- Conditional field visibility
- Read-only fields
- Custom validation
Compose widgets for analytics:
Dashboard.create({
layout: {
rows: [
{
widgets: [
Widget.metric({ ... }),
Widget.chart({ ... }),
],
},
],
},
});Widget Types:
- Metric cards (KPIs)
- Charts (Bar, Line, Pie, etc.)
- Embedded list views
- Custom widgets
ObjectUI includes a comprehensive theming system:
Theme.create({
colors: {
primary: '#3B82F6',
secondary: '#8B5CF6',
},
typography: {
fontFamily: 'Inter, sans-serif',
},
spacing: {
unit: 8, // 8px grid
},
});Customizable:
- Color palettes
- Typography (fonts, sizes, weights)
- Spacing and sizing
- Border radius
- Shadows
- Z-index layers
Define app navigation structure:
App.create({
navigation: [
NavigationItem.object({ label: 'Tasks', object: 'task' }),
NavigationItem.dashboard({ label: 'Home', dashboard: 'overview' }),
NavigationItem.group({
label: 'Reports',
items: [...],
}),
],
});// ❌ Imperative (React)
function TaskList() {
const [tasks, setTasks] = useState([]);
useEffect(() => { /* fetch */ }, []);
return <DataGrid rows={tasks} />;
}
// ✅ Declarative (ObjectUI)
ListView.create({
object: 'task',
columns: [{ field: 'title' }],
});UI changes should not require rebuilding:
Change Config → Refresh Page → New UI ✅
Change Code → Rebuild → Redeploy → New UI ❌
All layouts use a 12-column grid system that adapts to screen size:
Widget.metric({
width: 12, // Mobile: Full width
// Tablet: Auto-adjust
// Desktop: 1/4 width
});WCAG 2.1 AA compliance out of the box:
- Keyboard navigation
- Screen reader support
- Color contrast ratios
- Focus indicators
ObjectUI is a protocol. Multiple renderers can implement it:
| Renderer | Status | Platform |
|---|---|---|
@objectstack/react-renderer |
🚧 In Progress | Web (React) |
@objectstack/vue-renderer |
📋 Planned | Web (Vue) |
@objectstack/flutter-renderer |
📋 Planned | Mobile (Flutter) |
@objectstack/native-renderer |
📋 Planned | Mobile (React Native) |
Building a renderer for ObjectUI? Start here:
Using ObjectUI to build interfaces? See:
- Data Protocol - How to query data
- System Protocol - Runtime environment
- UI Reference - Complete API reference