API Reference

defineBlock()

The core function for registering a Lyrix block.


Signature

defineBlock accepts a config object and returns a typed block definition.

ts
function defineBlock<T extends Schema>(config: {
  name: string;
  schema: T;
  render: (props: InferSchema<T>) => React.ReactNode;
}): BlockDefinition<T>