Skip to content

Commit 2fa0c15

Browse files
authored
Merge pull request #25 from objectstack-ai/copilot/publish-studio-to-website
2 parents e291f67 + 4461f76 commit 2fa0c15

File tree

6 files changed

+235
-1
lines changed

6 files changed

+235
-1
lines changed

.github/workflows/deploy-docs.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ on:
66
- main
77
paths:
88
- 'docs/**'
9+
- 'apps/playground/**'
10+
- 'packages/**'
911
- '.github/workflows/deploy-docs.yml'
1012
workflow_dispatch:
1113

@@ -56,6 +58,16 @@ jobs:
5658
- name: Build documentation
5759
run: pnpm docs:build
5860

61+
- name: Build Studio (Playground)
62+
run: pnpm --filter @apps/playground build
63+
env:
64+
NODE_ENV: production
65+
66+
- name: Copy Studio to docs dist
67+
run: |
68+
mkdir -p docs/.vitepress/dist/studio
69+
cp -r apps/playground/dist/* docs/.vitepress/dist/studio/
70+
5971
- name: Setup Pages
6072
uses: actions/configure-pages@v4
6173

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@
88
[![TypeScript](https://img.shields.io/badge/written%20in-TypeScript-3178C6.svg)](https://www.typescriptlang.org/)
99
[![NPM](https://img.shields.io/npm/v/@object-ui/react.svg)](https://www.npmjs.com/package/@object-ui/react)
1010

11+
---
12+
13+
## 🎨 Try It Online
14+
15+
**[Launch Object UI Studio →](https://www.objectui.org/studio/)**
16+
17+
Experience our interactive visual editor with drag-and-drop design, live preview, and instant JSON export. Perfect for prototyping and learning!
1118

1219
---
1320

apps/playground/vite.config.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import path from 'path';
55
// https://vitejs.dev/config/
66
export default defineConfig({
77
plugins: [react()],
8+
base: process.env.NODE_ENV === 'production' ? '/studio/' : '/',
89
resolve: {
910
alias: {
1011
'@object-ui/components': path.resolve(__dirname, '../../packages/components/src'),
@@ -15,5 +16,9 @@ export default defineConfig({
1516
},
1617
server: {
1718
port: 5174
19+
},
20+
build: {
21+
outDir: 'dist',
22+
emptyOutDir: true,
1823
}
1924
});

docs/.vitepress/config.mts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ export default defineConfig({
1313

1414
nav: [
1515
{ text: 'Home', link: '/' },
16+
{ text: 'Studio', link: '/studio/', target: '_self' },
1617
{ text: 'Guide', link: '/guide/introduction' },
1718
{ text: 'Roadmap', link: '/ROADMAP' },
1819
{ text: 'Protocol', link: '/protocol/overview' },
@@ -26,7 +27,8 @@ export default defineConfig({
2627
items: [
2728
{ text: 'Introduction', link: '/guide/introduction' },
2829
{ text: 'Quick Start', link: '/guide/quick-start' },
29-
{ text: 'Installation', link: '/guide/installation' }
30+
{ text: 'Installation', link: '/guide/installation' },
31+
{ text: 'Visual Studio', link: '/guide/studio' }
3032
]
3133
},
3234
{

docs/guide/studio.md

Lines changed: 192 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,192 @@
1+
# Object UI Studio
2+
3+
The **Object UI Studio** is a powerful, interactive visual editor that allows you to design and prototype user interfaces without writing code. It combines a drag-and-drop designer, live preview, and instant JSON export capabilities.
4+
5+
## 🚀 Quick Access
6+
7+
<div class="tip custom-block">
8+
<p><strong>Try it now!</strong></p>
9+
<p>Access the Studio at: <a href="/studio/" target="_blank">/studio/</a></p>
10+
</div>
11+
12+
## Features
13+
14+
### 🎨 Visual Designer
15+
- **Drag-and-Drop**: Drag components from the palette directly onto the canvas
16+
- **Smart Positioning**: Intelligent drop zone detection for precise component placement
17+
- **Live Preview**: See your changes in real-time as you design
18+
- **Component Search**: Quickly find the components you need
19+
20+
### 📝 Code Editor
21+
- **JSON Editor**: Edit schemas directly with syntax highlighting
22+
- **Split View**: Code on the left, preview on the right
23+
- **Syntax Validation**: Real-time JSON validation with error messages
24+
- **Auto-format**: Beautiful, readable JSON output
25+
26+
### 📱 Responsive Preview
27+
- **Multiple Viewports**: Test your design in Desktop, Tablet, and Mobile views
28+
- **Device Frames**: Realistic device mockups for mobile and tablet
29+
- **Instant Switching**: Toggle between viewports with one click
30+
31+
### ⚡ Productivity Features
32+
- **Undo/Redo**: Full history management (`Ctrl+Z` / `Ctrl+Y`)
33+
- **Copy/Paste**: Duplicate components easily (`Ctrl+C` / `Ctrl+V`)
34+
- **Export JSON**: Download your schema as a `.json` file
35+
- **Copy to Clipboard**: One-click copy for easy integration
36+
37+
## Getting Started
38+
39+
### 1. Choose a Template
40+
41+
When you open the Studio, you'll see a gallery of pre-built examples organized by category:
42+
43+
- **Primitives**: Basic building blocks (inputs, buttons, text)
44+
- **Layouts**: Page structures and responsive grids
45+
- **Data Display**: Tables, lists, and cards
46+
- **Forms**: Complete form examples with validation
47+
- **Complex**: Advanced examples like dashboards and admin panels
48+
49+
Click any example to load it in the Studio.
50+
51+
### 2. Design Mode
52+
53+
In **Design Mode**, you can:
54+
- Select components by clicking them
55+
- Edit properties in the right panel
56+
- Drag new components from the palette
57+
- Reorder components by dragging
58+
- Delete components with the `Delete` key
59+
60+
**Tips:**
61+
- Use the property panel to customize colors, spacing, and behavior
62+
- Try adding `className` properties with Tailwind CSS classes
63+
- Nested components can be expanded to edit their children
64+
65+
### 3. Preview Mode
66+
67+
Switch to **Preview Mode** to see how your interface looks without the designer chrome:
68+
- Test responsiveness with viewport toggles
69+
- Interact with components to verify behavior
70+
- Check the visual design at different screen sizes
71+
72+
### 4. Code Mode
73+
74+
In **Code Mode**, you have:
75+
- Full JSON schema on the left
76+
- Live preview on the right
77+
- Real-time validation
78+
- Direct editing for advanced users
79+
80+
**Pro Tip:** Copy the JSON and paste it directly into your React application:
81+
82+
```tsx
83+
import { SchemaRenderer } from '@object-ui/react';
84+
85+
const schema = {
86+
// Paste your copied JSON here
87+
};
88+
89+
function MyComponent() {
90+
return <SchemaRenderer schema={schema} />;
91+
}
92+
```
93+
94+
## Keyboard Shortcuts
95+
96+
| Shortcut | Action | Description |
97+
|----------|--------|-------------|
98+
| `Ctrl+Z` / `Cmd+Z` | Undo | Undo the last change |
99+
| `Ctrl+Y` / `Cmd+Y` | Redo | Redo the last undone change |
100+
| `Ctrl+C` / `Cmd+C` | Copy | Copy the selected component |
101+
| `Ctrl+V` / `Cmd+V` | Paste | Paste the copied component |
102+
| `Delete` / `Backspace` | Delete | Delete the selected component |
103+
104+
## Use Cases
105+
106+
### 1. **Rapid Prototyping**
107+
Quickly design and test UI concepts without writing code. Export the JSON when ready for development.
108+
109+
### 2. **Learning Tool**
110+
Understand how Object UI schemas work by experimenting with the visual designer and seeing the JSON output.
111+
112+
### 3. **Client Demos**
113+
Create interactive mockups to show clients and gather feedback before implementation.
114+
115+
### 4. **Component Library Exploration**
116+
Browse and test all available components to understand their properties and behavior.
117+
118+
### 5. **Schema Generation**
119+
Generate complex schemas visually, then fine-tune the JSON for production use.
120+
121+
## Examples Gallery
122+
123+
The Studio includes curated examples in multiple categories:
124+
125+
### Layouts
126+
- **Dashboard**: KPI cards, charts, and responsive grid
127+
- **Grid Layout**: Multi-column responsive layouts
128+
- **Tabs**: Tabbed interface with multiple panels
129+
130+
### Forms
131+
- **User Registration**: Complete signup form with validation
132+
- **Contact Form**: Simple form with text inputs and textarea
133+
- **Multi-step Form**: Wizard-style form with progress indicator
134+
135+
### Complex
136+
- **Admin Panel**: Full-featured dashboard with navigation
137+
- **E-commerce**: Product listing with filters
138+
- **Analytics**: Data visualization and reporting
139+
140+
## Best Practices
141+
142+
### 1. Start with a Template
143+
Don't start from scratch - use an existing example as a starting point and customize it.
144+
145+
### 2. Use Semantic Components
146+
Choose the right component for the job:
147+
- Use `<Form>` for data collection
148+
- Use `<Card>` for content grouping
149+
- Use `<Grid>` for responsive layouts
150+
151+
### 3. Leverage Tailwind Classes
152+
Add custom styling with `className` properties:
153+
```json
154+
{
155+
"type": "button",
156+
"label": "Submit",
157+
"className": "bg-indigo-600 hover:bg-indigo-700"
158+
}
159+
```
160+
161+
### 4. Test Responsiveness
162+
Always preview your design in multiple viewport sizes to ensure it works on all devices.
163+
164+
### 5. Export and Iterate
165+
Export your schema, integrate it into your app, and come back to the Studio to make adjustments.
166+
167+
## Limitations
168+
169+
The Studio is designed for:
170+
- ✅ Prototyping and design
171+
- ✅ Learning and experimentation
172+
- ✅ Schema generation
173+
174+
It is **not** designed for:
175+
- ❌ Production data management (no backend connection)
176+
- ❌ Complex state management (use your app for that)
177+
- ❌ Custom component development (extend Object UI separately)
178+
179+
## What's Next?
180+
181+
- [Read the full guide](/guide/introduction)
182+
- [Explore the API reference](/api/react)
183+
- [Check out component specifications](/protocol/overview)
184+
- [View the project roadmap](/ROADMAP)
185+
186+
## Feedback
187+
188+
We'd love to hear your thoughts on the Studio!
189+
190+
- 🐛 [Report bugs](https://github.com/objectql/objectui/issues)
191+
- 💡 [Request features](https://github.com/objectql/objectui/issues)
192+
-[Star on GitHub](https://github.com/objectql/objectui)

docs/index.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ hero:
1010
alt: Object UI
1111
actions:
1212
- theme: brand
13+
text: Try Studio Now
14+
link: /studio/
15+
- theme: alt
1316
text: Get Started
1417
link: /guide/introduction
1518
- theme: alt
@@ -76,6 +79,19 @@ features:
7679

7780
That's it! This JSON automatically creates a beautiful, accessible, and functional contact form.
7881

82+
## 🎨 Try the Visual Studio
83+
84+
<div class="tip custom-block" style="border-color: #6366f1;">
85+
<p class="custom-block-title" style="color: #6366f1;">✨ Experience Object UI Studio</p>
86+
<p>Explore our interactive visual editor with drag-and-drop design, live preview, and instant JSON export. Perfect for prototyping and learning!</p>
87+
<p style="margin-top: 12px;">
88+
<a href="/studio/" style="display: inline-flex; align-items: center; gap: 8px; padding: 10px 20px; background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color: white; border-radius: 8px; text-decoration: none; font-weight: 600; box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3); transition: all 0.3s;">
89+
🚀 Launch Studio
90+
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M5 12h14"/><path d="m12 5 7 7-7 7"/></svg>
91+
</a>
92+
</p>
93+
</div>
94+
7995
## Why Object UI?
8096

8197
<div class="tip custom-block">

0 commit comments

Comments
 (0)