Documentation Index Fetch the complete documentation index at: https://docs.metabind.ai/llms.txt
Use this file to discover all available pages before exploring further.
Components
Components are the fundamental building blocks of Metabind, defining reusable elements that can be used to create and render content across multiple platforms. Components can be view components that define reusable UI elements or layout components that define the structure for entire content types.
Component Types
View Components Standard UI components for displaying content. Examples: ProductCard, ArticleParagraph, HeroImage
Layout Components Define structure for entire content types. Examples: ArticleLayout, ProductPageLayout
Key Concepts
Concept Description Collections Organizational groups for components in the CMS UI Status Management Components maintain draft and published status Version Control Versions are created when components are included in packages Asset Binding Components can have bound assets included in packages Schema Generation JSON Schema auto-generated from properties() function
Component Object
Fields
Field Type Description idstring Unique identifier (UUID) namestring Display name (unique within project) titlestring Display title extracted from metadata() function descriptionstring Markdown description from metadata() function collectionIdstring Parent collection ID (null for root collection) versionnumber Version number (set when published in a package) lastPublishedVersionnumber Last published version (null if never published) typestring Component type (view or layout) statusstring Status (draft, modified, published, or deleted) contentstring Component source code (TypeScript) compiledstring Auto-generated JavaScript (read-only) schemaobject JSON Schema from properties() function metadataobject Additional metadata metadata.authorstring Creator of the component metadata.tagsstring[] Component tags metadata.packageVersionsstring[] Package versions containing this component createdAtstring Creation timestamp (ISO format) updatedAtstring Last update timestamp (ISO format)
Example View Component
{
"id" : "c123" ,
"name" : "ProductCard" ,
"title" : "Product Card" ,
"description" : "Product display card with image, title, and pricing." ,
"collectionId" : "coll123" ,
"version" : null ,
"lastPublishedVersion" : null ,
"type" : "view" ,
"status" : "draft" ,
"content" : "const metadata = () => ({ title: 'Product Card' }); \n const properties = () => ({ title: PropertyString({...}) }); \n const body = (props: ComponentProps) => { return VStack([...]) };" ,
"compiled" : "const metadata = () => ({ title: 'Product Card' }); \n const properties = () => ({ title: PropertyString({...}) }); \n const body = (props) => { return VStack([...]) };" ,
"schema" : {
"type" : "object" ,
"properties" : {
"title" : { "type" : "string" , "description" : "Product name" },
"price" : { "type" : "number" , "minimum" : 0 }
},
"required" : [ "title" , "price" ]
},
"metadata" : {
"author" : "jane.doe@metabind.ai" ,
"tags" : [ "product" , "card" ]
},
"createdAt" : "2024-03-20T10:00:00Z" ,
"updatedAt" : "2024-03-20T10:00:00Z"
}
Example Layout Component
{
"id" : "c124" ,
"name" : "ArticleLayout" ,
"title" : "Article Layout" ,
"description" : "Standard article layout with header, body, and metadata." ,
"collectionId" : "coll123" ,
"version" : 2 ,
"lastPublishedVersion" : 2 ,
"type" : "layout" ,
"status" : "published" ,
"content" : "const body = (props: ComponentProps, children: Component[]) => { return VStack([Header(props), ...children]) };" ,
"schema" : {
"type" : "object" ,
"properties" : {
"heroImage" : { "type" : "string" , "format" : "uri" },
"author" : { "type" : "string" }
}
},
"metadata" : {
"author" : "jane.doe@metabind.ai" ,
"tags" : [ "layout" , "article" ],
"packageVersions" : [ "1.0.0" , "1.1.0" , "2.0.0" ]
},
"createdAt" : "2024-03-20T10:00:00Z" ,
"updatedAt" : "2024-03-20T10:00:00Z"
}
TypeScript and Compilation
When a component is saved, the TypeScript code in the content field is automatically compiled to JavaScript and stored in the compiled field.
// TypeScript source (content field)
const body = ( props : ComponentProps , children : Component []) => {
return VStack ({ spacing: 12 }, [
Text ( props . title ). font ( 'headline' ),
props . description ? Text ( props . description ) : null
]);
};
// Compiled JavaScript (compiled field - read-only)
const body = ( props , children ) => {
return VStack ({ spacing: 12 }, [
Text ( props . title ). font ( 'headline' ),
props . description ? Text ( props . description ) : null
]);
};
Schema Generation
Components with a properties() function automatically have their schema extracted:
// Component properties definition
const properties = () => ({
title: PropertyString ({
title: 'Title' ,
description: 'Main heading text' ,
validation: { required: true , maxLength: 100 }
}),
price: PropertyNumber ({
title: 'Price' ,
validation: { min: 0 , max: 10000 }
})
});
// Generated schema (stored in component.schema)
{
"type" : "object" ,
"properties" : {
"title" : {
"type" : "string" ,
"description" : "Main heading text" ,
"maxLength" : 100
},
"price" : {
"type" : "number" ,
"minimum" : 0 ,
"maximum" : 10000
}
},
"required" : [ "title" ]
}
Base URL
All component endpoints use this base path:
/app/v1/organizations/:organizationId/projects/:projectId/components