Skip to main content

Component System — AI Agent Reference

v1.0.0 | 2026-04-13

Everything an AI agent needs to create, publish, and use SpiderIQ components across all 4 interactivity tiers. This document is self-contained — no other docs needed.

Full guides: Component Builder Guide | Tiers Reference


Discovery

# Full content reference (YAML, ~2,867 tokens)
GET /api/v1/content/help

# Available CDN libraries for Tier 3
GET /api/v1/content/cdn-allowlist

# Published components (your client + global)
GET /api/v1/content/components

Lifecycle

create (POST) → edit (PATCH) → publish (POST) → use in page block → new version (POST, same slug, bumped version)

Status flow: draftpublishedarchived


Field Reference

FieldTypeRequiredTierDescription
slugstringYesAllURL-safe identifier (kebab-case)
namestringYesAllDisplay name
versionstringNoAllSemver (default "1.0.0")
categoryenumNoAllhero, cta, faq, pricing, features, testimonials, contact_form, footer, header, gallery, stats, custom
descriptionstringNoAllShort description
html_templatestringYes (T1-3)1-3Liquid HTML template. Access props via {{ props.field }}
cssstringNo1-3Component CSS (scoped via Shadow DOM)
jsstringNo2-3Vanilla JS. Receives root (shadowRoot) and props args
dependenciesstring[]No3CDN allowlist keys (e.g., ["gsap", "chartjs"])
frameworkstringYes (T4)4"react", "vue", or "svelte"
source_codestringYes (T4)4Framework source (JSX, Vue SFC, or Svelte)
props_schemaobjectNoAllJSON Schema for prop validation
default_propsobjectNoAllDefault prop values (overridden by block props)
thumbnail_urlstringNoAllPreview image URL
tagsstring[]NoAllDiscovery tags
is_globalbooleanNoAllVisible to all clients (default false)
bundle_urlstringRead-only4R2 CDN URL of built bundle
build_statusstringRead-only4none, building, success, failed
build_errorstringRead-only4Error message on build failure

Tier Selection

No JS needed?                          → Tier 1 (html_template + css)
Vanilla JS is enough? → Tier 2 (add js field)
Need GSAP / Chart.js / Swiper / etc? → Tier 3 (add dependencies array)
Need React / Vue / Svelte? → Tier 4 (add framework + source_code)

CDN Allowlist (Tier 3)

KeyNameCategory
gsapGSAP Coreanimation
gsap/ScrollTriggerGSAP ScrollTriggeranimation
gsap/FlipGSAP Flipanimation
animejsanime.jsanimation
alpinejsAlpine.jsframework
chartjsChart.jsvisualization
lottieLottie Webanimation
swiperSwipercarousel
countupCountUp.jsanimation
threeThree.js3d

Current list: GET /api/v1/content/cdn-allowlist


Props Schema Patterns

String:

{ "headline": { "type": "string", "title": "Headline" } }

Number with range:

{ "columns": { "type": "integer", "minimum": 1, "maximum": 6, "default": 3 } }

Enum:

{ "style": { "type": "string", "enum": ["centered", "left", "split"] } }

Array of strings:

{ "features": { "type": "array", "items": { "type": "string" } } }

Array of objects (repeater):

{
"items": {
"type": "array",
"items": {
"type": "object",
"properties": {
"title": { "type": "string" },
"description": { "type": "string" }
},
"required": ["title"]
}
}
}

Example: Tier 1 Hero Component

Create

curl -X POST "https://spideriq.ai/api/v1/dashboard/content/components" \
-H "Authorization: Bearer $CLIENT_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"slug": "hero-simple",
"name": "Simple Hero",
"category": "hero",
"html_template": "<section class=\"hero\"><h1>{{ props.headline }}</h1><p>{{ props.subheadline }}</p><a href=\"{{ props.cta_url }}\" class=\"btn\">{{ props.cta_text }}</a></section>",
"css": ":host { display: block; } .hero { padding: 5rem 2rem; text-align: center; background: linear-gradient(135deg, var(--primary), #111); color: white; } h1 { font-size: 3rem; margin: 0 0 1rem; } p { opacity: 0.85; margin: 0 0 2rem; } .btn { display: inline-block; padding: 0.75rem 2rem; background: white; color: var(--primary); border-radius: 0.5rem; text-decoration: none; font-weight: 600; }",
"props_schema": {
"type": "object",
"properties": {
"headline": { "type": "string" },
"subheadline": { "type": "string" },
"cta_text": { "type": "string" },
"cta_url": { "type": "string" }
},
"required": ["headline"]
},
"default_props": { "cta_text": "Get Started", "cta_url": "/signup" }
}'

Response: { "id": "abc123...", "slug": "hero-simple", "status": "draft", ... }

Publish

curl -X POST "https://spideriq.ai/api/v1/dashboard/content/components/abc123/publish" \
-H "Authorization: Bearer $CLIENT_TOKEN"

Use in Page

curl -X POST "https://spideriq.ai/api/v1/dashboard/content/pages" \
-H "Authorization: Bearer $CLIENT_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"title": "Home",
"slug": "home",
"blocks": [
{
"id": "hero-1",
"type": "component",
"component_slug": "hero-simple",
"props": { "headline": "Welcome to Acme", "subheadline": "AI-powered everything." }
}
]
}'

Example: Tier 3 Animated Stats

curl -X POST "https://spideriq.ai/api/v1/dashboard/content/components" \
-H "Authorization: Bearer $CLIENT_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"slug": "stats-animated",
"name": "Animated Stats",
"category": "stats",
"dependencies": ["gsap", "gsap/ScrollTrigger"],
"html_template": "<section class=\"stats\">{% for s in props.stats %}<div class=\"stat\"><span class=\"val\" data-target=\"{{ s.value }}\">0</span><span class=\"lbl\">{{ s.label }}</span></div>{% endfor %}</section>",
"css": ".stats { display: flex; gap: 3rem; justify-content: center; padding: 4rem 2rem; } .val { font-size: 3rem; font-weight: 700; color: var(--primary); display: block; } .lbl { font-size: 0.875rem; opacity: 0.7; text-transform: uppercase; }",
"js": "gsap.registerPlugin(ScrollTrigger); root.querySelectorAll('.val').forEach(el => { gsap.fromTo(el, { textContent: 0 }, { textContent: parseInt(el.dataset.target), duration: 2, ease: 'power2.out', snap: { textContent: 1 }, scrollTrigger: { trigger: el, start: 'top 80%' } }); });",
"props_schema": {
"type": "object",
"properties": {
"stats": {
"type": "array",
"items": {
"type": "object",
"properties": {
"value": { "type": "integer" },
"label": { "type": "string" }
}
}
}
},
"required": ["stats"]
}
}'

API Reference

Dashboard (requires auth)

MethodEndpointNotes
POST/dashboard/content/componentsCreate component
GET/dashboard/content/componentsList all (any status)
GET/dashboard/content/components/{id}Get by ID
GET/dashboard/content/components/by-slug/{slug}?version=Get by slug (optional version)
PATCH/dashboard/content/components/{id}Update draft component
DELETE/dashboard/content/components/{id}Delete component
POST/dashboard/content/components/{id}/publishPublish (202 for Tier 4)
POST/dashboard/content/components/{id}/archiveArchive component
GET/dashboard/content/components/{id}/build-statusTier 4 build status
POST/dashboard/content/components/{id}/rebuildTier 4 re-build (202)
GET/dashboard/content/components/{slug}/versionsList all versions

Public (no auth)

MethodEndpointNotes
GET/content/componentsList published + global
GET/content/components/{slug}?version=Get published by slug
GET/content/cdn-allowlistList available CDN libraries

All endpoints are prefixed with /api/v1.


MCP Tools

ToolDescription
content_create_componentCreate a new component (any tier)
content_update_componentUpdate an existing component
content_publish_componentPublish a component
content_archive_componentArchive a component
content_list_componentsList components
content_get_componentGet component by ID or slug
content_list_cdn_allowlistList available CDN libraries
content_get_build_statusCheck Tier 4 build status
content_rebuild_componentRe-trigger Tier 4 build

Common Mistakes

  1. Using document.querySelector() — Use root.querySelector(). Your JS runs inside the shadow root; document refers to the parent page.

  2. Forgetting to publish — Only published components render on live pages. Draft components are invisible.

  3. Using Tailwind classes — Tailwind CSS from the parent page does not penetrate Shadow DOM. Write plain CSS inside the css field.

  4. Referencing unknown CDN keys — Dependency keys must exist in the CDN allowlist. Check GET /content/cdn-allowlist first.

  5. Not polling build-status for Tier 4publish returns 202 (async). The component won't render until build_status: "success".

  6. Setting framework without source_code — Both are required for Tier 4. Setting only framework creates an unbuildable component.

  7. Using external stylesheets or @import — Shadow DOM blocks external CSS. All styles must be inline in the css field.

  8. Not setting props_schema — Without a schema, props won't be validated. The component still works, but agents and the dashboard can't generate input forms.


Shadow DOM Rules

  • CSS is fully scoped — Component CSS cannot leak to the page or other components. Page CSS cannot affect component internals.
  • Use root.querySelector() — Never document.querySelector(). The root parameter is the ShadowRoot element.
  • var(--primary) works — CSS custom properties pierce Shadow DOM by design. Your site's primary_color is available as var(--primary).
  • No Tailwind, no @import, no external stylesheets — Write all CSS in the css field. It's scoped and isolated.
  • Each instance gets its own shadow root — Two instances of the same component on one page are fully independent.