Let's explore how to implement a login form component. The first idea that comes to mind when starting to develop a UI component is to extend, in the Java sense, an existing component. Most of the time, the natural choice is to extend a layout component such as VerticalLayout or HorizontalLayout. For example, a login form usually includes at least a username field, a password field, a login button, and a remember me checkbox, with all of them aligned vertically. So, let's start by directly extending VerticalLayout.
Using extensions to develop a UI component
Extending VerticalLayout
The following snippet of code shows a typical way of extending VerticalLayout to implement a UI component, in this case, the login form...