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, HeroImageLayout Components
Define structure for entire content types. Examples:
ArticleLayout, ProductPageLayoutKey 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 |
|---|---|---|
id | string | Unique identifier (UUID) |
name | string | Display name (unique within project) |
title | string | Display title extracted from metadata() function |
description | string | Markdown description from metadata() function |
collectionId | string | Parent collection ID (null for root collection) |
version | number | Version number (set when published in a package) |
lastPublishedVersion | number | Last published version (null if never published) |
type | string | Component type (view or layout) |
status | string | Status (draft, modified, published, or deleted) |
content | string | Component source code (TypeScript) |
compiled | string | Auto-generated JavaScript (read-only) |
schema | object | JSON Schema from properties() function |
metadata | object | Additional metadata |
metadata.author | string | Creator of the component |
metadata.tags | string[] | Component tags |
metadata.packageVersions | string[] | Package versions containing this component |
createdAt | string | Creation timestamp (ISO format) |
updatedAt | string | Last update timestamp (ISO format) |
Example View Component
Example Layout Component
TypeScript and Compilation
When a component is saved, the TypeScript code in thecontent field is automatically compiled to JavaScript and stored in the compiled field.
Schema Generation
Components with aproperties() function automatically have their schema extracted:
