Last update:
March 22, 2024
Overview¶
In this article, we will explore how to register any custom component in the Builder.io CMS. The registration of custom components allows you to use any UI components like Slider
in the Builder.io CMS when creating content.
Register Custom Components¶
To register a custom component in the Builder.io CMS:
- Create a reference for the custom component you want to register. The wrapper component should be a .ts file. It describes the inputs—or the props—that should be editable in the Visual Editor.
- Register the reference using the
useBuilder
composable which we created here. This will make the custom component available for use in the Builder.io CMS. - Provide a list of components to the
RenderContent
component. This allows you to use the custom components in the Builder.io CMS.
Example. Slider Component Registration¶
In this example, we will show how to register a Slider
component in the Builder.io CMS:
-
Create a reference for the
Slider
component:@/shared/builder-io/components/custom/slider.ts -
Register the
slider
component with theuseBuilder
composable: -
Provide this list of components to the
RenderContent
component:
The Slider component is now registered and available for use in the Builder.io CMS. You can now use the Slider component when creating content in the Builder.io CMS: