Create a custom button, but what method to use? (V7+)

hello,

I am struggling with the correct method to extend a vaadin button. What I like to create is a Button that can have 3 colored states and 2 sub-states per color that tells me if a button is selected or not. Ideally I want to give it a object specific to the application and the button does the rest, O… and it needs to have a click handler!

I tried the method as shown here : https://vaadin.com/blog/-/blogs/2656782 But for one odd reason or a other, but button was not rendered and just showed : com.package.MyButton@123233
I also tried ‘Create Widget’ as shown in Idea and Eclipse, but when I extend from Button instead of a Label (the default) I don’t get a Vaadin button but a native button, I think this comes from GWT but how do I get it into a Vaadin button?

I try to avoid CustomComponent because I need to render many of them into a Table, and I am not sure if a CustomComponent is fast enough (read overhead because it wraps).

So, what method should I persue to make such a custom component?
Can I simply not extend Button (the vaadin version) and do what I need to do, or is there more to it?

I solved this creating a custom widget.
It was just how the default ‘Label’ was implemented I really didn’t see the light on how to do this with other components.