> Markdown version of [Using a custom legacy UI class](https://vaadin.com/docs/v23/tools/mpr/configuration/custom-ui). Section index: [llms.txt](https://vaadin.com/docs/v23/tools/llms.txt)

# Using a custom legacy UI class

> **Note:** This is intended for advanced cases only, where using the recommended upgrade path isn’t enough to cover specific logic that can’t be easily ported to Flow.

If you have a need for a specific UI class to be used for the legacy Vaadin UI you can have the UI class extend MprUI. The UI **can not** be used for layout purposes.

```java
public class MyCustomUI extends MprUI {
    @Override
    protected void init(VaadinRequest request) {
        super.init(request);
    }
}
```

> **Note:** You need to call `super.init(request)` if you need to override the init method

Then you need to tell the application that this class should be used with the annotation `@LegacyUI()` by defining it in a class implementing `AppShellConfigurator`.

```java
@LegacyUI(MyCustomUI.class)
public class Configuration implements AppShellConfigurator {
}
```

Now using the application you get a MyCustomUI instead of the default MprUI.

[← Go back to the overview](https://vaadin.com/docs/v23/tools/mpr/overview.md)

`B25DFC7E-C56E-450E-9178-05C7ACA90032`
