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 AppShell(
String clientSideComponentId,
String route,
String homeRoute,
String homeBaseUrl,
String homeServerSideType,
String homeUriPrefix,
String homeConsumedRoute,
String serverSideType,
String favicon,
String pageTitle,
String title,
String subtitle,
@Singular("menuItem") List<Actionable> menu,
AppVariant variant,
AppLayout layout,
@Singular List<Component> widgets,
boolean drawerClosed,
String style,
String cssClasses,
String logo)
implements Component, PageMainContent { }
PropertyTypeDefaultDescription
routeString""Base route for this app
homeRouteString—Route shown by default when navigating to the root
faviconString—URL of the browser favicon
pageTitleString—Browser tab title
titleString—App name shown in the header or drawer
subtitleString—Subtitle 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
logoString—URL of the logo image
styleString—Inline CSS
cssClassesString—CSS class names

HAMBURGER_MENU, MENU_ON_LEFT, MENU_ON_TOP, TABS, TILES, RAIL, AUTO, MEDIATOR — see @App for what each one draws. HAMBURGUER_MENU (the old misspelling of HAMBURGER_MENU) is deprecated but still accepted, in Java and in YAML.

@UI("")
public class MyApp implements ComponentTreeSupplier {
@Override
public Component component(HttpRequest httpRequest) {
return AppShell.builder()
.title("My Application")
.favicon("/images/favicon.ico")
.homeRoute("/dashboard")
.variant(AppVariant.MENU_ON_LEFT)
.menuItem(new RouteLink("/dashboard", "Dashboard"))
.menuItem(new RouteLink("/customers", "Customers"))
.menuItem(new RouteLink("/reports", "Reports"))
.build();
}
}
return AppShell.builder()
.title("Admin Panel")
.subtitle("Powered by Mateu")
.logo("/images/logo.svg")
.homeRoute("/home")
.variant(AppVariant.MENU_ON_LEFT)
.drawerClosed(false)
.build();