Skip to content

App

The full application shell record. Use it to define the top-level structure of a Mateu application, including navigation menu, layout variant, header, favicon, and home route.

@Builder
@With
public record App(
String route,
String homeRoute,
String homeBaseUrl,
String homeServerSideType,
String homeUriPrefix,
String homeConsumedRoute,
String serverSideType,
String favicon,
String pageTitle,
String title,
String subtitle,
List<Actionable> menu,
AppVariant variant,
List<Component> widgets,
boolean drawerClosed,
String style,
String cssClasses,
String logo)
implements Component, PageMainContent { }
PropertyTypeDefaultDescription
routeString""Base route for this app
homeRouteStringRoute shown by default when navigating to the root
faviconStringURL of the browser favicon
pageTitleStringBrowser tab title
titleStringApp name shown in the header or drawer
subtitleStringSubtitle shown below the app title
menuList<Actionable>[]Top-level navigation menu items
variantAppVariantTABSLayout variant
widgetsList<Component>Additional widget components in the shell
drawerClosedbooleanfalseStart with the drawer closed
logoStringURL of the logo image
styleStringInline CSS
cssClassesStringCSS class names
ValueDescription
TABSNavigation rendered as a tab bar
DRAWERSide navigation drawer
TOP_MENUHorizontal top navigation bar
@Route("/")
public class MyApp implements ComponentTreeSupplier {
@Override
public Component component(HttpRequest httpRequest) {
return App.builder()
.title("My Application")
.favicon("/images/favicon.ico")
.homeRoute("/dashboard")
.variant(AppVariant.DRAWER)
.menuItem(new MenuEntry("Dashboard", "/dashboard"))
.menuItem(new MenuEntry("Customers", "/customers"))
.menuItem(new MenuEntry("Reports", "/reports"))
.build();
}
}
return App.builder()
.title("Admin Panel")
.subtitle("Powered by Mateu")
.logo("/images/logo.svg")
.homeRoute("/home")
.variant(AppVariant.DRAWER)
.drawerClosed(false)
.build();