The render function that returns the component’s UI tree. Receives resolved props as the first argument and an array of child components as the second.
Metadata
Display metadata for Metabind Studio and component galleries.
Show Metadata fields
string
Display name shown in Metabind Studio and component galleries.
string
Brief description of the component’s purpose.
string
Grouping category for organizing components (e.g. “Layout”, “Controls”).
boolean
Whether the component is publicly visible in the catalog.
Record<string, PropertyField>
Property schema defining the component’s configurable inputs. Each key becomes a prop name, and the value is a property field constructor (PropertyString, PropertyNumber, PropertyBoolean, PropertyEnum, PropertyArray, PropertyDate, PropertyComponent, PropertyAsset, PropertyContent, PropertyGroup).
Component[] | (() => Component[])
Preview instances shown in galleries and documentation. Each preview is typically a Self() call with sample props. Use the .previewName() modifier to label individual previews.
string | Component
A thumbnail for the component. Can be an SVG string or a component that renders a visual preview.
Returns
A ComponentCallable that serves as both the component’s default export and a callable function. When called with props, it creates an instance of the component. The returned value also carries the metadata, properties, thumbnail, and previews for the Composer to read.
Usage
Minimal component
const body = () => Text("Hello, World!")export default defineComponent({ metadata: { title: "Hello World" }, body })
The body function is called on every re-render. Avoid expensive computations inside it, or use hooks like useState to cache values.
Self() is available inside body and in previews to create instances of the component being defined. Props passed to Self() are typed based on the properties schema.
The component must be the module’s default export (export default defineComponent({ ... })).
Properties can also be defined as a factory function () => Record<string, PropertyField> for dynamic schema generation.