Step 1. The Implementation

All you need to do is to prepare a ZUML page that describes what the component consists of. In other words, the page is a template of the macro.

For example, assume we want to pack a label and a text box as a macro component. Then we could create page, say /WEB-INF/macros/username.zul, as follows.

<hbox>
    Username: <textbox/>    
</hbox>

It is done!

The ZUML page implementing a macro component is the same as any other pages, so any ZUML page can be used as a macro component.