Here’s an example of a custom C# element with exposed custom attributes in the Builder’s Inspector:
Attributes are, because of a lack of a better API at this time, reflected by the Builder. In order to work properly, you need to have a C# Property “{ get; set; }” with a certain name that matches (is the camelCaseNoDashes conversion of) the corresponding UXML attribute name. Notice this in the example above. The UI Builder uses these C# Properties to read the current values of these UXML attributes (which are normally just used at instantiation time outside the UI Builder use case.
The UI Builder actually re-calls the Init() function every time you set a new value in the Builder’s Attributes inspector so make sure to set the C# Property there.