{"id":21444852,"url":"https://github.com/patternfly-java/patternfly-java","last_synced_at":"2026-04-01T19:47:09.935Z","repository":{"id":101623669,"uuid":"223204805","full_name":"patternfly-java/patternfly-java","owner":"patternfly-java","description":"PatternFly Java implementation","archived":false,"fork":false,"pushed_at":"2026-01-28T07:41:06.000Z","size":5218,"stargazers_count":31,"open_issues_count":38,"forks_count":6,"subscribers_count":3,"default_branch":"main","last_synced_at":"2026-01-28T23:39:11.990Z","etag":null,"topics":["elemento","gwt","hacktoberfest","j2cl","java","patternfly"],"latest_commit_sha":null,"homepage":"https://patternfly-java.github.io/","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/patternfly-java.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2019-11-21T15:27:02.000Z","updated_at":"2026-01-28T07:41:10.000Z","dependencies_parsed_at":"2025-12-18T02:08:55.688Z","dependency_job_id":null,"html_url":"https://github.com/patternfly-java/patternfly-java","commit_stats":null,"previous_names":[],"tags_count":38,"template":false,"template_full_name":null,"purl":"pkg:github/patternfly-java/patternfly-java","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patternfly-java%2Fpatternfly-java","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patternfly-java%2Fpatternfly-java/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patternfly-java%2Fpatternfly-java/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patternfly-java%2Fpatternfly-java/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/patternfly-java","download_url":"https://codeload.github.com/patternfly-java/patternfly-java/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patternfly-java%2Fpatternfly-java/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29046503,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-03T10:09:22.136Z","status":"ssl_error","status_checked_at":"2026-02-03T10:09:16.814Z","response_time":96,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["elemento","gwt","hacktoberfest","j2cl","java","patternfly"],"created_at":"2024-11-23T02:22:07.170Z","updated_at":"2026-04-01T19:47:09.922Z","avatar_url":"https://github.com/patternfly-java.png","language":"Java","funding_links":[],"categories":["UI Framework"],"sub_categories":[],"readme":"[![Verify Codebase](https://github.com/patternfly-java/patternfly-java/actions/workflows/verify.yml/badge.svg)](https://github.com/patternfly-java/patternfly-java/actions/workflows/verify.yml) [![Javadoc](https://img.shields.io/badge/JavaDoc-Online-green)](https://patternfly-java.github.io/apidocs/) [![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/patternfly-java/patternfly-java) [![Maven Central](https://img.shields.io/maven-central/v/org.patternfly/patternfly-java-parent)](https://central.sonatype.com/search?q=g%3Aorg.patternfly) ![GWT3/J2CL compatible](https://img.shields.io/badge/GWT3/J2CL-compatible-brightgreen.svg) [![Chat on Gitter](https://badges.gitter.im/patternfly-java/patternfly-java.svg)](https://app.gitter.im/#/room/#pf4-java_core:gitter.im)\n\nPatternFly Java is a 💯 Java implementation of [PatternFly](https://www.patternfly.org/) without any JavaScript dependencies (except for the [charts](#patternfly-javacharts)). Its goal is to provide an easy-to-use, elegant, and efficient API to build complex web applications with PatternFly in Java. PatternFly Java integrates with and builds upon Elemento's [builder API](https://github.com/hal/elemento#builder-api). It works with both GWT and J2CL. The following code snippet gives a taste of what PatternFly Java looks like:\n\n```java\nbody().add(page()\n        .addSkipToContent(skipToContent(\"main-id\"))\n        .addMasthead(masthead()\n                .addMain(mastheadMain()\n                        .addToggle(mastheadToggle())\n                        .addBrand(mastheadBrand()\n                                .addLogo(mastheadLogo(\"/\"))))\n                .addContent(mastheadContent()\n                        .addToolbar(toolbar())))\n        .addSidebar(pageSidebar()\n                .addBody(pageSidebarBody()\n                        .addNavigation(navigation(flat)\n                                .addItem(navigationItem(\"get-started\", \"Get started\", \"/get-started\"))\n                                .addItem(navigationItem(\"get-involved\", \"Get involved\", \"/get-involved\")))))\n        .addMain(pageMain(\"main-id\")\n                .addSection(pageSection()\n                        .add(content()\n                                .add(title(1, \"PatternFly - Java\"))\n                                .add(p()\n                                        .add(a(\"https://github.com/patternfly-java/patternfly-java\", \"_blank\")\n                                                .text(\"PatternFly Java\"))\n                                        .add(\" is a 💯 Java implementation of \")\n                                        .add(a(\"https://www.patternfly.org/\", \"_blank\")\n                                                .text(\"PatternFly\"))\n                                        .add(\" without any JavaScript dependencies based on GWT/J2CL and \")\n                                        .add(a(\"https://github.com/hal/elemento\", \"_blank\")\n                                                .text(\"Elemento\"))\n                                        .add(\".\"))))));\n```\n\nPatternFly Java aims to provide almost complete support for all components, charts, extensions, and layouts. To see it in action, head over to the [showcase](https://patternfly-java.github.io/). It demonstrates all currently supported components and layouts. To get all the details about using PatternFly Java, look at the [API documentation](https://patternfly-java.github.io/apidocs/).\n\n# Get started\n\nPatternFly Java is available on [Maven Central](https://central.sonatype.com/search?q=g%3Aorg.patternfly). The easiest way is to import its BOM\n\n```xml\n\u003cdependencyManagement\u003e\n    \u003cdependencies\u003e\n        \u003cdependency\u003e\n            \u003cgroupId\u003eorg.patternfly\u003c/groupId\u003e\n            \u003cartifactId\u003epatternfly-java-bom\u003c/artifactId\u003e\n            \u003cversion\u003e0.6.16\u003c/version\u003e\n            \u003ctype\u003epom\u003c/type\u003e\n            \u003cscope\u003eimport\u003c/scope\u003e\n        \u003c/dependency\u003e\n    \u003c/dependencies\u003e\n\u003c/dependencyManagement\u003e\n```\n\nand add a dependency to either\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003eorg.patternfly\u003c/groupId\u003e\n    \u003cartifactId\u003epatternfly-java-gwt\u003c/artifactId\u003e\n    \u003ctype\u003egwt-lib\u003c/type\u003e\n\u003c/dependency\u003e\n```\n\nor\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003eorg.patternfly\u003c/groupId\u003e\n    \u003cartifactId\u003epatternfly-java-j2cl\u003c/artifactId\u003e\n\u003c/dependency\u003e\n```\n\ndepending on your stack. If you're using GWT, inherit from `org.patternfly.PatternFly`:\n\n```xml\n\u003cmodule\u003e\n    \u003cinherits name=\"org.patternfly.PatternFly\"/\u003e\n\u003c/module\u003e\n```\n\n## JavaScript Dependencies\n\nPatternFly Java has **no JavaScript** dependencies. Everything necessary is included in the code base for both GWT and J2CL. The only exception is the charts package, which wraps PatternFly React Chart components as web components so they can be used from Java.\n\n```\nnpm install @patternfly-java/charts\n```\n\n```js\nimport \"@patternfly-java/charts/dist/charts\";\n```\n\n## Stylesheets\n\nPatternFly Java does **not** come with PatternFly styles. You have to provide them yourself. Please follow the PatternFly [getting started guide](https://www.patternfly.org/get-started/develop/#develop-with-htmlcss).\n\nIn addition, PatternFly Java defines a set of its own styles in the `core` and `extensions/finder` packages. Unlike other components that map to existing PatternFly components, the finder extension has no related PatternFly component and relies entirely on its own styles.\n\nAll NPM packages are published under the [`@patternfly-java`](https://www.npmjs.com/org/patternfly-java) scope and share the same version number as the Maven artifacts.\n\n### @patternfly-java/core\n\nBundles the PatternFly Java CSS stylesheets required by PatternFly Java components and layouts.\n\n```\nnpm install @patternfly-java/core\n```\n\n```js\nimport \"@patternfly-java/core\";\n```\n\n### @patternfly-java/finder\n\nProvides the CSS for the [finder](https://patternfly-java.github.io/extensions/finder) extension. Only needed if you use the finder component.\n\n```\nnpm install @patternfly-java/finder\n```\n\n```js\nimport \"@patternfly-java/finder\";\n```\n\n# Modules\n\nPatternFly Java consists of these Maven modules (a-z):\n\n| Module                     | Description           |\n|----------------------------|-----------------------|\n| patternfly-java-bom        | Bill of materials     |\n| patternfly-java-charts     | Charts                |\n| patternfly-java-codeeditor | Code editor extension |\n| patternfly-java-components | Components            |\n| patternfly-java-core       | Core classes          |\n| patternfly-java-finder     | Finder extension      |\n| patternfly-java-gwt        | GWT support           |\n| patternfly-java-icons      | Icons                 |\n| patternfly-java-j2cl       | J2CL support          |\n| patternfly-java-layouts    | Layouts               |\n| patternfly-java-tokens     | Tokens                |\n\nHere’s the dependency graph of these maven modules and their external dependencies:\n\n![Dependency graph](./dependency-graph.png)\n\n# API design\n\nPatternFly Java integrates with and builds upon Elemento's [builder API](https://github.com/hal/elemento#builder-api). Static factory methods are used to create the components, and public instance methods add child elements and modify the component.\n\nIn general, the API for a component can be classified into these groups:\n\n## Static factory methods\n\nThese methods are used to create a component. They are usually named after the component, are overloaded to accept required and optional arguments, and return an instance of the newly created component:\n\n```java\nButton button1 = button(\"Click me!\");\nButton button2 = button(\"PatternFly\", \"https://www.patternfly.org\");\n```\n\n## Add methods\n\nThese methods add subcomponents to a main component. They are usually called `add\u003cSubComponent\u003e()` and return the main component so that the method call can be chained with other methods.\n\n```java\nDropdown dropdown = dropdown()\n        .addToggle(menuToggle(\"Dropdown\"))\n        .addMenu(menu()\n                .addContent(menuContent()\n                        .addList(menuList()\n                                .addItem(actionMenuItem(\"item-0\", \"Action\")))));\n```\n\n## Builder / modifier methods\n\nThese methods modify the current component. They return the current component so that the method call can be chained with other methods.\n\n```java\nCard card = card()\n        .flat()\n        .rounded()\n        .large();\n```\n\n## ARIA-related methods\n\nThese methods set ARIA-related attributes in the component. They're usually named `aria\u003cAttribute\u003e()` and return the component so that the method call can be chained with other methods.\n\n```java\nNavigation navigation = navigation(flat)\n        .ariaScrollBackLabel(\"← back\")\n        .ariaScrollForwardLabel(\"→ forward\");\n```\n\n## Event handlers\n\nThese methods add event handlers for various events to the component. They are usually named `on\u003cEvent\u003e()`, accept an event handler, and return the component so that the method call can be chained with other methods. PatternFly Java defines some [common event handlers](https://patternfly-java.github.io/apidocs/org/patternfly/handler/package-summary.html) that are reused in all components. In some cases, components also use specific event handlers that only apply to the component.\n\n```java\nDrawer drawer = drawer().id(\"drw\")\n        .onToggle((e, c, expanded) -\u003e console.log(\"Drawer expanded: \" + expanded));\n```\n\n## Public API / getters\n\nThese methods do something with the component or return a value, a property, or some other kind of information. They return either `void` or a value/property.\n\n```java\nSwitch switch_ = switch_(\"id\", \"name\");\nboolean value = switch_.value();\n```\n\n## Common interfaces\n\nCommon behavior across all components is implemented by base classes and interfaces. All components extend from either [`BaseComponent`](https://patternfly-java.github.io/apidocs/org/patternfly/component/BaseComponent.html) or [`BaseComponentSVG`](https://patternfly-java.github.io/apidocs/org/patternfly/component/BaseComponentSVG.html). These base classes implement [interfaces from Elemento](https://hal-console.gitbook.io/elemento/builder-api#classes-and-interfaces) to manipulate the component element.\n\nIn addition, components implement these interfaces to provide a common API:\n\n- [`Modifiers.*`](https://patternfly-java.github.io/apidocs/org/patternfly/style/Modifiers.html)\u003cbr/\u003eThe sub-interfaces defined in this 'umbrella' interface are used to toggle one specific flag of a component. For example, `card().plain()` toggles the `plain` flag of the card component and is defined in the [`Modifiers.Plain`](https://patternfly-java.github.io/apidocs/org/patternfly/style/Modifiers.Plain.html) interface. Other components that also provide a `plain` flag implement the `Modifiers.Plain` interface as well.\n- [`Closable`](https://patternfly-java.github.io/apidocs/org/patternfly/component/Closeable.html)\u003cbr/\u003eImplemented by components that provide some kind of popup that can be closed. The interface provides methods to register event handlers when the popup is closed.\n- [`ComponentContext`](https://patternfly-java.github.io/apidocs/org/patternfly/core/ComponentContext.html), [`HasIdentifier`](https://patternfly-java.github.io/apidocs/org/patternfly/component/HasIdentifier.html), and [`HasItems`](https://patternfly-java.github.io/apidocs/org/patternfly/component/HasItems.html)\u003cbr/\u003eThese interfaces are often implemented by components that have a parent-child relationship, like [`DataList`](https://patternfly-java.github.io/apidocs/org/patternfly/component/list/DataList.html) and [`DataLiistItem`](https://patternfly-java.github.io/apidocs/org/patternfly/component/list/DataListItem.html). [`HasItems`](https://patternfly-java.github.io/apidocs/org/patternfly/component/HasItems.html) is implemented by the parent component and provides methods to add and remove child items. [`ComponentContext`](https://patternfly-java.github.io/apidocs/org/patternfly/core/ComponentContext.html) and [`HasIdentifier`](https://patternfly-java.github.io/apidocs/org/patternfly/component/HasIdentifier.html) are implemented by the child components and provide methods to store and retrieve arbitrary values and get a unique identifier for the child item.\n- [`ComponentIcon`](https://patternfly-java.github.io/apidocs/org/patternfly/component/ComponentIcon.html) and [`ComponentIconAndText`](https://patternfly-java.github.io/apidocs/org/patternfly/component/ComponentIconAndText.html)\u003cbr/\u003eThese interfaces are implemented by components that provide text resp. an icon and a text.\n- [`ComponentProgress`](https://patternfly-java.github.io/apidocs/org/patternfly/component/ComponentProgress.html)\u003cbr/\u003eImplemented by components that provide some kind of progress.\n- [`Expandable`](https://patternfly-java.github.io/apidocs/org/patternfly/component/Expandable.html)\u003cbr/\u003eImplemented by components that provide some kind of expandable content.\n- [`HasValue`](https://patternfly-java.github.io/apidocs/org/patternfly/component/HasValue.html) and [`HasObservableValue`](https://patternfly-java.github.io/apidocs/org/patternfly/component/HasObservableValue.html)\u003cbr/\u003eThese interfaces are implemented by components that provide a value or an observable value.\n\n---\n\nThe best way to experience the API is to take a look at the code snippets of the various components and layouts in the [showcase](https://patternfly-java.github.io/).\n\n# Icons\n\nPatternFly Java comes with predefined icons for\n\n- FontAwesome brand ([fab](https://fontawesome.com/search?o=r\u0026m=free\u0026f=brands))\n- FontAwesome regular ([far](https://fontawesome.com/search?o=r\u0026m=free\u0026s=regular))\n- FontAwesome solid ([fas](https://fontawesome.com/search?o=r\u0026m=free\u0026s=solid)) and\n- PatternFly icons ([patternfly](https://www.patternfly.org/design-foundations/icons/#patternfly-icons))\n\nThere are static factory methods in [`IconsSets`](https://patternfly-java.github.io/apidocs/org/patternfly/icon/IconSets.html) to easily use these icons. The icons are returned as instances of the [`PredefinedIcon`](https://patternfly-java.github.io/apidocs/org/patternfly/icon/PredefinedIcon.html) class, which is essentially an instance of an SVG builder and allows easy customization of the returned icon.\n\nComponents that support icons usually implement the interface [`WithIcon`](https://patternfly-java.github.io/apidocs/org/patternfly/component/WithIcon.html) or [`WithIconAndText`](https://patternfly-java.github.io/apidocs/org/patternfly/component/WithIconAndText.html) and thus use a common API.\n\n```java\nimport static org.patternfly.component.IconPosition.start;\nimport static org.patternfly.icon.IconSets.fas.book;\nimport static org.patternfly.icon.IconSets.fas.cube;\nimport static org.patternfly.icon.IconSets.fas.flag;\nimport static org.patternfly.icon.IconSets.fas.globe;\nimport static org.patternfly.icon.IconSets.fas.plusCircle;\nimport static org.patternfly.icon.IconSets.patternfly.key;\n\nDescriptionList dl = descriptionList()\n        .addGroup(descriptionListGroup()\n                .addTerm(descriptionListTerm(\"Name\").icon(cube()))\n                .addDescription(descriptionListDescription(\"Example\")))\n        .addGroup(descriptionListGroup()\n                .addTerm(descriptionListTerm(\"Namespace\").icon(book()))\n                .addDescription(descriptionListDescription()\n                        .add(a(\"#\").textContent(\"mary-test\"))))\n        .addGroup(descriptionListGroup()\n                .addTerm(descriptionListTerm(\"Labels\").icon(key()))\n                .addDescription(descriptionListDescription(\"example\")))\n        .addGroup(descriptionListGroup()\n                .addTerm(descriptionListTerm(\"Pod selector\").icon(globe()))\n                .addDescription(descriptionListDescription()\n                        .add(button().iconAndText(plusCircle(), \"app=MyApp\", start)\n                                .inline().link())))\n        .addGroup(descriptionListGroup()\n                .addTerm(descriptionListTerm(\"Annotation\").icon(flag()))\n                .addDescription(descriptionListDescription(\"2 annotations\")));\n```\n\nSee also the PatternFly website about [icons](https://www.patternfly.org/design-foundations/icons#all-icons) to get an overview of the available icons.\n\n# Tokens\n\nPatternFly Java comes with predefined enum constants for all PatternFly design [tokens](https://www.patternfly.org/tokens/about-tokens). They are defined in the enum class [`org.patternfly.token.Token`](https://patternfly-java.github.io/apidocs/org/patternfly/token/Token.html):\n\n```java\npublic enum Token {\n\n    // enum constants omitted\n    ;\n\n    /** The CSS custom property name starting with \u003ccode\u003e--pf-t\u003c/code\u003e */\n    public final String name;\n    /** The default value for the custom property. */\n    public final String value;\n    /** The property name wrapped in \u003ccode\u003evar()\u003c/code\u003e. */\n    public final String var;\n\n    Token(String name, String value, String var) {\n        this.name = name;\n        this.value = value;\n        this.var = var;\n    }\n}\n```\n\nHere's an example of how to use the token definitions:\n\n```java\nimport elemental2.dom.HTMLElement;\n\nimport static org.patternfly.token.Token.globalFontSizeSm;\nimport static org.patternfly.token.Token.globalTextColorDisabled;\n\nHTMLElement container = div()\n        .style(\"color\", globalTextColorDisabled.var)\n        .style(\"font-size\", globalFontSizeSm.var)\n        .element();\n```\n\n# PatternFly support\n\nPatternFly Java aims to provide almost complete support for all components, charts, extensions, and layouts. The following issues show how many components, charts, extensions, and layouts have already been implemented.\n\n- [components](https://github.com/patternfly-java/patternfly-java/issues/125)\n- [charts](https://github.com/patternfly-java/patternfly-java/issues/127)\n- [extensions](https://github.com/patternfly-java/patternfly-java/issues/126)\n- [layouts](https://github.com/patternfly-java/patternfly-java/issues/128)\n\n# Get involved\n\nPatternFly Java is still under development. The API might change, and things might not work as expected. Please give it a try and share your feedback. Join the [chat](https://app.gitter.im/#/room/#pf4-java_core:gitter.im), enter the [discussions](https://github.com/orgs/patternfly-java/discussions) or use the GitHub [issues](https://github.com/patternfly-java/patternfly-java/issues) to report bugs or request new features.\n\nOf course, you're welcome to [contribute](CONTRIBUTING.md) to PatternFly Java. If you like what you're seeing, leave us a star!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatternfly-java%2Fpatternfly-java","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpatternfly-java%2Fpatternfly-java","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatternfly-java%2Fpatternfly-java/lists"}