Skip to main content
POST
Create Component

Request Body

name
string
required
Component name (unique within project)
type
string
required
Component type: view or layout
content
string
required
Component source code (TypeScript)
collectionId
string
Parent collection ID (null for root collection)
metadata
object

Example Request

The title and description fields are automatically extracted from the component’s metadata() function. The TypeScript code in content is automatically compiled to JavaScript and stored in the read-only compiled field.

Response

Returns the created Component object with status draft.

Error Responses

Validation Failed

Code Examples