{"id":13609540,"url":"https://github.com/evant/compose-collapsable","last_synced_at":"2025-04-07T07:11:05.611Z","repository":{"id":205678237,"uuid":"714816391","full_name":"evant/compose-collapsable","owner":"evant","description":"A generic collapsable implementation with dragging and nested scrolling support","archived":false,"fork":false,"pushed_at":"2024-10-14T19:43:30.000Z","size":10240,"stargazers_count":104,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-31T05:09:06.885Z","etag":null,"topics":["android","compose"],"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/evant.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2023-11-05T22:12:19.000Z","updated_at":"2025-01-12T14:00:38.000Z","dependencies_parsed_at":"2024-01-08T02:02:20.318Z","dependency_job_id":"e939b5f0-16ed-442a-bb65-38c387fd0cc7","html_url":"https://github.com/evant/compose-collapsable","commit_stats":null,"previous_names":["evant/compose-collapsable"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evant%2Fcompose-collapsable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evant%2Fcompose-collapsable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evant%2Fcompose-collapsable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/evant%2Fcompose-collapsable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/evant","download_url":"https://codeload.github.com/evant/compose-collapsable/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247608151,"owners_count":20965952,"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":["android","compose"],"created_at":"2024-08-01T19:01:35.785Z","updated_at":"2025-04-07T07:11:05.590Z","avatar_url":"https://github.com/evant.png","language":"Kotlin","readme":"# compose-collapsable\n\nA generic collapsable implementation with dragging and nested scrolling support. This extracts and\nbuilds upon logic from the compose material 3 top app bar implementation.\n\n## Download\n\n```kotlin\nimplementation(\"me.tatarka.compose.collapsable:compose-collapsable:0.4.0\")\n```\n\n## Usage\n\nThis library is made up of a few main parts that you can pick-and-choose for your own collapsing ui\nimplementations.\n\n### CollapsableColumn\n\nLays out children in a column, allowing some of them to collapse. This is useful for simple cases\nlike an accordion or a top app bar that hides portions when it scrolls away.\n\n![Tab bar screenshot](/public/tab-bar.gif)\n![Accordion screenshot](/public/accordion.gif)\n\nFor example, a top app bar which hides it's title but pins tabs as you scroll the page can be \nimplemented as:\n\n```kotlin\nval collapsableBehavior = rememberCollapsableTopBehavior()\nScaffold(\n    modifier = Modifier.nestedScroll(collapsableBehavior.nestedScrollConnection),\n    topBar = {\n        CollapsableColumn(behavior = collapsableBehavior) {\n            TopAppBar(title = { Text(\"Title\") }, modifier = Modifier.collapse())\n            TabRow {\n               ... \n            }\n        }\n    }\n) { padding -\u003e\n    LazyColumn(contentPadding = padding) {\n        ...\n    }\n}\n```\n\n### CollapsableTopBehavior\n\nThe `CollapsableTopBehavior` above has 2 roles. It handles nested scrolling and drags on the\ncollapsable view itself. You can use these pieces independently in your own implementations. To\nhandle nested scrolling, use the `Modifier.nestedScroll()` modifier.\n\n```kotlin\nmodifier = Modifier.nestedScroll(collapsableBehavior.nestedScrollConnection)\n```\n\nand to handle dragging on the view use the provided `Modifier.draggable()` modifier.\n\n```kotlin\nmodifier = Modifier.draggable(collapsableBehavior)\n```\n\n### CollapsableBottomBehavior 🥺\n\nThere is also a `CollapsableBottomBehavior` that's used for collapsing down instead of up. \n\n### CollapsableState\n\n`CollapsableTopBehavior` holds a `CollapsableState` which manages the actual expand and collapse state.\nYou can use this state along with the behavior or by itself for your own more complex\ncollapsing implementations. See the CustomLayoutTopAppBar and ParallaxBackgroundTopAppBar examples\nin the sample app.\n\n![Custom Layout screenshot](/public/custom-top-bar.gif)\n![Motion Layout screenshot](/public/motion-layout.gif)\n","funding_links":[],"categories":["Kotlin"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevant%2Fcompose-collapsable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fevant%2Fcompose-collapsable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fevant%2Fcompose-collapsable/lists"}