HTML + CSS -> Vaadin Component

I’ve HTML + CSS here It is creating a nice toggle button. I want to create a web component. Should I just mimic the HTML code into Vaadin ( I mean using same HTML tags ) or is there any other way to accomplish this ?

There are 2 primary ways to create a custom component:

  1. Implement your own component Java class using the corresponding HTML elments etc via Flow’s APIs, see docs here:
  2. Implement it as a Web Component and build a Flow API for it: