{"id":28646803,"url":"https://github.com/iodesystems/kotlinx-htmx","last_synced_at":"2025-06-13T02:07:10.171Z","repository":{"id":213895345,"uuid":"735195068","full_name":"IodeSystems/kotlinx-htmx","owner":"IodeSystems","description":"Htmx plugin for kotlinx-html","archived":false,"fork":false,"pushed_at":"2025-06-12T13:37:25.000Z","size":151,"stargazers_count":20,"open_issues_count":9,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-12T14:44:00.855Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/IodeSystems.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"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}},"created_at":"2023-12-24T02:23:52.000Z","updated_at":"2025-03-27T18:39:10.000Z","dependencies_parsed_at":"2024-02-19T19:31:39.790Z","dependency_job_id":"a0192923-100f-41e1-ab63-43fe328fe111","html_url":"https://github.com/IodeSystems/kotlinx-htmx","commit_stats":null,"previous_names":["iodesystems/kotlinx-htmx"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/IodeSystems/kotlinx-htmx","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IodeSystems%2Fkotlinx-htmx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IodeSystems%2Fkotlinx-htmx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IodeSystems%2Fkotlinx-htmx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IodeSystems%2Fkotlinx-htmx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/IodeSystems","download_url":"https://codeload.github.com/IodeSystems/kotlinx-htmx/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IodeSystems%2Fkotlinx-htmx/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259565562,"owners_count":22877347,"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":[],"created_at":"2025-06-13T02:07:04.600Z","updated_at":"2025-06-13T02:07:10.160Z","avatar_url":"https://github.com/IodeSystems.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# kotlinx-htmx\n\nEver wanted to... build (?) your no-build web application in kotlin?\n\n`kotlinx-htmx` supports 100% of the apis from [htmx.org](https://htmx.org/) on top of `kotlinx.html`.\n\n## TL;DR\n```kotlin\ndata class Counter(val count: Int)\n@PostMapping(\"/counter\")\nfun counterButton(\n  @RequestBody counter: Counter = Counter(0)\n) = Htmx {\n  if (counter.count \u003e 0) {\n    // Let the indicator show!\n    Thread.sleep(1.seconds.toJavaDuration())\n  }\n  div{\n    id = \"counter\"\n    div{\n      id = \"indicator\"\n      +\"Loading...\"\n    }\n    button {\n      hx {\n        post(\"/counter\")\n        swap()\n        indicator(\"#indicator\")\n        trigger {\n          click()\n          queue(HtmxTrigger.Queue.first)\n          vals(objectMapper.writeValueAsString(counter.copy(count = counter.count + 1)))\n        }\n      }\n      +\"Click Count ${counter.count}\"\n    }\n  }\n}\n```\nSee the `example` project for more details.\n\n## Installation\nMaven:\n```xml\n\u003c!-- file: pom.xml--\u003e\n\u003cdependencies\u003e\n  ...\n  \u003cdependency\u003e\n    \u003cgroupId\u003ecom.iodesystems.kotlinx-htmx\u003c/groupId\u003e\n    \u003cartifactId\u003ehtmx\u003c/artifactId\u003e\n    \u003cversion\u003e${check-mvn-repository}\u003c/version\u003e\n  \u003c/dependency\u003e\n  \u003c!-- If you want to use it with spring-web --\u003e\n  \u003cdependency\u003e\n    \u003cgroupId\u003ecom.iodesystems.kotlinx-htmx\u003c/groupId\u003e\n    \u003cartifactId\u003espring\u003c/artifactId\u003e\n    \u003cversion\u003e${check-mvn-repository}\u003c/version\u003e\n  \u003c/dependency\u003e\n  ...\n\u003c/dependencies\u003e\n```\n\nGradle:\n```kotlin\n// file: build.gradle.kts\nrepositories {\n    mavenCentral()\n}\ndependencies {\n    implementation(\"com.iodesystems.kotlinx-htmx:htmx:${check-mvn-repository}\")\n    // If you want to use it with spring-web\n    implementation(\"com.iodesystems.kotlinx-htmx:spring:${check-mvn-repository}\")\n}\n```\n\n## Spring Integration\nTo be able to return `Htmx` from your controller, you need to add `HtmxHttpMessageConverter` to your `WebMvcConfigurer`:\n```kotlin\n@Configuration\nopen class WebConfig : WebMvcConfigurer {\n  override fun extendMessageConverters(converters: MutableList\u003cHttpMessageConverter\u003c*\u003e\u003e) {\n    converters.add(0, HtmxHttpMessageConverter())\n  }\n}\n```\n\n# License\n\nMIT License\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiodesystems%2Fkotlinx-htmx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiodesystems%2Fkotlinx-htmx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiodesystems%2Fkotlinx-htmx/lists"}