Crud UI Add-on | Vaadin

Generate CRUD UIs for your entities/beans/POJOs at runtime

Crud UI Add-on provides an API to automatically generate CRUD-like UIs for any Java Bean at runtime.

The API is defined through 4 interfaces:

CrudComponent: A Vaadin Component that can be added to any ComponentContainer. This is the actual CRUD final users will see in the browser.

CrudListener: Encapsulates the CRUD operations. You can implement this interface to delegate CRUD operations to your back-end.

CrudLayout: Encapsulates layout-related behavior.

CrudFormFactory: Builds the forms required by the CRUD UI.

The add-on includes several implementations of these interfaces.

Basic usage

Say, you have the following domain/entity/Java Bean class:

public class User {

    @NotNull // Validation API is required! Add it as a dependency on your project
    private Long id;

    private String name;

    private Date birthDate;

    private String email;

    private String password;

    ... getters & setters ...


You can create a new CRUD component and add it into any Vaadin layout as follows:

GridCrud<User> crud = new GridCrud<>(User.class);


You can enable Java Bean Validation as follows:



Use lambda expressions or method references to delegate CRUD operations to your backend:

crud.setFindAllOperation(() -> backend.findAll());


Advanced usage

As an alternative to method references and lambda expressions, you can implement a CrudListener to delegate CRUD operations to your backend:

crud.setCrudListener(new CrudListener<User>() {
    public Collection<User> findAll() {
        return backend.findAllUsers();
    public User add(User user) {
        return backend.add(user);

    public User update(User user) {
        return backend.update(user);

    public void delete(User user) {


Use a different CrudLayout implementation:

GridCrud<User> crud = new GridCrud<>(User.class, new HorizontalSplitCrudLayout());


Set a custom CrudFormFactory:

CustomCrudFormFactory<User> formFactory = new CustomCrudFormFactory<>(User.class);


Configure form fields visibility:

formFactory.setVisibleProperties(CrudOperation.READ, "name", "birthDate", "email", "groups", "mainGroup", "active");
formFactory.setVisibleProperties(CrudOperation.ADD, "name", "birthDate", "email", "password", "groups", "mainGroup", "active");
formFactory.setVisibleProperties(CrudOperation.UPDATE, "name", "birthDate", "email", "groups", "mainGroup", "active");
formFactory.setVisibleProperties(CrudOperation.DELETE, "name", "email");


Use nested properties in GridCrud instances:

crud.getGrid().addColumn(user -> user.getMainGroup().getName()).setHeader("Main group").setKey("key");


Configure the type of an input field:

formFactory.setFieldType("password", PasswordField.class);


Customize fields after their creation:

formFactory.setFieldCreationListener("birthDate", field -> ... your own logic here ...);


Define a FieldProvider to manually create a field:

formFactory.setFieldProvider("groups", user -> {
    CheckboxGroup<Group> checkboxes = new CheckboxGroup<>();
    return checkboxes;


Or use one of the included FieldProvider implementations:

        new CheckBoxGroupProvider<>("Groups", GroupRepository.findAll(), Group::getName));


Set a Converter:

formFactory.setConverter("salary", new Converter<String, BigDecimal>() {
    public Result<BigDecimal> convertToModel(String value, ValueContext valueContext) {
        return Result.ok(new BigDecimal(value)); // error handling omitted

    public String convertToPresentation(BigDecimal value, ValueContext valueContext) {
        return value.toPlainString();

Customize captions:

formFactory.setButtonCaption(CrudOperation.ADD, "Add new user");
crud.setRowCountCaption("%d user(s) found");



Link to this version
StableReleased 02 August 2022Apache License 2.0
Framework Support
Vaadin platform 23+
Also supported:
Vaadin 7 (1.6.0)Vaadin 8 (2.3.1)
Browser Independent
Install with
Release notes - Version 6.2.0

Requires Java 11 and Vaadin 23.1.3. Fixes base FieldProvider generics

Thanks to Boniface Chacha for the contributions.