Vaadin Platform (vaadin-core) - Core component of the Vaadin web framework platform
npx @tessl/cli install tessl/maven-com-vaadin--vaadin-core@24.9.0Vaadin Core is a comprehensive Java web framework platform that enables developers to build modern, full-stack web applications entirely in Java without writing HTML, CSS, or JavaScript directly. It provides a rich set of UI components (40+ components including buttons, grids, forms, charts, and layouts), themes (Lumo and Material), data binding capabilities, server-side rendering with Flow, client-side support with Lit templates and React integration, and push notification capabilities for real-time updates.
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-core</artifactId>
<version>24.9.4</version>
</dependency>Vaadin has first-class Spring Boot support. Add the Spring Boot starter:
<dependency>
<groupId>com.vaadin</groupId>
<artifactId>vaadin-spring-boot-starter</artifactId>
</dependency>Note: For Vaadin 24.9.4, it is recommended to use Spring Boot 3.3.0 or higher to avoid dependency conflicts with Jackson libraries. Earlier versions of Spring Boot (e.g., 3.2.x) may encounter version conflicts during the Maven build process.
Then use Spring annotations in views:
@Route("dashboard")
@SpringComponent
@UIScope
public class DashboardView extends VerticalLayout {
@Autowired
public DashboardView(UserService userService) {
// Service injection
}
}Vaadin uses package-based imports. The main packages developers interact with:
// Component base classes
import com.vaadin.flow.component.*;
import com.vaadin.flow.component.orderedlayout.*;
import com.vaadin.flow.component.html.*;
// Routing
import com.vaadin.flow.router.*;
// Common components
import com.vaadin.flow.component.button.*;
import com.vaadin.flow.component.textfield.*;
import com.vaadin.flow.component.grid.*;
import com.vaadin.flow.component.dialog.*;
import com.vaadin.flow.component.notification.*;
// Data binding
import com.vaadin.flow.data.binder.*;
import com.vaadin.flow.data.provider.*;import com.vaadin.flow.component.button.Button;
import com.vaadin.flow.component.notification.Notification;
import com.vaadin.flow.component.orderedlayout.VerticalLayout;
import com.vaadin.flow.component.textfield.TextField;
import com.vaadin.flow.router.Route;
@Route("")
public class HelloWorldView extends VerticalLayout {
public HelloWorldView() {
TextField nameField = new TextField("Your name");
Button greetButton = new Button("Say hello", event -> {
String name = nameField.getValue();
Notification.show("Hello, " + name + "!");
});
add(nameField, greetButton);
}
}Vaadin Core is built around several key architectural layers:
Component base class@Route annotations for navigationBinder class provides two-way data binding between UI components and Java beans| Component | Description | Location |
|---|---|---|
Button | Clickable button with text/icon | Components |
TextField | Single-line text input | Components |
TextArea | Multi-line text input | Components |
PasswordField | Password input with reveal | Components |
EmailField | Email-validated input | Components |
NumberField | Numeric input (double) | Components |
IntegerField | Numeric input (integer) | Components |
Checkbox | Single checkbox | Components |
CheckboxGroup | Multiple checkboxes | Components |
RadioButtonGroup | Radio button group | Components |
ComboBox | Dropdown with search | Components |
MultiSelectComboBox | Multi-select dropdown | Components |
Select | Simple dropdown | Components |
DatePicker | Date selection | Components |
TimePicker | Time selection | Components |
DateTimePicker | Date and time selection | Components |
Upload | File upload component | Components |
| Component | Description | Location |
|---|---|---|
Grid | Data grid/table | Components |
ProgressBar | Progress indicator | Components |
Avatar | User avatar | Components |
Icon | Icon component | Components |
| Component | Description | Location |
|---|---|---|
Tabs | Tab navigation | Components |
Tab | Individual tab | Components |
TabSheet | Tabbed content | Components |
MenuBar | Menu bar | Components |
SideNav | Side navigation | Components |
SideNavItem | Side nav item | Components |
| Component | Description | Location |
|---|---|---|
Dialog | Modal dialog | Components |
ConfirmDialog | Confirmation dialog | Components |
Notification | Toast notification | Components |
| Component | Description | Location |
|---|---|---|
VerticalLayout | Vertical arrangement | Layouts |
HorizontalLayout | Horizontal arrangement | Layouts |
AppLayout | Application layout | Layouts |
FormLayout | Responsive form layout | Layouts |
SplitLayout | Resizable split panel | Layouts |
Accordion | Collapsible panels | Layouts |
AccordionPanel | Accordion panel | Layouts |
Details | Expandable details | Layouts |
Card | Card container | Layouts |
Scroller | Scrollable container | Layouts |
FlexLayout | Flexbox layout | Layouts |
| Component | Description | Location |
|---|---|---|
Div | Div container | Components |
Span | Span element | Components |
H1, H2, H3, H4, H5, H6 | Headings | Components |
Paragraph | Paragraph text | Components |
Anchor | Link/anchor | Components |
Image | Image element | Components |
| Class/Interface | Description | Location |
|---|---|---|
Binder | Two-way data binding | Data Integration |
DataProvider | Data provider interface | Data Integration |
ListDataProvider | List-based provider | Data Integration |
HierarchicalDataProvider | Tree data provider | Data Integration |
ValueProvider | Value extraction | Data Integration |
ItemLabelGenerator | Label generation | Data Integration |
| Component | Description | Location |
|---|---|---|
CollaborationEngine | Real-time collaboration | Advanced |
CollaborationAvatarGroup | Collaborative avatars | Advanced |
CollaborationBinder | Collaborative form | Advanced |
MessageList | Chat message list | Advanced |
MessageInput | Chat input | Advanced |
| Class/Annotation | Description | Location |
|---|---|---|
@Route | Route annotation | Core Framework |
@PageTitle | Page title | Core Framework |
RouterLink | Navigation link | Core Framework |
Component | Base component class | Core Framework |
UI | Main UI class | Core Framework |
Binder | Data binder | Data Integration |
@Route("products")
@PageTitle("Products")
public class ProductsView extends VerticalLayout {
public ProductsView() {
add(new H1("Products"));
// View content
}
}Binder<Person> binder = new Binder<>(Person.class);
TextField firstName = new TextField("First Name");
TextField lastName = new TextField("Last Name");
EmailField email = new EmailField("Email");
binder.forField(firstName)
.asRequired("First name is required")
.bind(Person::getFirstName, Person::setFirstName);
binder.forField(lastName)
.bind(Person::getLastName, Person::setLastName);
binder.forField(email)
.bind(Person::getEmail, Person::setEmail);
binder.setBean(person);Grid<Customer> grid = new Grid<>(Customer.class);
grid.setColumns("name", "email", "status");
grid.setDataProvider(DataProvider.fromCallbacks(
query -> customerService.fetch(query.getOffset(), query.getLimit()).stream(),
query -> customerService.count()
));Button button = new Button("Save", event -> {
// Handle click event
Notification.show("Saved!");
});
textField.addValueChangeListener(event -> {
String oldValue = event.getOldValue();
String newValue = event.getValue();
// Handle value change
});