Dom elements set attribute

Hello guys. Is there any chance to add an attribute to the elements ? I am using vaadin 8.7.2 latest. Any idea ?

There’s an add-on for that purpose: https://vaadin.com/directory/component/htmlattributehandler

It’s marked for Vaadin 7, but works for 8 as well as-is.

Usage example:

        Label label = new Label("Vaddin");
        ComponentAttributeHandler cah = new ComponentAttributeHandler();
        cah.setComponent(label);
        cah.setAttribute("foo", "bar");

Thanks.