Demos /

Shells & builders

Working framework components, paired with the Java that composes them.

BannerBuilder

A standalone banner with restrained application-owned colors.

Java composition
BannerBuilder.create().withTitle("Field notes").withSubtitle("A Java-rendered publication").withBackgroundColor("#245C48").withTextColor("#FFFFFF").build();
Open isolated full-document preview →

TopNavBuilder

A full-document navigation specimen.

Java composition
TopNavBuilder.create().withBrand("Field notes").withHtmxNavigation(false).addPrimaryLink("Docs", "/docs").addUtilityLink("Java API", "/api").build();
Open isolated full-document preview →

SideNavBuilder

The builder produces framework SideNav markup and fragment navigation.

Java composition
new Div().withChild(SideNavBuilder.create().addSection("Examples").addLink("Server time", "/demos/fragments/time").withContentTarget("builder-nav-target").build()).withChild(new Div().withId("builder-nav-target"));
Open isolated full-document preview →

AccountBarBuilder

Utility links and a clearly simulated account display.

Java composition
AccountBarBuilder.create().addLeftLink("Documentation", "/docs").addRightItem(new Paragraph("Simulated visitor, not signed in")).build();
Open isolated full-document preview →

ShellBuilder

Open a complete local document, isolated from this site's shell.

Java composition
Component content = new Div().withChild(Header.H1("Local shell preview"))
    .withChild(new Paragraph("A complete document."))
    .withChild(Link.create("/demos/builders/shell", "Back to the builder example"));
ShellBuilder shell = ShellBuilder.create().withPageTitle("Local shell preview")
    .withSideNav(SideNavBuilder.create().addSection("Preview navigation")
        .addLink("Chat", "/chat").addLink("Documentation", "/docs").build(), true);
shell.withContent(content).build();
Open isolated full-document preview →

ShellTemplate

Compile a shell and render its typed content slot in a separate local document.

Java composition
Component content = new Div().withChild(Header.H1("Template preview"))
    .withChild(new Paragraph("Content supplied at render time."))
    .withChild(Link.create("/demos/builders/shell-template", "Back to the builder example"));
ShellBuilder shell = ShellBuilder.create().withPageTitle("Template preview")
    .withSideNav(SideNavBuilder.create().addSection("Preview navigation")
        .addLink("Chat", "/chat").addLink("Documentation", "/docs").build(), true);
shell.buildTemplate().renderWithContent(content);
Open isolated full-document preview →