ZeroZ Stack · Components

A user interface, in Java.

A programmatic component model — new Button("Send"), not a template — styled with Tailwind and DaisyUI. Components live in the client's WebAssembly heap, so the server holds no DOM state for them. There is no HTML file and no CSS file in a ZeroZ Stack application unless you decide to write one.

CLIENT · WASM · ProfileForm.java
var form = new VerticalLayout(
    new TextField("Name").bind(user::getName, user::setName),
    new Select<Role>("Role").setItems(Role.values()),
    new Button("Save").onClick(e -> users.save(user))
);

This page is an orientation — the generated API documentation ↗ is authoritative.

Building views

Compose with layouts.

Layouts implement HasComponents and nest hierarchically. VerticalLayout, HorizontalLayout, and FormLayout manage Flexbox and Grid for you — add children and compose complex UIs entirely in Java.

Prefer markup for a complex structure? FlavourWrapper binds a TeaVM Flavour HTML template while keeping type safety and data binding.

CLIENT · WASM · RegistrationView.java
var main = new VerticalLayout();
main.add(new CardTitle("User Registration"));

var form = new FormLayout();
form.add(new TextField("Name"),
         new TextField("Email"));

var actions = new HorizontalLayout();
actions.add(new Button("Submit"),
            new Button("Cancel"));

main.add(form, actions);
CLIENT · WASM · Binder.java● Two-way
var binder = new Binder<User>();

binder.forField(nameField)
      .asRequired("Name is required")
      .bind(User::getName, User::setName);

// load a bean — fields populate, edits write back
binder.setBean(user);

Data binding

Bind fields to a POJO.

Any component implementing HasValue binds to a bean field through Binder. It reads the bean into the fields, validates on change, writes valid input back, and renders error states onto the components automatically.

Component reference

Organised by what you're trying to do.

Structure a page

How do I lay this out?

Layouts implement HasComponents and nest hierarchically — add children and compose the whole view in Java.

DivGeneric block-level container
SpanGeneric inline container
VerticalLayoutArranges children in a vertical column
HorizontalLayoutArranges children in a horizontal row
FlexLayoutFlexbox container with custom flex properties
GridLayoutCSS grid container for two-dimensional layouts
FormLayoutResponsive layout for form fields and labels
ScrollerAdds scrollbars when content overflows its bounds
SplitPaneTwo resizable panels with a divider
StackLayout utility for overlapping components
DividerVisual separator between sections
JoinSeamlessly connects grouped elements
FlavourWrapperHosts TeaVM Flavour HTML templates
FlexComponentBase layout class for flexbox containers

Collect input

How do I build a form?

Every input implements HasValue, so it binds to a bean field through Binder — validation and error states included.

TextFieldSingle-line text input
TextAreaMulti-line text input area
CheckboxBoolean toggle for individual options
RadioButtonGroupSet of mutually exclusive radio options
SelectDropdown for a single item from a collection
RangeSlider for numeric values within a range
RatingInteractive star-based rating selector
ToggleSwitch — alternative to a checkbox
FileInputSelect files from the user's system

Move around the app

How do I navigate?

Actions and navigation — from a single button to a full navigation shell.

ButtonStandard clickable button
LinkStandard hyperlink for navigation
NavbarStandard top navigation header
BottomNavigationMobile nav bar fixed to the bottom
BreadcrumbsCurrent navigational hierarchy and path
MenuList of navigational or action items
DropdownContextual overlay menu from an anchor
ContextMenuPopup menu from right-click / long-press
TabSelectable sections in a tabbed interface
PaginationNavigate through paginated datasets
StepsWizard-like progression through a sequence
SwapToggles between two states or icons on click

Show data

How do I display a list, a table, a chart?

From a single stat to a virtualized list — data display without leaving the Wasm heap.

TableStructured grid for tabular data
KeyedListList that manages DOM nodes by key
VirtualScrollerRenders only visible items for large lists
CardBounded container for related content
CardTitle / CardActionsSub-components for Card structure
AccordionExpandable/collapsible list of panels
CollapseGeneric expand/collapse container
StatProminent statistic or metric
KpiTileDashboard tile for a KPI
SparklineSmall inline trend chart
TimelineLinear representation of events by time
LaneTimelineTimeline segmented into multiple lanes
PropertyGridGrid of key-value object properties
Diff / DiffViewSide-by-side text or file differences
CarouselSlideshow for cycling through elements
ChatBubbleA single message in a conversation
StreamingTextText that streams in dynamically
MarkdownViewRenders Markdown safely into HTML
CodeBlockStyled container for source code
SvgCanvasContainer for drawing SVG graphics
AvatarUser or entity with an image or initials
BadgeSmall label for counts or status
IconScalable vector icon component
KbdVisual styling for keyboard input
CountdownTimer counting down to an event
TokenMeterVisualization for API token usage
HeroLarge, prominent landing banner
FooterStandard page footer element

Tell the user something

How do I show progress, errors, confirmation?

Feedback and overlays — transient, modal, or ambient.

AlertMessage banner for important information
ToastBrief, auto-expiring notification
DialogModal overlay for critical interaction
DrawerSliding side panel for navigation
TooltipInformational popup on hover
LoadingSpinner for a background process
Progress / RadialProgressLinear and circular progress bars
SkeletonPlaceholder screen while data loads
EmptyStatePlaceholder shown when there is no data
IndicatorMarker attached to another element
StatusDotColored status indicator (online/offline)

Everything else

Base classes, mixins, device frames and utilities the rest of the library is built from.

ComponentBase class for all UI elements
AbstractFieldFoundation for input components
HasComponentsInterface for containers of children
HasValueInterface for data-bindable components
HasSize / HasStyle / HasText / HasEnabledMixins for standard properties
FocusableComponents that can receive keyboard focus
ClickEvent / ComponentEventDOM & custom event infrastructure
DomListenerRegistration / EventListenerEvent listener plumbing
MaskShapes or clips elements (e.g. circular)
ThemeControllerSwitches application themes (light/dark)
PhoneMockup / BrowserMockupStylized device / window frames
WindowMockup / CodeMockupWindow and code-editor frames
ResizerDrag handle for resizable containers
JsWrapper for custom JavaScript execution