Core package API
Import: @mauriciodmo/framekit
Environment: shared; the exported core helpers do not require a browser, and Markdown can render in server or client React code.
The root entrypoint owns the template contract: definition builders, field builders, validation, variant and default-value helpers, data resolution, and the Markdown component.
Main exports
Section titled “Main exports”defineTemplateanddefineTemplateBasedefine the canonical template shape.fieldprovidestext,color,number,image,choice, andbooleanfield builders.validateTemplateBase,validateTemplateDefinition, andvalidateTemplateDatavalidate definitions and resolved values.resolveTemplateData,getVariants, andgetDefaultValuesprovide data and variant helpers.Markdownrenders the supported lightweight markdown subset.- Public types include
TemplateDefinition,TemplateBase,TemplateRegistryEntry,TemplateRenderProps,InferTemplateData, field descriptors, asset manifests, variants, and validation errors.
Minimal example
Section titled “Minimal example”import { defineTemplate, field } from '@mauriciodmo/framekit'
export default defineTemplate({ meta: { title: 'Square promotion' }, width: 1200, height: 630, fields: { title: field.text({ label: 'Title' }) }, variants: { default: 'en' }, content: { en: { title: 'Hello' } }, render ({ data, width, height }) { return <article style={{ width, height }}>{data.title}</article> }})Bundle and runtime constraints
Section titled “Bundle and runtime constraints”Use this entrypoint for template source and shared helpers. It is not a replacement for the client, Studio, Next.js, or server entrypoints. The Markdown component supports inline formatting and optional simple lists; it is not a full CommonMark renderer.
See the template reference, create a template, and package API index.