|
| 1 | +# Object UI Examples |
| 2 | + |
| 3 | +Welcome to the Object UI examples directory! This collection showcases the power of JSON-driven UI development with real-world examples. |
| 4 | + |
| 5 | +## 📚 Example Categories |
| 6 | + |
| 7 | +### 🎯 JSON Schema Examples (New!) |
| 8 | + |
| 9 | +These examples demonstrate the new JSON project specification - pure JSON schemas that can be rendered directly with the Object UI CLI or SchemaRenderer. |
| 10 | + |
| 11 | +| Example | Description | Difficulty | Features | |
| 12 | +|---------|-------------|------------|----------| |
| 13 | +| [**basic-form**](./basic-form) | Beautiful contact form | ⭐ Beginner | Forms, inputs, validation, buttons | |
| 14 | +| [**dashboard**](./dashboard) | Analytics dashboard | ⭐⭐ Intermediate | Metrics, activity feeds, grids | |
| 15 | +| [**data-display**](./data-display) | Data visualization patterns | ⭐⭐ Intermediate | Lists, profiles, badges, progress | |
| 16 | +| [**landing-page**](./landing-page) | Marketing landing page | ⭐⭐⭐ Advanced | Hero sections, CTAs, full layouts | |
| 17 | +| [**cli-demo**](./cli-demo) | CLI demonstration | ⭐ Beginner | Bilingual form, gradient backgrounds | |
| 18 | + |
| 19 | +### 🔧 Integration Examples |
| 20 | + |
| 21 | +| Example | Description | Type | |
| 22 | +|---------|-------------|------| |
| 23 | +| [**objectql-integration**](./objectql-integration) | ObjectQL backend integration | API Integration | |
| 24 | +| [**prototype**](./prototype) | React/Vite prototype app | Full Application | |
| 25 | + |
| 26 | +## 🚀 Quick Start |
| 27 | + |
| 28 | +### Option 1: Use Object UI CLI (Recommended) |
| 29 | + |
| 30 | +```bash |
| 31 | +# Install CLI globally |
| 32 | +npm install -g @object-ui/cli |
| 33 | + |
| 34 | +# Run any JSON example |
| 35 | +objectui serve examples/basic-form/app.json |
| 36 | +objectui serve examples/dashboard/app.json |
| 37 | +objectui serve examples/landing-page/app.json |
| 38 | +``` |
| 39 | + |
| 40 | +### Option 2: From Repository Root |
| 41 | + |
| 42 | +```bash |
| 43 | +# Using pnpm |
| 44 | +pnpm objectui serve examples/basic-form/app.json |
| 45 | + |
| 46 | +# Using npx |
| 47 | +npx @object-ui/cli serve examples/dashboard/app.json |
| 48 | +``` |
| 49 | + |
| 50 | +### Option 3: Run Prototype App |
| 51 | + |
| 52 | +```bash |
| 53 | +cd examples/prototype |
| 54 | +pnpm install |
| 55 | +pnpm dev |
| 56 | +``` |
| 57 | + |
| 58 | +## 📖 Learning Path |
| 59 | + |
| 60 | +### 1️⃣ **Start Here: Basic Form** |
| 61 | +Learn the fundamentals of JSON schemas |
| 62 | +- Input components |
| 63 | +- Layout patterns |
| 64 | +- Styling with Tailwind |
| 65 | + |
| 66 | +```bash |
| 67 | +objectui serve examples/basic-form/app.json |
| 68 | +``` |
| 69 | + |
| 70 | +### 2️⃣ **Next: Data Display** |
| 71 | +Explore data visualization patterns |
| 72 | +- Lists and cards |
| 73 | +- Badges and status indicators |
| 74 | +- Progress bars |
| 75 | + |
| 76 | +```bash |
| 77 | +objectui serve examples/data-display/app.json |
| 78 | +``` |
| 79 | + |
| 80 | +### 3️⃣ **Then: Dashboard** |
| 81 | +Build complex layouts |
| 82 | +- Metric cards |
| 83 | +- Activity feeds |
| 84 | +- Responsive grids |
| 85 | + |
| 86 | +```bash |
| 87 | +objectui serve examples/dashboard/app.json |
| 88 | +``` |
| 89 | + |
| 90 | +### 4️⃣ **Finally: Landing Page** |
| 91 | +Master full-page designs |
| 92 | +- Hero sections |
| 93 | +- Marketing layouts |
| 94 | +- Advanced compositions |
| 95 | + |
| 96 | +```bash |
| 97 | +objectui serve examples/landing-page/app.json |
| 98 | +``` |
| 99 | + |
| 100 | +## 🎨 What You'll Learn |
| 101 | + |
| 102 | +### JSON Schema Patterns |
| 103 | +- Component composition |
| 104 | +- Layout structures |
| 105 | +- Responsive design |
| 106 | +- Styling with Tailwind CSS |
| 107 | + |
| 108 | +### Component Types |
| 109 | +- **Layout**: `div`, `card`, `flex` |
| 110 | +- **Typography**: `text`, headings |
| 111 | +- **Forms**: `input`, `textarea`, `button` |
| 112 | +- **Data**: `progress`, lists, tables |
| 113 | +- **Visual**: `separator`, badges, avatars |
| 114 | + |
| 115 | +### Styling Techniques |
| 116 | +- Gradient backgrounds |
| 117 | +- Hover effects |
| 118 | +- Shadow transitions |
| 119 | +- Color schemes |
| 120 | +- Responsive breakpoints |
| 121 | + |
| 122 | +## 📂 Example Structure |
| 123 | + |
| 124 | +Each JSON example follows this structure: |
| 125 | + |
| 126 | +``` |
| 127 | +example-name/ |
| 128 | +├── app.json # The main JSON schema |
| 129 | +├── README.md # Detailed documentation |
| 130 | +└── .gitignore # Git ignore file (if needed) |
| 131 | +``` |
| 132 | + |
| 133 | +## 🎯 Features by Example |
| 134 | + |
| 135 | +### Basic Form |
| 136 | +✅ Text inputs and textarea |
| 137 | +✅ Form validation |
| 138 | +✅ Button variants |
| 139 | +✅ Card containers |
| 140 | +✅ Grid layouts |
| 141 | + |
| 142 | +### Dashboard |
| 143 | +✅ Metric cards with trends |
| 144 | +✅ Activity timeline |
| 145 | +✅ Sticky headers |
| 146 | +✅ Color-coded borders |
| 147 | +✅ Hover animations |
| 148 | + |
| 149 | +### Data Display |
| 150 | +✅ User profile cards |
| 151 | +✅ Status badges |
| 152 | +✅ Progress bars |
| 153 | +✅ Task lists |
| 154 | +✅ Achievement displays |
| 155 | + |
| 156 | +### Landing Page |
| 157 | +✅ Hero sections |
| 158 | +✅ Feature grids |
| 159 | +✅ Call-to-action |
| 160 | +✅ Statistics display |
| 161 | +✅ Full-page layouts |
| 162 | +✅ Footer sections |
| 163 | + |
| 164 | +### CLI Demo |
| 165 | +✅ Bilingual support (中文/English) |
| 166 | +✅ Emoji icons |
| 167 | +✅ Gradient backgrounds |
| 168 | +✅ Modern styling |
| 169 | + |
| 170 | +## 🛠️ Customization |
| 171 | + |
| 172 | +All examples are fully customizable! Edit the `app.json` files to: |
| 173 | + |
| 174 | +- Change colors and styling |
| 175 | +- Add or remove components |
| 176 | +- Modify layouts |
| 177 | +- Adjust content |
| 178 | +- Try different patterns |
| 179 | + |
| 180 | +Example: |
| 181 | + |
| 182 | +```json |
| 183 | +{ |
| 184 | + "type": "button", |
| 185 | + "label": "Click Me", |
| 186 | + "className": "bg-blue-500 hover:bg-blue-600" |
| 187 | +} |
| 188 | +``` |
| 189 | + |
| 190 | +## 📚 Documentation |
| 191 | + |
| 192 | +- [Protocol Overview](../docs/protocol/overview.md) |
| 193 | +- [Component Reference](../docs/api/components.md) |
| 194 | +- [CLI Guide](../docs/CLI_GUIDE.md) |
| 195 | +- [Quick Start](../docs/guide/quick-start.md) |
| 196 | + |
| 197 | +## 🔗 Related Resources |
| 198 | + |
| 199 | +- [Object UI Documentation](https://www.objectui.org) |
| 200 | +- [Tailwind CSS Docs](https://tailwindcss.com) |
| 201 | +- [Shadcn/UI Components](https://ui.shadcn.com) |
| 202 | +- [React Documentation](https://react.dev) |
| 203 | + |
| 204 | +## 💡 Tips |
| 205 | + |
| 206 | +1. **Start Simple**: Begin with the basic-form example |
| 207 | +2. **Experiment**: Modify the JSON and see changes in real-time |
| 208 | +3. **Learn Patterns**: Each example showcases different design patterns |
| 209 | +4. **Mix & Match**: Combine components from different examples |
| 210 | +5. **Read READMEs**: Each example has detailed documentation |
| 211 | + |
| 212 | +## 🤝 Contributing |
| 213 | + |
| 214 | +Want to add more examples? We'd love your contributions! |
| 215 | + |
| 216 | +1. Create a new directory under `examples/` |
| 217 | +2. Add your `app.json` schema |
| 218 | +3. Write a comprehensive `README.md` |
| 219 | +4. Submit a pull request |
| 220 | + |
| 221 | +See [CONTRIBUTING.md](../CONTRIBUTING.md) for guidelines. |
| 222 | + |
| 223 | +## ❓ Need Help? |
| 224 | + |
| 225 | +- [Open an Issue](https://github.com/objectql/objectui/issues) |
| 226 | +- [Join Discussions](https://github.com/objectql/objectui/discussions) |
| 227 | +- [Read the Docs](https://www.objectui.org) |
| 228 | + |
| 229 | +## 📝 License |
| 230 | + |
| 231 | +All examples are released under the [MIT License](../LICENSE). |
| 232 | + |
| 233 | +--- |
| 234 | + |
| 235 | +**Built with ❤️ using [Object UI](https://www.objectui.org)** |
| 236 | + |
| 237 | +Start building amazing UIs with JSON today! 🚀 |
0 commit comments