{"id":17069648,"url":"https://github.com/vinc3m1/litho-kotlin","last_synced_at":"2025-09-06T09:41:29.895Z","repository":{"id":142290063,"uuid":"115232291","full_name":"vinc3m1/litho-kotlin","owner":"vinc3m1","description":"Kotlin DSL for Litho ComponentLayout Builders.","archived":false,"fork":false,"pushed_at":"2018-07-18T23:48:50.000Z","size":28,"stargazers_count":39,"open_issues_count":0,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-12T18:29:36.910Z","etag":null,"topics":["android","android-library","kotlin","kotlin-dsl","kotlin-library","litho"],"latest_commit_sha":null,"homepage":null,"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/vinc3m1.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,"zenodo":null}},"created_at":"2017-12-24T01:24:43.000Z","updated_at":"2023-02-11T03:45:41.000Z","dependencies_parsed_at":null,"dependency_job_id":"45fbda06-cd4a-44fc-a076-465002862424","html_url":"https://github.com/vinc3m1/litho-kotlin","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/vinc3m1/litho-kotlin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vinc3m1%2Flitho-kotlin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vinc3m1%2Flitho-kotlin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vinc3m1%2Flitho-kotlin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vinc3m1%2Flitho-kotlin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vinc3m1","download_url":"https://codeload.github.com/vinc3m1/litho-kotlin/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vinc3m1%2Flitho-kotlin/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273886624,"owners_count":25185507,"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","status":"online","status_checked_at":"2025-09-06T02:00:13.247Z","response_time":2576,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["android","android-library","kotlin","kotlin-dsl","kotlin-library","litho"],"created_at":"2024-10-14T11:27:29.409Z","updated_at":"2025-09-06T09:41:29.885Z","avatar_url":"https://github.com/vinc3m1.png","language":"Kotlin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Litho Kotlin\nKotlin DSL for [Litho](https://fblitho.com) `Component.Builder`s.\n\n# Usage\n\n## Import\n1. Copy [`Litho.kt`](https://raw.githubusercontent.com/vinc3m1/litho-kotlin/master/src/main/kotlin/com/makeramen/litho/Litho.kt) into your project under `com/makeramen/litho`.\n2. Add any definitions for your own custom components, e.g.\n    ```kotlin\n    @LithoMarker\n    fun myComponent(c: ComponentContext, init: MyComponent.Builder.() -\u003e Unit) =\n        componentBuilder(c, MyComponent::create, init)\n\n    @LithoMarker\n    fun ChildHolder.myComponent(c: ComponentContext, init: MyComponent.Builder.() -\u003e Unit) =\n        componentBuilder(c, MyComponent::create, init)\n    ```\n3. Remove any definitions you don't want to use, like `recyclerCollectionComponent` if you're not using [Sections](https://fblitho.com/docs/sections-intro).\n\nI may look into a proper Maven Central release in the future, but it's just one file, and extensibility for custom components is the best part.\n\n## Example\n\n```kotlin\n@LayoutSpec\nobject ExampleComponentSpec {\n\n  @OnCreateLayout\n  fun onCreateLayout(c: ComponentContext): Component {\n    return column(c) {               // Init root Components by passing in the context\n      paddingDip(YogaEdge.ALL, 8f)   // Attributes can be defined inline within the lambda\n      children {                     // Add children using a children element\n        text {                       // ComponentBuilders within a children element don't need a context\n          text(\"TWO\")\n          textSizeDip(16f)\n        }\n        text {\n          text(\"THREE\")\n          textSizeDip(16f)\n        }\n      }\n    }\n  }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvinc3m1%2Flitho-kotlin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvinc3m1%2Flitho-kotlin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvinc3m1%2Flitho-kotlin/lists"}