You can pass custom data attributes or any custom element attribute to any layer in Builder.io through the custom element attributes section in the styles tab:
Find the custom element attributes section toward the bottom
Press + New and type in the desired custom attribute, create an option if you don’t see it in the list
Give it the desired value
Now you’ll see the custom attribute on the corresponding div:
You can also pass an attribute that is set dynamically. For example, maybe you have a dynamic list of items and want to apply an id to those elements based off another property. To do this, go to the data tab and create a new binding with whatever attribute you are trying to set: