Class ShellBuilder
Contract: output shape remains stable for integrators: optional header/account regions, optional side nav, and a main content target container.
Mutability and thread-safety: mutable and not thread-safe. Configure once per render flow and do not share mutable instances across concurrent requests.
-
Method Summary
Modifier and TypeMethodDescriptionaddCustomCss(String cssPath) Append an additional custom CSS file path.addCustomJs(String jsPath) Append an additional custom JS file path.build()Builds a full HTML document string including doctype.Builds a shell-body fragment containing navigation and the main content target.Builds a reusable shell template with a dedicated content slot.static ShellBuildercreate()Creates a new builder.withAccountBar(Component accountBar) Deprecated.withCollapsibleSideNav(boolean collapsible) Enable/disable collapsible side navigation.withContent(Component content) Sets initial shell content rendered inside the configured content target.withContentTarget(String targetId) Set the content area target ID for HTMX swaps.withContentTargetClass(String className) Set optional class on the content target div.withContentTargetId(String targetId) Alias forwithContentTarget(String).withContentWrapper(Function<Component, Component> wrapper) Apply a wrapper around the content target component.withCustomCss(String cssPath) Add custom CSS file path.withCustomCss(List<String> cssPaths) Replace all custom CSS paths with the provided ordered list.withCustomJs(String jsPath) Replace all custom JS paths with a single JS path.withCustomJs(List<String> jsPaths) Replace all custom JS paths with the provided ordered list.withFrameworkCss(boolean include) Enable/disable framework CSS inclusion.withFrameworkCssPath(String cssPath) Set framework CSS path used when framework CSS is enabled.withHtmx(boolean include) Enable/disable HTMX inclusion.withPageTitle(String title) Set the page title.withSideNav(SideNav sideNav) Set the side navigation component.withSideNav(SideNav sideNav, boolean collapsible) Set the side navigation with collapsible option.withTopBanner(Component topBanner) Set the top banner component.withTopNav(Component topNav) Set the top navigation component rendered in the header region.
-
Method Details
-
create
Creates a new builder. -
withTopBanner
Set the top banner component. -
withAccountBar
Deprecated.Legacy alias for top navigation configuration. -
withContentTarget
Set the content area target ID for HTMX swaps. -
withContentTargetId
Alias forwithContentTarget(String). -
withContentTargetClass
Set optional class on the content target div. -
withContentWrapper
Apply a wrapper around the content target component. -
withPageTitle
Set the page title. -
withContent
Sets initial shell content rendered inside the configured content target.When initial content is provided, the content target is rendered without the default HTMX auto-load attributes.
-
withHtmx
Enable/disable HTMX inclusion.Full documents and templates that include HTMX initialize the legacy request-origin, DELETE-body and smooth-scroll defaults before custom scripts. Explicit application HTMX configuration remains authoritative. Body fragments do not initialize assets or defaults; their host owns configuration.
-
withCustomCss
Add custom CSS file path. -
withCustomCss
Replace all custom CSS paths with the provided ordered list. -
addCustomCss
Append an additional custom CSS file path. -
withCustomJs
Replace all custom JS paths with a single JS path. -
withCustomJs
Replace all custom JS paths with the provided ordered list. -
addCustomJs
Append an additional custom JS file path. -
withFrameworkCss
Enable/disable framework CSS inclusion. -
withFrameworkCssPath
Set framework CSS path used when framework CSS is enabled. -
build
Builds a full HTML document string including doctype. -
buildBody
Builds a shell-body fragment containing navigation and the main content target.Omits the document, header/banner/top navigation, assets and inline scripts. The host must load framework CSS/JS once (and HTMX when used). Shared framework JS initializes desktop collapse and the mobile drawer, including fragments inserted later. Desktop persistence uses
sidebarCollapsedbest effort; denied storage does not disable document-local toggling. -
buildTemplate
Builds a reusable shell template with a dedicated content slot.Template mode always uses explicit content rendering and does not emit shell-level content auto-load attributes on the content target.
-