What is the role of 'withBuilder()' function

What is the role of ‘withBuilder()’ function?
like what does this below code do?:

const Button = withBuilder(ButtonComponent, {
name: ‘Core:Button’,
image:
https://cdn.builder.io/api/v1/image/assets%2FIsxPKMo2gPRRKeakUztj1D6uqed2%2F81a15681c3e74df09677dfc57a615b13’,
defaultStyles: {

Hello @soumya,

The withBuilder function is a Higher-Order Component (HOC) that registers your custom component with Builder.io by applying a BuilderBlock decorator. This process involves attaching meta-information from the options parameter to the component, enabling it to be managed and used within Builder.io’s Visual Editor.

To know more you can refer to the below links

  1. builder/packages/react/src/functions/with-builder.ts at main · BuilderIO/builder · GitHub
  2. Custom Components Setup

Thanks,