{"id":20827995,"url":"https://github.com/esafirm/compose-ui-book","last_synced_at":"2025-10-26T02:19:49.300Z","repository":{"id":43354560,"uuid":"361358677","full_name":"esafirm/compose-ui-book","owner":"esafirm","description":"UI Component Explorer for Android","archived":false,"fork":false,"pushed_at":"2022-12-23T04:25:06.000Z","size":1484,"stargazers_count":74,"open_issues_count":6,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-05-07T21:06:38.147Z","etag":null,"topics":["android","hacktoberfest","showcase","ui","ui-explorer"],"latest_commit_sha":null,"homepage":"https://dashing-concha-94e896.netlify.app/","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/esafirm.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":null,"patreon":null,"open_collective":null,"ko_fi":"esafirm","tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":"https://karyakarsa.com/esafirm"}},"created_at":"2021-04-25T07:18:52.000Z","updated_at":"2025-03-13T19:51:44.000Z","dependencies_parsed_at":"2023-01-30T17:45:18.890Z","dependency_job_id":null,"html_url":"https://github.com/esafirm/compose-ui-book","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/esafirm/compose-ui-book","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/esafirm%2Fcompose-ui-book","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/esafirm%2Fcompose-ui-book/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/esafirm%2Fcompose-ui-book/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/esafirm%2Fcompose-ui-book/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/esafirm","download_url":"https://codeload.github.com/esafirm/compose-ui-book/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/esafirm%2Fcompose-ui-book/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271989880,"owners_count":24854702,"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-08-24T02:00:11.135Z","response_time":111,"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","hacktoberfest","showcase","ui","ui-explorer"],"created_at":"2024-11-17T23:13:33.037Z","updated_at":"2025-10-26T02:19:49.201Z","avatar_url":"https://github.com/esafirm.png","language":"Kotlin","funding_links":["https://ko-fi.com/esafirm","https://karyakarsa.com/esafirm","https://ko-fi.com/M4M41RRE0'"],"categories":[],"sub_categories":[],"readme":"# Compose UI Book\n\nSimple and extensible UI component explorer for Jetpack Compose and Android View\n\n\u003cp float=\"middle\"\u003e\n\t\u003cimg src=\".github/art/ss1.png\"/\u003e\n    \u003cimg src=\".github/art/ss2.png\"/\u003e\n\u003c/p\u003e\n\n\u003cdetails\u003e\n\t\u003csummary\u003eYou can check the demo video here\u003c/summary\u003e\n\t\u003ca href=\"https://youtu.be/HlDVACRC_68\"\u003e\n\t\t\u003cimg src=\"https://img.youtube.com/vi/HlDVACRC_68/0.jpg\" /\u003e\n\t\u003c/a\u003e\n\u003c/details\u003e\n\n## Getting Started\n\nUsually the UI component explorer is separated from the main app despite you have Android only or KMP project.\nSo the first thing you should do is to create a module with this `build.gradle.kts` (or `build.gradle` if you're using\nGroovy)\n\n### Setup Module - KMP\n\n```kotlin\nplugins {\n    id(\"com.android.application\")\n    id(\"org.jetbrains.kotlin.multiplatform\")\n    id(\"org.jetbrains.compose\")\n    id(\"com.google.devtools.ksp\")\n}\n\n// This could be in settings.gradle or root build.gradle\nrepositories {\n    mavenCentral()\n}\n\nkotlin {\n    jvm(\"desktop\")\n    android()\n\n    sourceSets {\n        named(\"commonMain\") {\n            dependencies {\n                implementation(\"io.github.esafirm.uibook:browser-app:x.y.z\")\n            }\n        }\n        named(\"androidMain\") {\n            dependencies {\n                // This is optional. If you use app compat then include this\n                implementation(\"androidx.appcompat:appcompat:1.3.1\")\n                implementation(\"com.google.android.material:material:1.4.0\")\n            }\n        }\n        named(\"desktopMain\") {\n            dependencies {\n                // This is mandatory as the current OS is not packaged in POM file\n                implementation(compose.desktop.currentOs)\n            }\n        }\n    }\n}\n\nandroid {\n    // Insert Android related configuration in here\n}\n\ncompose.desktop {\n    // Insert compose desktop related configuration in here\n}\n\ndependencies {\n    val processorDep = \"io.github.esafirm.uibook:annotations-processor:x.y.z\"\n    add(\"kspAndroid\", processorDep)\n    add(\"kspDesktop\", processorDep)\n}\n```\n\n\u003e :heavy_exclamation_mark: **Info**: Please check the [minimum KMP example](/examples/minimum-kmp) for more complete\n\u003e setup.\n\n### Setup Module - Android Only\n\n```kotlin\nplugins {\n    id(\"com.android.application\")\n    id(\"org.jetbrains.compose\")\n    id(\"com.google.devtools.ksp\")\n    kotlin(\"android\")\n}\n\nandroid {\n    // Insert Android related configuration in here\n}\n\ndependencies {\n    implementation(\"io.github.esafirm.uibook:browser-app:x.y.z\")\n    implementation(\"androidx.appcompat:appcompat:1.3.1\")\n    implementation(\"com.google.android.material:material:1.4.0\")\n\n    ksp(\"io.github.esafirm.uibook:annotations-processor:x:y:z\")\n}\n\n```\n\n\u003e :heavy_exclamation_mark: **Info**: Please check the [minimum android example](/examples/minimum-android) for more\n\u003e complete setup.\n\nchange `x.y.z` to version in the [release page](https://github.com/esafirm/android-ui-book/releases)\n\n### Create First Book\n\nTo create book simple create an extension function that extend `BookHost` and give the function `@UIBook`\nannotation.\nIn this case I will create a Kotlin file with name `Catalogue.kt` and then create this function:\n\n```kotlin\n@UIBook(name = \"Compose Button\")\n@Composable\nfun BookHost.SimpleCouter() {\n    val (count, setCount) = remember { mutableStateOf(0) }\n    Button(onClick = { setCount(count + 1) }) {\n        Text(text = \"Counter $count\")\n    }\n}\n```\n\nThat's it now run the new module that you just created.\n\n### Android View Support\n\nFor Android target, it supports the Android `View`, just add the return type to the function\n\n```kotlin\n@UIBook(name = \"Android TextView\")\nfun BookHost.SimpleTextView(): TextView {\n    /**\n     * This will draw text\n     */\n    return TextView(context).apply {\n        text = \"Hello World\"\n    }\n}\n```\n\n## Advanced\n\nYou can check the [demo module](/examples/demo) for complete features.\n\n## Development\n\nTo develop the project, you need to use Android Studio Dolphin above.\n\nIt have some strange issue with IntelliJ Idea 2022.3 EAP.\n\n### Running the Demo\n\nTo run the Android sample run this command:\n\n```bash\n./gradlew :examples:demo:installDebug\n```\n\nTo run the Desktop sample run this command:\n\n```bash\n./gradlew :examples:demo:run\n```\n\n## Support\n\n\u003ca href='https://ko-fi.com/M4M41RRE0' target='_blank'\u003e\u003cimg height='36' style='border:0px;height:36px;' src='https://cdn.ko-fi.com/cdn/kofi4.png?v=2' border='0' alt='Buy Me a Coffee at ko-fi.com' /\u003e\u003c/a\u003e\n\n## License\n\nEsa @ MIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fesafirm%2Fcompose-ui-book","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fesafirm%2Fcompose-ui-book","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fesafirm%2Fcompose-ui-book/lists"}