{"id":24654994,"url":"https://github.com/silas00301/kotlin-htmx","last_synced_at":"2026-05-18T08:03:40.716Z","repository":{"id":247158209,"uuid":"825155225","full_name":"silas00301/kotlin-htmx","owner":"silas00301","description":"A Kotlin Multiplatform htmx library","archived":false,"fork":false,"pushed_at":"2024-08-11T14:27:38.000Z","size":293,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-21T01:43:46.339Z","etag":null,"topics":["htmx","kotlin","kotlin-multiplatform","kotlinx-html","ktor"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/silas00301.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2024-07-07T00:22:29.000Z","updated_at":"2024-08-11T15:52:18.000Z","dependencies_parsed_at":"2024-08-09T19:28:04.744Z","dependency_job_id":"d5387080-55f2-4036-a45b-c481d3860371","html_url":"https://github.com/silas00301/kotlin-htmx","commit_stats":null,"previous_names":["silas00301/kotlinx-htmx","silas00301/kotlin-htmx"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/silas00301/kotlin-htmx","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/silas00301%2Fkotlin-htmx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/silas00301%2Fkotlin-htmx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/silas00301%2Fkotlin-htmx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/silas00301%2Fkotlin-htmx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/silas00301","download_url":"https://codeload.github.com/silas00301/kotlin-htmx/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/silas00301%2Fkotlin-htmx/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33170445,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-18T05:43:36.989Z","status":"ssl_error","status_checked_at":"2026-05-18T05:43:19.133Z","response_time":71,"last_error":"SSL_read: 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":["htmx","kotlin","kotlin-multiplatform","kotlinx-html","ktor"],"created_at":"2025-01-25T22:20:13.128Z","updated_at":"2026-05-18T08:03:40.697Z","avatar_url":"https://github.com/silas00301.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Kotlin-Htmx\n\nKotlin-Htmx is a Kotlin DSL for the [htmx](https://htmx.org) library. It provides a type-safe way to generate htmx\nattributes and configuration.\n\n# Usage\n\nAs the goal of this library is to be usable with any Kotlin web framework, it does not provide any specific integration.\nInstead, it provides a few code snippets that have to be integrated into your project.\n\n- [kotlinx-html](#kotlinx-html)\n\n## kotlinx-html\n\nIf you are using kotlinx-html the following snippets can be used to integrate Kotlin-Htmx into your project.\n\n### Attributes\n\nIf you want to use a scope function to set the headers, you can use the following code snippet.\n\n```kotlin\nfun HTMLTag.hx(block: HtmxHtmlAttributes.() -\u003e Unit) = HtmxHtmlAttributes(attributes).block()\n```\n\nIf you want to set the headers using a property, you can use the following code snippet.\n\n```kotlin\nval HTMLTag.hx\n    get() = HtmxHtmlAttributes(attributes)\n```\n\n### Configuration\n\n```kotlin\nfun HEAD.htmxConfig(block: HtmxConfiguration.() -\u003e Unit) = meta {\n    name = \"htmx-config\"\n    content = HtmxConfiguration().apply(block).toConfigString()\n}\n```\n\n### CSS Classes\n\n```kotlin\nfun HTMLTag.hxClasses(block: HtmxCSSClasses.() -\u003e Unit) {\n    attributes[\"class\"] += HtmxCSSClasses().apply(block).classString\n}\n```\n\n### Headers\n\n#### Response Headers\n\n```kotlin\nfun RoutingResponse.hx(block: HtmxResponseHeaders.() -\u003e Unit) = mutableMapOf\u003cString, String\u003e().also {\n    HtmxResponseHeaders(it).apply(block)\n}.forEach(headers::append)\n```\n\n#### Request Headers\n\n```kotlin\nval RoutingRequest.hx\n    get() = HtmxRequestHeaders(headers.flattenEntries().toMap())\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsilas00301%2Fkotlin-htmx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsilas00301%2Fkotlin-htmx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsilas00301%2Fkotlin-htmx/lists"}