Import & Export
Component libraries use the .cjl (Caja Component Library) format — a JSON file containing one or more reusable components.
Exporting
- Open the Assets tab in the Left Panel
- Click the
+menu → Export Components - Select which components to include
- Save as a
.cjlfile
Importing
- Open the Assets tab in the Left Panel
- Click the
+menu → Import Components - Select a
.cjlfile - Components are added to your project's catalog
The .cjl Format
json
{
"name": "My Library",
"version": "1.0.0",
"components": [
{
"id": "comp_1",
"name": "Card",
"tags": ["layout"],
"frame": { ... }
}
]
}Each component stores its full frame tree, so instances are self-contained.
Via MCP
Agents can work with components programmatically:
json
// List available components
{ "tool": "list_components" }
// Save a frame as a component
{
"tool": "save_component",
"params": { "frame_id": "abc", "name": "Card", "tags": ["layout"] }
}
// Insert an instance with overrides
{
"tool": "insert_component",
"params": {
"component_id": "comp_card",
"parent_id": "root",
"overrides": {
"title": { "properties": { "content": "Custom Title" } }
}
}
}
// Export library as .cjl file
{
"tool": "export_library",
"params": { "name": "My Library", "version": "1.0.0" }
}Community Libraries
Anyone can create and share .cjl files. To submit a community library, open a PR on the Caja repo.
