Get up and running with Object UI in less than 5 minutes.
Install Object UI packages using your preferred package manager:
::: code-group
npm install @object-ui/react @object-ui/componentsyarn add @object-ui/react @object-ui/componentspnpm add @object-ui/react @object-ui/components:::
Create a simple form with Object UI:
import React from 'react'
import { SchemaRenderer } from '@object-ui/react'
import { registerDefaultRenderers } from '@object-ui/components'
// Register the default components
registerDefaultRenderers()
const schema = {
type: "form",
title: "Contact Form",
body: [
{
type: "input",
name: "name",
label: "Your Name",
required: true
},
{
type: "input",
name: "email",
label: "Email",
inputType: "email",
required: true
},
{
type: "textarea",
name: "message",
label: "Message",
rows: 4
}
],
actions: [
{
type: "submit",
label: "Send Message",
level: "primary"
}
]
}
function App() {
const handleSubmit = (data) => {
console.log('Form submitted:', data)
}
return (
<SchemaRenderer
schema={schema}
onSubmit={handleSubmit}
/>
)
}
export default AppThat's it! You now have a fully functional, validated form with professional styling.
Pass data to your components using the data prop:
const data = {
user: {
name: 'John Doe',
email: 'john@example.com'
}
}
<SchemaRenderer
schema={schema}
data={data}
/>Reference data in your schema using expressions:
{
"type": "text",
"value": "${user.name}"
}Show/hide components based on conditions:
{
"type": "alert",
"message": "Welcome, Admin!",
"visibleOn": "${user.role === 'admin'}"
}Connect to your backend API:
const schema = {
type: "crud",
api: {
list: "/api/users",
create: "/api/users",
update: "/api/users/${id}",
delete: "/api/users/${id}"
},
columns: [
{ name: "name", label: "Name" },
{ name: "email", label: "Email" },
{ name: "role", label: "Role" }
]
}Object UI automatically handles:
- Data fetching and caching
- Pagination
- Sorting and filtering
- CRUD operations
- Loading and error states
Customize styles using Tailwind classes:
{
"type": "card",
"className": "p-6 shadow-lg rounded-xl bg-gradient-to-r from-blue-500 to-purple-500",
"body": {
"type": "text",
"value": "Beautiful Card",
"className": "text-white text-2xl font-bold"
}
}Now that you have the basics:
- Installation Guide - Detailed setup instructions
- Schema Rendering - Learn the core concepts
- Component Registry - Understand component registration
- Expression System - Master dynamic expressions
Check out our JSON-based examples that you can run immediately:
- Basic Form - Contact form with validation
- Dashboard - Analytics dashboard with metrics
- Data Display - Lists, badges, and progress bars
- Landing Page - Complete marketing page
- All Examples - View the full collection
Run any example with the CLI:
npm install -g @object-ui/cli
objectui serve examples/basic-form/app.json