Skip to main content
config
object
required
The component configuration object.

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

With properties

With metadata and previews

With children

With thumbnail

Notes

  • 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 assigned to exports.default to be recognized by the BindJS runtime.
  • Properties can also be defined as a factory function () => Record<string, PropertyField> for dynamic schema generation.

See Also