Apache Wicket × Oat UI

Wicket Oat

A modern, themeable component library for Apache Wicket — built on Oat's ultra-lightweight, semantic CSS and JS: real HTML elements that screen readers and keyboards already understand. No utility-class soup, no client framework, just Wicket the way you already write it.

Wicket 10.11+ Java 17+ Oat 1.0 MIT Licensed

New in 0.6.0 Out now: fixes from a review of the whole library, for multi-select fields, sign-out, date columns, lazy loading and fields and menus in dialogs. See what changed.

Why Wicket Oat

Server-side components, modern look, zero JS framework

Wicket Oat wraps Oat's semantic HTML/CSS/JS in idiomatic Wicket Components and Behaviors, so you get a current, themeable UI without leaving Wicket's component model.

Components and behaviors

Create components with new, like any Wicket component, or apply Oat.Behaviors to a component you already have — composition over inheritance, your choice per case.

Semantic & lightweight

Oat styles real HTML elements by default. ~10KB of CSS and JS total, no build step, no bundler, no utility-class soup in your markup.

Themeable

19 built-in themes, remembered per user in a cookie, plus your own themes registered in one line — full CSS custom-property theming to match your brand.

Just Wicket

Every component is an ordinary WebMarkupContainer, Panel, or Behavior subclass — test it with WicketTester like anything else in your app.

Accessible by default

Native HTML elements, form fields wired to their error messages, full keyboard use and ARIA states built in — no extra markup on your side. How it works

Forms the Wicket way

Fields take their model from a CompoundPropertyModel and their label from .properties, by id. Validation errors show inline, and feedback panels and toasts update themselves over Ajax.

Strict CSP out of the box

Works under Wicket's default nonce-based Content Security Policy: no inline scripts or styles, no 'unsafe-inline', no 'unsafe-eval'.

Built for business apps

Data tables with row actions and bulk operations, page headers, KPI cards, detail views, master-detail screens, a wizard, a sign-in form, comments, server-side autocomplete, money and date-range fields — the screens line-of-business applications are made of.

Speaks your users' language

The few texts the library renders itself come in English, German, Spanish, French, Italian, Japanese, Dutch and Portuguese, following each user's locale like Wicket's own validation messages.

How it works

A page is an app frame full of components

Wicket Oat components are Wicket components: a page is still a tree of them, and each renders plain HTML that Oat's CSS styles. Build one invoices page in seven steps and watch the tree, the code and the page grow. The page in the panel is live Oat markup.

  1. 01 Extend OatAppLayout

    A page of yours extends OatAppLayout, a Wicket WebPage. Its markup is the frame: Oat's data-sidebar-layout grid with a top bar, a sidebar and <main>, behind a “Skip to content” link. Your page's markup goes into <main>, inside <wicket:extend>.

    In an app, the hooks of the next steps sit in a base page of yours that every page extends.

    InvoicesPage.java
    public class InvoicesPage extends OatAppLayout {     @Override    protected IModel<String> appNameModel() {        return Model.of("Acme Billing");    }}
    InvoicesPage.html
    <wicket:extend>    <!-- rendered inside <main> --></wicket:extend>

    The frame is OatAppLayout's own markup, the grid Oat styles.

  2. 02 Fill the sidebar

    sidebarMenuItemsModel() lists the pages. Each MenuItem becomes a link, and the current page's is marked aria-current. Groups fold into <details>, a badge shows a count, and pages the user may not open are left out.

    InvoicesPage.java / sidebar
    @Overrideprotected IModel<List<MenuItem>> sidebarMenuItemsModel() {    return Model.ofList(List.of(        MenuItem.of("Dashboard", DashboardPage.class),        MenuItem.of("Invoices", InvoicesPage.class)            .withBadge(() -> invoices.countOpen()),        MenuItem.of("Customers", CustomersPage.class)));}

    One link per menu item; aria-current marks this page.

  3. 03 Show who’s signed in

    newTopNavExtra(id) fills the top bar's corner. An OatUserMenu shows the user's picture or initials and name, and opens a menu with their email, links of yours and “Sign out”. While nobody is signed in, it is a “Sign in” link.

    InvoicesPage.java / top bar
    @Overrideprotected Component newTopNavExtra(String id) {    OatUserMenu user = new OatUserMenu(id, () -> session.userName());    user.setDetail(() -> session.email());    user.addLink("Settings", SettingsPage.class).setIcon("settings");    return user;}

    OatUserMenu renders into the top bar's topNavExtra.

  4. 04 Add the page’s content

    The page adds its components with add(...), as any Wicket page does. OatPageHeader gives it a title and actions, OatDataTable a sortable, pageable table with Oat columns. Each renders plain HTML that Oat's CSS styles, so there is no CSS of your own to write.

    InvoicesPage.java / constructor
    public InvoicesPage() {    add(new OatPageHeader("header", "Invoices"));     List<IColumn<Invoice, String>> columns = List.of(        new LambdaColumn<>(Model.of("Number"), Invoice::number),        new LambdaColumn<>(Model.of("Customer"), Invoice::customer),        new OatBadgeColumn<>(Model.of("Status"), Invoice::status, Invoice::variant),        new OatNumberColumn<>(Model.of("Total"), Invoice::total));    add(table = new OatDataTable<>("invoices", columns, provider, 10));}
    InvoicesPage.html
    <wicket:extend>    <header wicket:id="header"></header>    <div wicket:id="invoices"></div></wicket:extend>

    Plain <header> and <table>, styled by Oat.

  5. 05 Edit in a dialog

    An OatDialog is a native <dialog> with a form in it. A row's “Edit” points the dialog's model at that invoice and opens it over Ajax. Its fields are Oat fields: a label, the input, and a hint or an error under it.

    InvoicesPage.java / constructor
    OatDialog edit = new OatDialog("edit", "Edit invoice") {    @Override    protected void onConfirm(AjaxRequestTarget target) {        invoices.save(invoice.getObject());        target.add(table);    }};Fragment fields = new Fragment(OatDialog.CONTENT_ID, "fields", this,        new CompoundPropertyModel<>(invoice));fields.add(new OatTextField<String>("customer").setRequired(true));add(edit.setContent(fields)); actions.addAction("Edit", (target, row) -> {    invoice.setObject(row);    edit.open(target);});

    A native <dialog> with its own form, opened over Ajax.

  6. 06 One Ajax round trip

    “Confirm” sends the dialog's form over Ajax, and Wicket validates it on the server. With the customer left empty, the field shows its error by itself: the response sets the message and aria-invalid, so the input keeps its focus and a screen reader announces the message. A valid confirm saves and re-renders only the table: target.add(table).

    The Ajax response / Customer left empty
    <ajax-response>    <evaluate>WicketOat.fieldFeedback("customer7", "feedback8",        "'Customer' is required.", true)</evaluate></ajax-response>

    Only the message and aria-invalid change; the input keeps its focus.

  7. 07 Switch the theme

    The look comes from Oat's CSS variables. OatThemeSwitcher in the sidebar's footer sets one data-theme attribute on <html>, kept in a cookie, and every component follows: 19 built-in themes, light and dark, or your own.

    InvoicesPage.java / sidebar footer
    @Overrideprotected Component newSidebarFooter(String id) {    return new OatThemeSwitcher(id);}

    One data-theme attribute; every component follows.

  • Menus: menu items can carry PageParameters and translated labels, groups stay open while one of their pages is shown, and target.add(getSidebar()) updates a badge over Ajax. newMenuLink(id, item) can make an entry an AjaxLink.
  • Phones: under 768px the sidebar becomes an off-canvas panel, opened with the ☰ button; Oat's own script does that. For phone-first apps, OatMobileLayout puts a bottom tab bar under the content instead.
  • Pages of your own: a base page that isn't an OatAppLayout gets the theme, density and language from add(new OatHtml("html")); bookmarkable pages pass their PageParameters to super(...).

Accessibility

Accessible because it's real HTML

Oat styles native elements — <button>, <dialog>, <details>, <label>, <table> — instead of rebuilding them out of <div> elements. Screen readers, keyboards and browser zoom already know how they work. Wicket Oat renders the same native markup and adds the ARIA attributes that HTML can't express on its own.

Forms that explain themselves

Labels belong to their inputs, required fields are marked, and a validation error appears next to its field in a role="status" region, linked through aria-describedby with aria-invalid set.

After an Ajax submit, a field's error appears in place: the text of its role="status" region changes, so screen readers announce it, and the input keeps its focus and what was typed.

Keyboard all the way

Dialogs are native modal dialogs: focus stays inside and Escape closes them. Menus and context menus work with the arrow keys, Shift+F10 or the Menu key and give focus back when they close. Tree nodes expand with real buttons, and cells edited in place save with Enter and cancel with Escape.

OatAppLayout starts with a “Skip to content” link past the navigation.

The stars of OatRatingField are radio buttons, so the arrow keys move between them.

So are the chips of OatFilter, and a drawer opens with its first field focused.

States a screen reader can announce

aria-current marks the current page in navigation, breadcrumbs and pagination, aria-sort the sorted column, aria-expanded an open tree node, and aria-busy a button whose Ajax request is still running.

A rating is read as “4.5 out of 5 stars”, a status dot by its name, such as “Online”, and a progress ring as a progressbar with its value.

Buttons that open a menu say so (aria-haspopup), and the user menu's button is named “Account:” and the user's name.

Charts you can read without seeing them

Every chart comes with its numbers as a data table, and its marks carry text titles. Icons are hidden from screen readers unless you give them a label, and then they are announced by it.

Respects user settings

Animations stop for users who ask for reduced motion, keyboard focus is always visible, and layouts reflow down to phone width, so zooming in doesn't mean scrolling sideways.

Labels in the user's language

The texts only screen readers hear, such as “Toggle menu” or “Expand”, come in eight languages and follow each user's locale, like every other text the library renders.

OatAppLayout sets the page's lang, so screen readers pronounce it in the right language.

Wicket Oat gives you accessible building blocks, not a certificate: whether an application meets WCAG 2.1 AA also depends on its content and labels, the colors of the theme it uses, and testing with real assistive technology.

Get Started

Three steps to your first Oat component

1

Add the dependency

<dependency>
    <groupId>dev.jbaby</groupId>
    <artifactId>wicket-oat-core</artifactId>
    <version>0.6.0</version>
</dependency>
2

Install it in your application

public class MyWicketApplication extends WebApplication {
    @Override
    protected void init() {
        super.init();
        WicketOats.install(this); // adds Oat's CSS/JS; returns OatSettings for themes
    }
}
3

Build your first UI

add(new OatAlert("notice", "Welcome back!", OatVariant.SUCCESS));

add(OatButton.onClick("save", "Save changes", target ->
    Oat.toast(target, "Saved!", OatVariant.SUCCESS)));
<div wicket:id="notice"></div>
<a wicket:id="save"></a>

Oat components are plain Wicket components, created with new. Those driven by a callback, like a button's click, also have a static factory taking a lambda, like Wicket's own AjaxLink.onClick(...), so you don't have to subclass them.

Want the full walkthrough? See the Build a Contact Form tutorial, or read the user guide for every component in detail.

Component Showcase

Everything below is real, live Oat markup

Not screenshots — this page loads the same Oat 1.0 build the library vendors, so what you see here is exactly what renders in your app.

New in 0.6.0 0.6.0, the current release, is a release of fixes and adds no components. The changelog lists them, with notes on upgrading from 0.5.x.

General

Default Success Danger
OT
Saved. Your changes were applied.

Plan

Any HTML can live inside.

  • Orders 6,054 +9.1%vs. last year
    3
    MN
    • API online
    • Search slow
    • Mail down

    Press Ctrl + K to search, or Shift+? for all shortcuts.

    or

    Navigation

    What is Wicket Oat?

    A themeable component library for Apache Wicket, built on Oat.

  • Grace Hopper grace@example.com

    Inbox Settings

    ACME GmbH

    Customer since 2019 · Vienna

    1. 1Customer
    2. 2Items
    3. 3Review

    ACME GmbH

    Billing email
    billing@acme.example
    Status
    Active
    Inbox

    Order #1001 has shipped

    Order #1001 has shipped

    Drag the corner of the list to resize it.

    Quote Q-1003 approved

    Today4 of 6 in the office

    Overlays

    Delete item?

    This action cannot be undone.


    Manage your account here.

    Change your password here.

    Delete INV-1042?

    This can't be undone.

    Filter orders

    Data Display

    NameStatus
    Invoice #1042Paid
    Invoice #1043Due
    2 selected
    NumberCustomerStatusTotalDue
    INV-1001GlobexOpen$137.50Oct 4, 2026
    INV-1002InitechPaid£275.00Oct 7, 2026
    INV-1005Wayne EnterprisesOverdue£687.50Oct 16, 2026
    VAT ID
    ATU12345678
    Customer since
    Mar 1, 2019
    Status
    Active
    Notes
    —
    1. Payment received

      INV-1019 · €2,612.50

    2. Invoice sent
    3. Reminder sent
    1. JL
      Jordan Lee

      Asked for the Q3 invoices as one PDF.

    2. AK
      Alex Kim

      Paid INV-1019.

    Revenue per month
    Data
    CategoryValue
    Jul104,900
    Aug97,600
    Sep112,300
    Oct118,400
    Nov121,900
    Dec128,400
    This year and last
    • 2026
    • 2025
    Data
    Category20262025
    Jul104,90088,700
    Aug97,60084,300
    Sep112,30095,600
    Oct118,40099,100
    Nov121,900104,200
    Dec128,400111,800
    Revenue by region
    Data
    CategoryValue
    DACH512
    Benelux242
    Nordics198
    France133
    Top customers
    Data
    CategoryValue
    ACME GmbH182,400
    Globex151,900
    Initech118,300
    Order #1001 has shipped
    Meeting notes, week 1002
    Quote Q-1003 approved
    NamePrice
    Docking station€189.00
    Laptop 14"€1,299.00
    ProductStock
    Backup, 1 TB

    Encrypted off-site backup, billed monthly.

    Docking station

    Oat Granola
    4.3 from 128 reviews

    Oat Milk
    No reviews yet

    60%
    3/5
    93%

    Click a chip, or move between them with the arrow keys.

    Forms

    We'll never share it.
    Size
    Drop files or click to choose
    Delivery window
    • ACME GmbH
    • Acme Logistics
    Phone
    Billing address
    Notify
    • Sam Rivera
    • Robin Chen
    How did we do?
    Click a star, or use the arrow keys.
    Please fix the errors in the form.
    'Full name' is required.
    Your ticket goes here.

    Feedback

    Your changes were saved.
    The server could not be reached.

    The Wicket way

    Wicket the way you already write it

    Wicket Oat works the way Wicket itself does: dialogs like ModalDialog, data tables like AjaxFallbackDefaultDataTable, lambda factories like AjaxLink.onClick, and tests that read like the markup.

    Dialogs like ModalDialog

    Set the content with setContent(...) and OatDialog.CONTENT_ID. The server knows whether the dialog is open, onClose runs however it closed — Cancel, Escape, the backdrop or a confirm — and target.add(dialog) keeps an open dialog open.

    OatDrawer is a dialog that slides in from an edge, and a dialog closed without confirming shows its models again the next time.

    A dialog opened again in onConfirm, such as a second question, stays open, and Enter in a page's field can't click a button of a closed dialog.

    Data tables over Ajax

    Sorting and paging re-render only the table, falling back to plain links without JavaScript. OatDataTable is pageable like a DataTable, so table.setCurrentPage(0) works, and a selection can keep just ids: new OatSelectionColumn<>(selectedIds, Invoice::getId).

    The selected rows can be loaded by their ids, so bulk actions also get those a search hides.

    Form fields you can test

    A field's input sits at "email:input" instead of "email:container:field", in FormTester and in the posted name. getInput() returns it, and addToInput(...) puts an autocomplete or maxlength right on the <input>.

    No onError that adds the form: fields show the errors of an Ajax submit themselves, and new OatFeedbackPanel(id, form) shows the form's own errors next to it, once.

    Lambdas where Wicket uses them

    Components driven by a callback get factories on their own classes: OatButton.onClick(...), OatSubmitButton.onSubmit(...), OatAccordion.of(...). Everything else is created with new, and hooks are named newXxx(id).

    Your own base page

    add(new OatHtml("html")) gives any page the theme, density and language the layouts set, and OatThemeSwitcher no longer makes a page stateful, so a sign-in page can show it and stay stateless.

    Fixes

    Signing in with OatLoginForm returns to the page the user was going to, and a dialog inside a page's form no longer blocks that form's submit.

    Theming

    19 built-in themes, plus your own

    Click a theme below to preview it live on this entire page — the same data-theme mechanism OatThemeSwitcher uses in your app, where the user's choice is remembered in a cookie (and works with any session class).

    Business and Business Dark, two sober themes for line-of-business apps with status colors that meet WCAG AA, and a compact density for data-heavy screens.

    // Switch the current user's theme (kept in a cookie)
    OatTheme.setCurrent(OatTheme.NORD);
    
    // In init(): the default theme, and your own themes defined in CSS
    WicketOats.install(this)
            .setDefaultTheme(OatTheme.LIGHT)   // or null to follow the browser
            .addTheme(new OatTheme("brand", "Brand", "🏷️"))
            .setDensity(OatDensity.COMPACT);   // tighter spacing app-wide
    
    // Pin one component to a theme, whatever the user chose
    card.add(Oat.Behaviors.theme(OatTheme.LIGHT));
    
    // Keep Oat's own spacing in one part of a compact app
    form.add(Oat.Behaviors.density(OatDensity.DEFAULT));

    AI-Powered Development

    Give your AI coding agent a Wicket Oat cheat sheet

    Wicket Oat ships a standard Agent Skill — a plain SKILL.md plus a references/ folder — giving the agent deep knowledge of the Oat API, component library, and theming system. It works with any tool that supports this directory-based skill convention. Other agents get the same knowledge from llms.txt and the rules in the guide.

    1

    Grab the skill

    It lives in the repo at wicket-oat/ (SKILL.md + references/).

    2

    Point your agent at it

    Copy it into your agent's own skills folder — for example, with Claude Code:

    cp -r wicket-oat .claude/skills/wicket-oat

    Check your agent's own documentation for how it discovers or loads skills.

    3

    Just ask

    Once installed, try: “Add a primary Oat button that shows a success toast on click.” or “Turn this standard Wicket Label into an Oat success badge.”