This page introduces the patternfly-java project: what it is, what it contains, and how it is organized at the highest level. For detailed build tooling, see Build System and Development. For setting up a local environment or adding it as a dependency, see Getting Started.
PatternFly Java is a pure Java implementation of the PatternFly design system that generates standard HTML/CSS output conforming to PatternFly's DOM structure and CSS class conventions. It targets browser-based Java runtimes—specifically GWT (Google Web Toolkit) and J2CL (Java-to-Closure-JavaScript transpiler)—enabling developers to build PatternFly-compliant web UIs using Java.
Project properties
| Property | Value |
|---|---|
| Group ID | org.patternfly |
| Current version | 0.5.1-SNAPSHOT |
| Java requirement | Java 21+ |
| PatternFly version | 6.4.0 |
| Elemento version | 2.4.9 |
| License | Apache License 2.0 |
| JavaScript dependencies | None (except charts) |
| Supported runtimes | GWT 2.13.0, J2CL |
| Repository | https://github.com/patternfly-java/patternfly-java |
Key characteristics:
@patternfly-java/charts npm package)gwt-lib) and J2CL (jar)Sources: README.md1-4 pom.xml29-111 README.md84-86
PatternFly Java supports two Java-to-JavaScript compilation pipelines:
GWT (patternfly-java-gwt): Uses the GWT compiler. Applications inherit the org.patternfly.PatternFly GWT module. Popper.js is injected at runtime via ScriptInjector.
J2CL (patternfly-java-j2cl): Uses the J2CL transpiler with the j2cl-maven-plugin. Popper.js is bundled differently. The showcase application uses this target.
For a detailed comparison, see GWT vs J2CL.
Sources: gwt/pom.xml1-83 j2cl/pom.xml1-62 README.md56-81
PatternFly Java is organized into distinct layers, from foundational utilities to platform-specific integrations and deployment artifacts.
System architecture — module organization and dependencies
Dependency flow:
core, tokens, icons, layouts) provide base classes, design primitives, and structural layoutscomponents, charts) build on the foundation to implement PatternFly UI componentscodeeditor, finder) provide specialized components that extend core functionalitygwt, j2cl) package the library for specific compilation targetsSources: pom.xml113-126 core/pom.xml39-51 components/pom.xml35-51 gwt/pom.xml47-70 j2cl/pom.xml35-44 bom/pom.xml83-200
The project is organized as a multi-module Maven build rooted at pom.xml19-599 The root POM inherits from org.jboss:jboss-parent:52 and defines the module hierarchy.
Maven parent-child relationships
Key parent POMs:
patternfly-java-parent (pom.xml19-599): Root aggregator defining plugin versions, profiles, and module listpatternfly-java-code-parent (code-parent/pom.xml19-105): Shared dependency management for Elemento, JUnit, and PatternFly BOM; inherited by all code modulespatternfly-java-bom (bom/pom.xml19-256): Standalone BOM for version management; inherits from JBoss parent but not from patternfly-java-parentSources: pom.xml23-27 pom.xml113-126 code-parent/pom.xml23-28 bom/pom.xml23-28
| Maven Artifact ID | Directory | Packaging | Main Packages / Modules | Purpose |
|---|---|---|---|---|
patternfly-java-parent | / | pom | N/A | Root aggregator; defines plugin versions, repositories, profiles (release, showcase, apidoc) |
patternfly-java-build-config | build-config/ | jar | etc/ resources | Checkstyle config, license headers, import sorting rules |
patternfly-java-code-parent | code-parent/ | pom | N/A | Dependency management for Elemento BOM, JUnit BOM, PatternFly BOM |
patternfly-java-bom | bom/ | pom | N/A | Bill of materials; version management for downstream consumers |
patternfly-java-core | core/ | gwt-lib | org.patternfly.coreorg.patternfly.popperorg.patternfly.style | Base classes (BaseComponent, BaseComponentSVG), Popper.js integration, CSS utilities, ARIA helpers, filter framework |
patternfly-java-tokens | tokens/ | gwt-lib | org.patternfly.token.Token | Generated enum containing PatternFly design tokens (CSS custom properties) |
patternfly-java-icons | icons/ | gwt-lib | org.patternfly.icon.IconSetsorg.patternfly.icon.IconSpecs | Generated icon factory methods for FontAwesome (fas, far, fab) and PatternFly icons |
patternfly-java-layouts | layouts/ | gwt-lib | org.patternfly.layout.* | Layout components: Flex, Grid, Stack, Gallery, Bullseye, Split |
patternfly-java-components | components/ | gwt-lib | org.patternfly.component.* | All PatternFly UI components (50+ components) |
patternfly-java-charts | charts/ | gwt-lib | org.patternfly.component.chart.* | Chart components (Donut, DonutUtilization, Bullet, Pie); hybrid Java + web components architecture |
patternfly-java-finder | extensions/finder/ | gwt-lib | org.patternfly.extension.finder | Finder extension for browsing hierarchical data |
patternfly-java-codeeditor | extensions/codeeditor/ | gwt-lib | org.patternfly.extension.codeeditor | Code editor extension with Monaco editor integration |
patternfly-java-gwt | gwt/ | gwt-lib | org.patternfly.PatternFly (GWT module) | GWT platform integration; aggregates components and layouts dependencies |
patternfly-java-j2cl | j2cl/ | jar | (packages components + layouts) | J2CL platform integration; JAR packaging with bundled Popper.js externs |
patternfly-java-showcase | showcase/ | jar | org.patternfly.showcase.* | Demo application built with J2CL; uses -Pshowcase profile |
Sources: pom.xml113-126 bom/pom.xml83-200 core/pom.xml30-33 components/pom.xml30-33 gwt/pom.xml30-33 j2cl/pom.xml30-33 README.md107-122
The patternfly-java-components module (at components/) contains implementations of PatternFly UI components, organized into packages under org.patternfly.component.*. Components are grouped by function:
Page, Masthead, PageSidebar, PageMain, PageSectionNavigation, Breadcrumb, Tabs, JumpLinks, ProgressStepperMenu, MenuToggle, Dropdown, SingleSelect, MultiSelect, SingleTypeahead, MultiTypeaheadForm, FormGroup, TextInput, TextArea, FormSelect, Checkbox, Radio, Switch, NumberInputTable, DataList, SimpleList, TreeView, DescriptionListModal, Wizard, Popover, Tooltip, Alert, EmptyStateCard, Panel, Accordion, Label, TitleFor detailed component documentation, see Component Library.
The patternfly-java-layouts module (at layouts/) provides structural layout implementations: Flex, Grid, Stack, Gallery, Split, and Bullseye.
For layout documentation, see Layout and Container Components.
The patternfly-java-icons module provides static factory methods in IconSets for accessing FontAwesome (fas, far, fab) and PatternFly icon sets. Icons are returned as PredefinedIcon instances — SVG element builders.
For icon details, see Icon System.
The patternfly-java-tokens module contains the generated Token enum class at org.patternfly.token.Token. Each constant exposes three fields: name (CSS custom property name, e.g. --pf-t--...), value (default value), and var (wrapped in var()).
For token details, see Design Tokens System.
The patternfly-java-charts module uses a hybrid architecture: Java builder classes (Donut, DonutUtilization, DonutThreshold, Bullet, Pie) that render via custom HTML elements (pfj-chart-*) backed by the @patternfly-java/charts npm package.
Charts require an external npm dependency unlike all other modules. For chart details, see Chart Components.
Sources: README.md88-103 components/pom.xml1-70 layouts/pom.xml1-53 icons/pom.xml1-104
All components follow a consistent fluent builder API pattern built on Elemento's type-safe HTML builder API. Base classes BaseComponent<E extends HTMLElement, B extends BaseComponent<E, B>> and BaseComponentSVG<E extends SVGElement, B extends BaseComponentSVG<E, B>> provide the foundation.
API method categories — consistent across all components
Example usage patterns:
Method naming conventions:
button(), card())add<SubComponentName>() (returns parent for chaining)flat(), rounded(), disabled()) (returns this)aria<Attribute>() (returns this)on<Event>() (returns this)Sources: README.md128-193
Components share behavior through inheritance and interface composition. This enables polymorphic usage and consistent APIs across the library.
Core component hierarchy and interfaces
Key interfaces and their role:
| Interface / Base Class | Package | Implemented By | Purpose |
|---|---|---|---|
BaseComponent<E, B> | org.patternfly.component | All HTML components | Element management, CSS class manipulation, ARIA attributes |
BaseComponentSVG<E, B> | org.patternfly.component | SVG icons (PredefinedIcon) | SVG element builder with path/viewBox management |
HasItems<E, C, S> | org.patternfly.component | DataList, Menu, Tabs, TreeView, Navigation, etc. | Add/remove/iterate/update child items; lifecycle handlers (onAdd, onRemove, onUpdate) |
HasIdentifier<E, B> | org.patternfly.component | MenuItem, Tab, Tr, NavigationItem, TreeViewItem, etc. | Unique identifier for retrieving item from parent collection |
ComponentContext | org.patternfly.core | Child components in HasItems relationships | Key/value storage per component instance |
Closeable | org.patternfly.component | Modal, Popover, Alert, Wizard | Close/dismiss lifecycle with onClose() handler registration |
Expandable | org.patternfly.component | Accordion, Navigation, TreeViewItem, ExpandableSection | Expand/collapse state with onToggle() handler |
Modifiers.* | org.patternfly.style | Various components | Mixin interfaces for single CSS modifier flags (e.g. Disabled, Plain, Compact) |
HasValue<T> | org.patternfly.component | TextInput, Checkbox, Switch, FormSelect | Read/write component value |
Ordered | org.patternfly.component | Menu, Table, others | Sorted item insertion via custom comparators |
For detailed documentation of these patterns, see Component Foundation and Collection Management.
Sources: README.md194-210 CHANGELOG.md51-52
| Topic | Page |
|---|---|
| Maven module structure in detail | Maven Project Structure |
| Adding patternfly-java to your project | Getting Started |
| Core architecture and base classes | Core Architecture |
| All UI components | Component Library |
| Chart components | Chart Components |
| GWT vs J2CL comparison | GWT vs J2CL |
| Build pipeline and CI/CD | Build System and Development |