Custom front-end
Three ways to build your own UI on ObjectStack: a React page inside the Console, your own front-end over the Client SDK, or your own React app rendering metadata with the ObjectUI SDK
ObjectStack gives you three ways to build UI the Console does not draw for you. Pick by where the UI runs and who renders it.
| You want to… | Use | Where it runs |
|---|---|---|
| Add a custom page to an ObjectStack app | React pages: the page source is metadata | Inside the Console |
| Read and write ObjectStack data from your own front-end | Client SDK (@objectstack/client) | Your app, any framework |
| Render ObjectStack views, forms and dashboards in your own React app | The ObjectUI SDK, below | Your React app |
The first path is metadata like any other page, so it is documented with User Interface. The rest of this section is the ObjectUI SDK.
The ObjectUI SDK
The ObjectUI SDK is the set of MIT-licensed @object-ui/* packages that render ObjectStack
JSON schemas inside your own React app. JSON metadata goes in, and accessible, themeable
components built with Tailwind CSS, Shadcn UI and Radix primitives come out.
npm install @object-ui/react @object-ui/componentsThe ObjectStack Console is built from these same packages: it reads your stack's metadata from the server and renders it through the renderer and component registry described here. If the Console already does what you need, you author metadata and never touch the SDK.
A small schema
{
"type": "data-table",
"caption": "Users",
"className": "rounded-lg border",
"columns": [
{
"header": "Name",
"accessorKey": "name",
"sortable": true
},
{
"header": "Email",
"accessorKey": "email"
}
],
"data": [
{
"name": "Ada Lovelace",
"email": "ada@example.com"
},
{
"name": "Grace Hopper",
"email": "grace@example.com"
}
]
}That schema renders through SchemaRenderer once @object-ui/components has been imported for
its registration side effects.
What's in this module
Quick Start
Install the SDK and render a first schema
Building a CRUD App
An end-to-end app over an ObjectStack backend
Architecture Overview
The SDK's packages, data flow, state and actions
Schema Rendering
How SchemaRenderer turns JSON into React
Component Registry
How a type maps to a React component, and how to add your own
Renderer types
The SDK-only renderer types the component packages register
Field Registry
Field widgets and how custom components reuse them
Data Connectivity
The DataSource contract and its adapters
Layout System
AppShell, Page and SidebarNav for your app's shell
AppShell
The application shell component
SidebarNav
The sidebar navigation component
Theming
CSS variables, Tailwind, variants and dark mode
UI plugins
Lazy-loaded views: grid, kanban, calendar, charts and more
Plugin Development
Write and publish your own UI plugin
CLI
The objectui command line
Create Plugin
Scaffold a new UI plugin package
ObjectStack Adapter
Connect the SDK to an ObjectStack server
Troubleshooting
Fixes for common SDK problems