{"id":15134887,"url":"https://github.com/jetbrains/jewel","last_synced_at":"2025-10-04T16:40:28.675Z","repository":{"id":64059760,"uuid":"440164967","full_name":"JetBrains/jewel","owner":"JetBrains","description":"An implementation of the IntelliJ look and feels in Compose for Desktop","archived":false,"fork":false,"pushed_at":"2024-10-29T11:55:06.000Z","size":19234,"stargazers_count":726,"open_issues_count":93,"forks_count":39,"subscribers_count":28,"default_branch":"main","last_synced_at":"2024-10-29T13:33:59.425Z","etag":null,"topics":["compose","desktop","intellij","kotlin","laf","look-and-feel","multiplatform","swing","theme","ui"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","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/JetBrains.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-12-20T12:37:14.000Z","updated_at":"2024-10-28T03:17:12.000Z","dependencies_parsed_at":"2024-01-17T12:12:31.409Z","dependency_job_id":"90f08220-0007-48e5-9eb4-f074f7572b01","html_url":"https://github.com/JetBrains/jewel","commit_stats":{"total_commits":532,"total_committers":27,"mean_commits":"19.703703703703702","dds":0.6654135338345865,"last_synced_commit":"70bd8e79b4cef882ccee12e2846f03832da36f0a"},"previous_names":[],"tags_count":115,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JetBrains%2Fjewel","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JetBrains%2Fjewel/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JetBrains%2Fjewel/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JetBrains%2Fjewel/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JetBrains","download_url":"https://codeload.github.com/JetBrains/jewel/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248837274,"owners_count":21169373,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["compose","desktop","intellij","kotlin","laf","look-and-feel","multiplatform","swing","theme","ui"],"created_at":"2024-09-26T05:40:27.972Z","updated_at":"2025-10-04T16:40:23.620Z","avatar_url":"https://github.com/JetBrains.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![JetBrains incubator](https://img.shields.io/badge/JetBrains-incubator-yellow?logo=data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzIuMDAwMDEiIHZpZXdCb3g9IjAgMCAzMiAzMi4wMDAwMSIgd2lkdGg9IjMyIj48c2NyaXB0IHhtbG5zPSIiLz48cGF0aCBkPSJtMCAwaDMydjMyLjAwMDAxaC0zMnoiLz48cGF0aCBkPSJtNCAyNi4wMDAwMWgxMnYyaC0xMnoiIGZpbGw9IiNmZmYiLz48L3N2Zz4=)](https://github.com/JetBrains#jetbrains-on-github) [![CI checks](https://img.shields.io/github/actions/workflow/status/JetBrains/jewel/build.yml?logo=github)](https://github.com/JetBrains/jewel/actions/workflows/build.yml) [![Licensed under Apache 2.0](https://img.shields.io/github/license/JetBrains/jewel?logo=data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGZpbGw9Im5vbmUiIHN0cm9rZT0iI0ZGRiIgdmlld0JveD0iMCAwIDI0IDI0Ij48cGF0aCBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIHN0cm9rZS13aWR0aD0iMiIgZD0ibTMgNiAzIDFtMCAwLTMgOWE1LjAwMiA1LjAwMiAwIDAgMCA2LjAwMSAwTTYgN2wzIDlNNiA3bDYtMm02IDIgMy0xbS0zIDEtMyA5YTUuMDAyIDUuMDAyIDAgMCAwIDYuMDAxIDBNMTggN2wzIDltLTMtOS02LTJtMC0ydjJtMCAxNlY1bTAgMTZIOW0zIDBoMyIvPjwvc3ZnPg==)](https://github.com/JetBrains/jewel/blob/main/LICENSE) [![Latest release](https://img.shields.io/github/v/release/JetBrains/jewel?include_prereleases\u0026label=Latest%20Release\u0026logo=github)](https://github.com/JetBrains/jewel/releases/latest) ![Compose for Desktop version](https://img.shields.io/badge/Compose%20for%20Desktop-1.6.0-dev1369?logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPHN2ZyB2aWV3Qm94PSIwIDAgNjcgNzQiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI%2BPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0zNS45OTkgMi42NjNhNS4wMSA1LjAxIDAgMCAwLTQuOTk4IDBsLTI2LjUgMTUuMjUzYTQuOTk0IDQuOTk0IDAgMCAwLTEuMTk4Ljk2MmwxMS4xMDggNi4zNjZjLjI2OC0uMjkuNTgtLjU0LjkzMS0uNzQ0bDE2LjE1Ni05LjM0MmE0IDQgMCAwIDEgNC4wMDQgMEw1MS42NTcgMjQuNWMuMzUxLjIwMy42NjQuNDU1LjkzMi43NDRsMTEuMTA4LTYuMzY2YTQuOTkxIDQuOTkxIDAgMCAwLTEuMTk4LS45NjJsLTI2LjUtMTUuMjUzWm0yOC43MjMgMTcuOTMzLTExLjE4MyA2LjQwOGMuMDc2LjMxLjExNi42MzIuMTE2Ljk1OXYxNy43OTRhNCA0IDAgMCAxLTEuOTU4IDMuNDRsLTE2LjIzNSA5LjYzOGEzLjk5OCAzLjk5OCAwIDAgMS0uOTYyLjQxMnYxMi42M2E1LjAwNSA1LjAwNSAwIDAgMCAxLjQyOC0uNTY5bDI2LjYyLTE1LjczQTQuOTg2IDQuOTg2IDAgMCAwIDY1IDUxLjI4NFYyMi4yMzdjMC0uNTY3LS4wOTctMS4xMi0uMjc4LTEuNjRaTTIgMjIuMjM3YzAtLjU2Ny4wOTctMS4xMi4yNzgtMS42NGwxMS4xODMgNi40MDdjLS4wNzYuMzEtLjExNi42MzItLjExNi45NTl2MTguNjMzYTQgNCAwIDAgMCAyLjA4IDMuNTA5bDE2LjA3NCA4LjhjLjMyLjE3NC42NTYuMzAyIDEuMDAxLjM4NHYxMi42MzhhNS4wMDUgNS4wMDUgMCAwIDEtMS41MTctLjUzM0w0LjYwMyA1Ny4wMkE0Ljk4NyA0Ljk4NyAwIDAgMSAyIDUyLjY0MlYyMi4yMzdaTTMwLjAwMi45MzVhNy4wMTQgNy4wMTQgMCAwIDEgNi45OTYgMGwyNi41IDE1LjI1M0E2Ljk4IDYuOTggMCAwIDEgNjcgMjIuMjM4djI5LjA0N2E2Ljk4IDYuOTggMCAwIDEtMy40MzMgNi4wMDlsLTI2LjYyIDE1LjczMWE3LjAxNCA3LjAxNCAwIDAgMS02LjkyMy4xMkwzLjY0NCA1OC43NzFBNi45ODEgNi45ODEgMCAwIDEgMCA1Mi42NDFWMjIuMjM4YTYuOTggNi45OCAwIDAgMSAzLjUwMi02LjA1TDMwLjAwMi45MzZabS04LjYwNCAyNy41NTIgMTAuNTgyLTYuMTFjLjk0LS41NDIgMi4xLS41NDIgMy4wNCAwbDEwLjU4MiA2LjExYTIuOTk2IDIuOTk2IDAgMCAxIDEuNTAzIDIuNTkzdjExLjY1M2MwIDEuMDU2LS41NiAyLjAzNC0xLjQ3MyAyLjU3NmwtMTAuNjQzIDYuMzA4YTMuMDQ0IDMuMDQ0IDAgMCAxLTMuMDA5LjA1MmwtMTAuNTItNS43NWEyLjk5NiAyLjk5NiAwIDAgMS0xLjU2NS0yLjYyN1YzMS4wOGMwLTEuMDY4LjU3My0yLjA1NiAxLjUwMy0yLjU5M1oiIGZpbGw9IiNmZmYiLz48L3N2Zz4%3D)\n\n# Jewel: a Compose for Desktop theme\n\n\u003cimg alt=\"Jewel logo\" src=\"art/jewel-logo.svg\" width=\"20%\"/\u003e\n\nJewel aims at recreating the IntelliJ Platform's _New UI_ Swing Look and Feel in Compose for Desktop, providing a\ndesktop-optimized theme and set of components.\n\n\u003e [!CAUTION]\n\u003e Jewel is moving to the IntelliJ Platform! All active development will move to \n\u003e https://github.com/JetBrains/intellij-community and this repository will just mirror that.\n\u003e More information to follow soon — but please **consider the code on this repository as read-only**.\n\n---\n\n\u003e [!WARNING]\n\u003e\n\u003e This project is in active development, and caution is advised when considering it for production uses. You _can_ use\n\u003e it, but you should expect APIs to change often, things to move around and/or break, and all that jazz. Binary\n\u003e compatibility is not guaranteed across releases, and APIs are still in flux and subject to change.\n\u003e\n\u003e Writing 3rd party IntelliJ Plugins in Compose for Desktop is currently **not officially supported** by the IntelliJ\n\u003e Platform. It should work, but your mileage may vary, and if things break you're on your own.\n\u003e\n\u003e Use at your own risk!\n\nJewel provides an implementation of the IntelliJ Platform themes that can be used in any Compose for Desktop\napplication. Additionally, it has a Swing LaF Bridge that only works in the IntelliJ Platform (i.e., used to create IDE\nplugins), but automatically mirrors the current Swing LaF into Compose for a native-looking, consistent UI.\n\n\u003e [!TIP]\n\u003e \u003ca href=\"https://www.droidcon.com/2023/11/15/meet-jewelcreate-ide-plugins-in-compose/\"\u003e\n\u003e \u003cimg src=\"https://i.vimeocdn.com/video/1749849437-f275e0337faca5cedab742ea157abbafe5a0207d3a59db891a72b6180ce13a6c-d?mh=120\" align=\"left\" /\u003e\n\u003e \u003c/a\u003e\n\u003e\n\u003e If you want to learn more about Jewel and Compose for Desktop and why they're a great, modern solution for your\n\u003e desktop\n\u003e UI needs, check out [this talk](https://www.droidcon.com/2023/11/15/meet-jewelcreate-ide-plugins-in-compose/) by Jewel\n\u003e contributors Sebastiano and Chris.\n\u003e\n\u003e It covers why Compose is a viable choice, and an overview of the Jewel project, plus\n\u003e some real-life use cases.\u003cbr clear=\"left\" /\u003e\n\n\u003cbr/\u003e\n\n## Getting started\n\nThe first thing to add is the necessary Gradle plugins, including the Compose Multiplatform plugin. You need to add a\ncustom repository for it in `settings.gradle.kts`:\n\n```kotlin\npluginManagement {\n    repositories {\n        google()\n        gradlePluginPortal()\n        maven(\"https://maven.pkg.jetbrains.space/public/p/compose/dev\")\n        mavenCentral()\n    }\n}\n```\n\nThen, in your app's `build.gradle.kts`:\n\n```kotlin\nplugins {\n    // MUST align with the Kotlin and Compose dependencies in Jewel\n    kotlin(\"jvm\") version \"...\"\n    id(\"org.jetbrains.compose\") version \"...\"\n}\n\nrepositories {\n    maven(\"https://packages.jetbrains.team/maven/p/kpm/public/\")\n    // Any other repositories you need (e.g., mavenCentral())\n}\n```\n\n\u003e [!WARNING]\n\u003e If you use convention plugins to configure your project you might run into issues such as\n\u003e [this](https://github.com/JetBrains/compose-multiplatform/issues/3748). To solve it, make sure the\n\u003e plugins are only initialized once — for example, by declaring them in the root `build.gradle.kts`\n\u003e with `apply false`, and then applying them in all the submodules that need them.\n\nTo use Jewel in your app, you only need to add the relevant dependency. There are two scenarios: standalone Compose for\nDesktop app, and IntelliJ Platform plugin.\n\nIf you're writing a **standalone app**, then you should depend on the latest `int-ui-standalone-*` artifact:\n\n```kotlin\ndependencies {\n    // See https://github.com/JetBrains/Jewel/releases for the release notes\n    implementation(\"org.jetbrains.jewel:jewel-int-ui-standalone-[latest platform version]:[jewel version]\")\n\n    // Optional, for custom decorated windows:\n    implementation(\"org.jetbrains.jewel:jewel-int-ui-decorated-window-[latest platform version]:[jewel version]\")\n\n    // Do not bring in Material (we use Jewel)\n    implementation(compose.desktop.currentOs) {\n        exclude(group = \"org.jetbrains.compose.material\")\n    }\n}\n```\n\nFor an **IntelliJ Platform plugin**, then you should depend on the appropriate `ide-laf-bridge-*` artifact:\n\n```kotlin\ndependencies {\n    // See https://github.com/JetBrains/Jewel/releases for the release notes\n    // The platform version is a supported major IJP version (e.g., 232 or 233 for 2023.2 and 2023.3 respectively)\n    implementation(\"org.jetbrains.jewel:jewel-ide-laf-bridge-[platform version]:[jewel version]\")\n\n    // Do not bring in Material (we use Jewel) and Coroutines (the IDE has its own)\n    api(compose.desktop.currentOs) {\n        exclude(group = \"org.jetbrains.compose.material\")\n        exclude(group = \"org.jetbrains.kotlinx\")\n    }\n}\n```\n\n\u003cbr/\u003e\n\n\u003e [!TIP]\n\u003e It's easier to use version catalogs — you can use the Jewel [version catalog](gradle/libs.versions.toml) as reference.\n\n\u003cbr/\u003e\n\n## Using ProGuard/obfuscation/minification\n\nJewel doesn't officially support using ProGuard to minimize and/or obfuscate your code, and there is currently no plan\nto.\nThat said, people are reporting successes in using it. Please note that there is no guarantee that it will keep working,\nand you most definitely need to have some rules in place. We don't provide any official rule set, but these have been\nknown\nto work for some: https://github.com/romainguy/kotlin-explorer/blob/main/compose-desktop.pro\n\n\u003e [!IMPORTANT]\n\u003e We won't accept bug reports for issues caused by the use of ProGuard or similar tools.\n\n## Dependencies matrix\n\nJewel is in continuous development and we focus on supporting only the Compose version we use internally.\nYou can see the latest supported version\nin [libs.versions.toml](https://github.com/JetBrains/jewel/blob/main/gradle/libs.versions.toml).\n\nDifferent versions of Compose are not guaranteed to work with different versions of Jewel.\n\nThe Compose Compiler version used is the latest compatible with the given Kotlin version. See\n[here](https://developer.android.com/jetpack/androidx/releases/compose-compiler) for the Compose\nCompiler release notes, which indicate the compatibility.\n\nThe minimum supported Kotlin version is dictated by the minimum supported IntelliJ IDEA platform.\n\n## Project structure\n\nThe project is split in modules:\n\n1. `buildSrc` contains the build logic, including:\n    * The `jewel` and `jewel-publish` configuration plugins\n    * The `jewel-check-public-api` and `jewel-linting` configuration plugins\n    * The Theme Palette generator plugin\n    * The Studio Releases generator plugin\n2. `foundation` contains the foundational Jewel functionality:\n    * Basic components without strong styling (e.g., `SelectableLazyColumn`, `BasicLazyTree`)\n    * The `JewelTheme` interface with a few basic composition locals\n    * The state management primitives\n    * The Jewel annotations\n    * A few other primitives\n3. `ui` contains all the styled components and custom painters logic\n4. `decorated-window` contains basic, unstyled functionality to have custom window decoration on the JetBrains Runtime\n5. `int-ui` contains two modules:\n    * `int-ui-standalone` has a standalone version of the Int UI styling values that can be used in any Compose for\n      Desktop app\n    * `int-ui-decorated-window` has a standalone version of the Int UI styling values for the custom window decoration\n      that can be used in any Compose for Desktop app\n6. `ide-laf-bridge` contains the Swing LaF bridge to use in IntelliJ Platform plugins (see more below)\n7. `markdown` contains a few modules:\n    * `core` the core logic for parsing and rendering Markdown documents with Jewel, using GitHub-like styling\n    * `extension` contains several extensions to the base CommonMark specs that can be used to add more features\n    * `ide-laf-bridge-styling` contains the IntelliJ Platform bridge theming for the Markdown renderer\n    * `int-ui-standalone-styling` contains the standalone Int UI theming for the Markdown renderer\n8. `samples` contains the example apps, which showcase the available components:\n    * `standalone` is a regular CfD app, using the standalone theme definitions and custom window decoration\n    * `ide-plugin` is an IntelliJ plugin that showcases the use of the Swing Bridge\n\n## Branching strategy and IJ Platforms\n\nCode on the main branch is developed and tested against the current latest IntelliJ Platform version.\n\nWhen the EAP for a new major version starts, we cut a `releases/xxx` release branch, where `xxx` is the tracked major\nIJP version. At that point, the main branch starts tracking the latest available major IJP version, and changes are\ncherry-picked into each release branch as needed. All active release branches have the same functionality (where\nsupported by the corresponding IJP version), but might differ in platform version-specific fixes and internals.\n\nThe standalone Int UI theme will always work the same way as the latest major IJP version; release branches will not\ninclude the `int-ui` module, which is always released from the main branch.\n\nReleases of Jewel are always cut from a tag on the main branch; the HEAD of each `releases/xxx` branch is then tagged\nas `[mainTag]-xxx`, and used to publish the artifacts for that major IJP version.\n\n\u003e [!IMPORTANT]\n\u003e We only support the latest build of IJP for each major IJP version. If the latest 233 version is 2023.3.3, for\n\u003e example, we will only guarantee that Jewel works on that. Versions 2023.3.0–2023.3.2 might or might not work.\n\n\u003e [!CAUTION]\n\u003e When you target Android Studio, you might encounter issues due to Studio shipping its own (older) version of Jewel\n\u003e and Compose for Desktop. If you want to target Android Studio, you'll need to shadow the CfD and Jewel dependencies\n\u003e until that dependency isn't leaked on the classpath by Studio anymore. You can look at how the\n\u003e [Package Search](https://github.com/JetBrains/package-search-intellij-plugin) plugin implements shadowing.\n\n## Int UI Standalone theme\n\nThe standalone theme can be used in any Compose for Desktop app. You use it as a normal theme, and you can customise it\nto your heart's content. By default, it matches the official Int UI specs.\n\nFor an example on how to set up a standalone app, you can refer to\nthe [`standalone` sample](samples/standalone/build.gradle.kts).\n\n\u003e [!WARNING]\n\u003e Note that Jewel **requires** the JetBrains Runtime to work correctly. Some features like font loading depend on it,\n\u003e as it has extra features and patches for UI functionalities that aren't available in other JDKs.\n\u003e We **do not support** running Jewel on any other JDK.\n\nTo use Jewel components in a non-IntelliJ Platform environment, you need to wrap your UI hierarchy in a `IntUiTheme`\ncomposable:\n\n```kotlin\nIntUiTheme(isDark = false) {\n    // ...\n}\n```\n\nIf you want more control over the theming, you can use other `IntUiTheme` overloads, like the standalone sample does.\n\n### Custom window decoration\n\nThe JetBrains Runtime allows windows to have a custom decoration instead of the regular title bar.\n\n![A screenshot of the custom window decoration in the standalone sample](art/docs/custom-chrome.png)\n\nThe standalone sample app shows how to easily get something that looks like a JetBrains IDE; if you want to go _very_\ncustom, you only need to depend on the `decorated-window` module, which contains all the required primitives, but not\nthe Int UI styling.\n\nTo get an IntelliJ-like custom title bar, you need to pass the window decoration styling to your theme call, and add the\n`DecoratedWindow` composable at the top level of the theme:\n\n```kotlin\nIntUiTheme(\n    theme = themeDefinition,\n    styling = ComponentStyling.default().decoratedWindow(\n        titleBarStyle = TitleBarStyle.light()\n    ),\n) {\n    DecoratedWindow(\n        onCloseRequest = { exitApplication() },\n    ) {\n        // ...\n    }\n}\n```\n\n## Running on the IntelliJ Platform: the Swing bridge\n\nJewel includes a crucial element for proper integration with the IDE: a bridge between the Swing components — theme\nand LaF — and the Compose world.\n\nThis bridge ensures that we pick up the colours, typography, metrics, and images as defined in the current IntelliJ\ntheme, and apply them to the Compose components as well. This means Jewel will automatically adapt to IntelliJ Platform\nthemes that use the [standard theming](https://plugins.jetbrains.com/docs/intellij/themes-getting-started.html)\nmechanisms.\n\n\u003e [!NOTE]\n\u003e IntelliJ themes that use non-standard mechanisms (such as providing custom UI implementations for Swing components)\n\u003e are not, and can never, be supported.\n\nIf you're writing an IntelliJ Platform plugin, you should use the `SwingBridgeTheme` instead of the standalone theme:\n\n```kotlin\nSwingBridgeTheme {\n    // ...\n}\n```\n\n### Supported IntelliJ Platform versions\n\nTo use Jewel in the IntelliJ Platform, you should depend on the appropriate `jewel-ide-laf-bridge-*` artifact, which\nwill bring in the necessary transitive dependencies. These are the currently supported versions of the IntelliJ Platform\nand the branch on which the corresponding bridge code lives:\n\n| IntelliJ Platform version(s) | Branch to use           |\n|------------------------------|-------------------------|\n| 2024.3 (EAP 6+)              | `main`                  |\n| 2024.2 (beta 1+)             | `releases/242`          |\n| 2024.1 (EAP 3+)              | `releases/241`          |\n| 2023.3 (**archived**)        | `archived-releases/233` |\n| 2023.2 (**archived**)        | `archived-releases/232` |\n| 2023.1 or older              | **Not supported**       |\n\nFor an example on how to set up an IntelliJ Plugin, you can refer to\nthe [`ide-plugin` sample](samples/ide-plugin/build.gradle.kts).\n\n## Icons\n\nLoading icons is best done with the `Icon` composable, which offers a key-based API that is portable across bridge and\nstandalone modules. Icon keys implement the `IconKey` interface, which is then internally used to obtain a resource path\nto load the icon from.\n\n```kotlin\nIcon(key = MyIconKeys.myIcon, contentDescription = \"My icon\")\n```\n\n### Loading icons from the IntelliJ Platform\n\nIf you want to load an IJ platform icon, you can use `AllIconsKeys`, which is generated from the `AllIcons` platform\nfile. When using this in an IJ plugin, make sure you are using a version of the Jewel library matching the platform\nversion, because icons are known to shift between major versions — and sometimes, minor versions, too.\n\nTo use icons from `AllIconsKeys` in an IJ plugin, you don't need to do anything, as the icons are in the classpath by\ndefault. If you want to use icons in a standalone app, you'll need to make sure the icons you want are on the classpath.\nYou can either copy the necessary icons in your resources, matching exactly the path they have in the IDE, or you can\nadd a dependency to the `com.jetbrains.intellij.platform:icons` artifact, which contains all the icons that end up in\n`AllIconsKeys`. The latter is the recommended approach, since it's easy and the icons don't take up much disk space.\n\nAdd this to your **standalone app** build script:\n\n```kotlin\ndependencies {\n    implementation(\"com.jetbrains.intellij.platform:icons:[ijpVersion]\")\n    // ...\n}\n\nrepositories {\n    // Choose either of these two, depending on whether you're using a stable IJP or not\n    maven(\"https://www.jetbrains.com/intellij-repository/releases\")\n    maven(\"https://www.jetbrains.com/intellij-repository/snapshots\")\n}\n```\n\n\u003e [!NOTE]\n\u003e If you are targeting an IntelliJ plugin, you don't need this additional setup since the icons are provided by the\n\u003e platform itself.\n\n### Loading your own icons\n\nTo access your own icons, you'll need to create and maintain the `IconKey`s for them. We found that the easiest way when\nyou have up to a few dozen icons is to manually create an icon keys holder, like the ones we have in our samples. If you\nhave many more, you should consider generating these holders, instead.\n\nIn your holders, you can choose which implementation of `IconKey` to use:\n* If your icons do not need to change between old UI and new UI, you can use the simpler `PathIconKey`\n* If your icons are different in old and new UI, you should use `IntelliJIconKey`, which accepts two paths, one per\n  variant\n* If you have different needs, you can also implement your own version of `IconKey`\n\n### Painter hints\n\nJewel has an API to influence the loading and drawing of icons, called `PainterHint`. `Icon` composables have overloads\nthat take zero, one or more `PainterHint`s that will be used to compute the end result that shows up on screen.\n\n`PainterHint`s can change the icon path (by adding a prefix/suffix, or changing it completely), tweak the contents of an\nimage (SVG patching, XML patching, bitmap patching), add decorations (e.g., badges), or do nothing at all (`None`). We\nhave several types of built-in `PainterHint`s which should cover all needs; if you find some use case that is not yet\nhandled, please file a feature request and we'll evaluate it.\n\nBoth standalone and bridge themes provide a default set of implicit `PainterHint`s, for example to implement runtime\npatching, like the IDE does. You can also use `PainterHint`s to affect how an icon will be drawn, or to select a\nspecific icon file, based on some criteria (e.g., `Size`).\n\nIf you have a _stateful_ icon, that is if you need to display different icons based on some state, you can use the\n`Icon(..., hint)` and `Icon(..., hints)` overloads. You can then use one of the state-mapping `PainterHint` to let\nJewel load the appropriate icon automatically:\n\n```kotlin\n// myState implements SelectableComponentState and has a ToggleableState property\nval indeterminateHint = \n    if (myState.toggleableState == ToggleableState.Indeterminate) {\n        IndeterminateHint\n    } else {\n        PainterHint.None\n    }\n    \nIcon(\n    key = myKey,\n    contentDescription = \"My icon\",\n    indeterminateHint,\n    Selected(myState),\n    Stateful(myState),\n)\n```\n\nWhere the `IndeterminateHint` looks like this:\n\n```kotlin\nprivate object IndeterminateHint : PainterSuffixHint() {\n    override fun suffix(): String = \"Indeterminate\"\n}\n```\n\nAssuming the PainterProvider has a base path of `components/myIcon.svg`, Jewel will automatically translate it to the\nright path based on the state. If you want to learn more about this system, look at the `PainterHint` interface and its\nimplementations.\n\nPlease look at the `PainterHint` implementations and our samples for further information.\n\n### Default icon runtime patching\n\nJewel emulates the under-the-hood machinations that happen in the IntelliJ Platform when loading icons. Specifically,\nthe resource will be subject to some transformations before being loaded. This is built on the `PainterHint` API we\ndescribed above.\n\nFor example, in the IDE, if New UI is active, the icon path may be replaced with a different one. Some key colors in SVG\nicons will also be replaced based on the current theme. See\n[the docs](https://plugins.jetbrains.com/docs/intellij/work-with-icons-and-images.html#new-ui-icons).\n\nBeyond that, even in standalone, Jewel will pick up icons with the appropriate dark/light variant for the current theme,\nand for bitmap icons it will try to pick the 2x variants based on the `LocalDensity`.\n\n## Fonts\n\nTo load a system font, you can obtain it by its family name:\n\n```kotlin\nval myFamily = FontFamily(\"My Family\")\n```\n\nIf you want to use a font embedded in the JetBrains Runtime, you can use the `EmbeddedFontFamily` API instead:\n\n```kotlin\nimport javax.swing.text.StyledEditorKit.FontFamilyAction\n\n// Will return null if no matching font family exists in the JBR\nval myEmbeddedFamily = EmbeddedFontFamily(\"Embedded family\")\n\n// It's recommended to load a fallback family when dealing with embedded familes\nval myFamily = myEmbeddedFamily ?: FontFamily(\"Fallback family\")\n```\n\nYou can obtain a `FontFamily` from any `java.awt.Font` — including from `JBFont`s — by using the `asComposeFontFamily()`\nAPI:\n\n```kotlin\nval myAwtFamily = myFont.asComposeFontFamily()\n\n// This will attempt to resolve the logical AWT font\nval myLogicalFamily = Font(\"Dialog\").asComposeFontFamily()\n\n// This only works in the IntelliJ Platform,\n// since JBFont is only available there\nval myLabelFamily = JBFont.label().asComposeFontFamily()\n```\n\n## Swing interoperability\n\nAs this is Compose for Desktop, you get a good degree of interoperability with Swing. To avoid glitches and z-order\nissues, you should enable the\n[experimental Swing rendering pipeline](https://blog.jetbrains.com/kotlin/2023/08/compose-multiplatform-1-5-0-release/#enhanced-swing-interop)\nbefore you initialize Compose content.\n\nThe `ToolWindow.addComposeTab()` extension function provided by the `ide-laf-bridge` module will take care of that for\nyou. However, if you want to also enable it in other scenarios and in standalone applications, you can call the\n`enableNewSwingCompositing()` function in your Compose entry points (that is, right before creating a `ComposePanel`).\n\n\u003e [!NOTE]\n\u003e The new Swing rendering pipeline is experimental and may have performance repercussions when using infinitely\n\u003e repeating animations. This is a known issue by the Compose Multiplatform team, that requires changes in the Java\n\u003e runtime to fix. Once the required changes are made in the JetBrains Runtime, we'll remove this notice.\n\n## Written with Jewel\n\nHere is a small selection of projects that use Compose for Desktop and Jewel:\n\n* [Package Search](https://github.com/JetBrains/package-search-intellij-plugin) (IntelliJ Platform plugin)\n* [Kotlin Explorer](https://github.com/romainguy/kotlin-explorer) (standalone app)\n* New task-based Profiler UI in Android Studio Koala\n* ...and more to come!\n\n## Throubleshooting\n\n### Git push hook is not working?\n\nOn git push you see:\n\n```bash\nerror: cannot spawn .git/hooks/pre-push: No such file or directory\nerror: waitpid for (NULL) failed: No child processes\n```\n\nTry running `git lfs update --force`.\n\n## Need help?\n\nYou can find help on the [`#jewel`](https://app.slack.com/client/T09229ZC6/C05T8U2C31T) channel on the Kotlin Slack.\nIf you don't already have access to the Kotlin Slack, you can request it\n[here](https://surveys.jetbrains.com/s3/kotlin-slack-sign-up).\n\n## License\n\nJewel is licensed under the [Apache 2.0 license](https://github.com/JetBrains/jewel/blob/main/LICENSE).\n\n```\nCopyright 2022–4 JetBrains s.r.o.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjetbrains%2Fjewel","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjetbrains%2Fjewel","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjetbrains%2Fjewel/lists"}