Meerkat Widgets

Meerkat Widgets is a Java library of simple HTML widgets for PushMode applications. All widgets are reactive via Hookless. Default CSS is provided. Widgets are designed to require minimal configuration. Single input value can be often obtained via one-liner.

Download

Get Meerkat Widgets from Maven Central:

Tool
<dependency>
    <groupId>com.machinezoo.meerkatwidgets</groupId>
    <artifactId>meerkatwidgets</artifactId>
    <version>0.2.1</version>
</dependency>

Or clone sources from GitHub or Bitbucket. Don't forget to configure your build for Java 17+. Sources and binaries are distributed under Apache License 2.0.

If your project is a Java module, add the following declaration to your module-info.java:

requires com.machinezoo.meerkatwidgets;

Usage

Widgets assume they run in context of PMSite project. By default, user's input is persisted in preferences object of the active SiteFragment. Given this setup, simple UIs can be constructed from one-liners.

var name = LineEditor.edit("Your name", "Joe");
StaticContent.show("Greeting", "Hello " + name + "!");

The above code will be rendered as two reactive widgets that you can try below.

Your name
Greeting
Hello Joe!

More complex cases are supported with custom data bindings, group widgets, and custom stringifiers.

Next steps