What is the Catalog and how does it work?
mainThe Catalog is the central registry for Composify. Both the editor and the renderer depend on it. Every component must be registered in the Catalog before it can be used in the editor or rendered correctly.
Through the Catalog, you define:
- Component availability in the editor
- Prop specifications (what props are accepted)
- Editor UI for props (how they are edited)
- Metadata like categories and default values.
Note on Unregistered Components: If you attempt to render a component that has not been registered via Catalog.register, Composify treats it as a React Fragment. The component will not render, and its props will be ignored, but the application will not crash.
import { Catalog } from 'composify';
// Components must be registered here to be usable
Catalog.register('ComponentName', {
component: MyComponent,
props: { ... },
});