{"id":13407091,"url":"https://github.com/chrisbanes/material3-windowsizeclass-multiplatform","last_synced_at":"2025-03-14T11:31:05.461Z","repository":{"id":176584466,"uuid":"656061208","full_name":"chrisbanes/material3-windowsizeclass-multiplatform","owner":"chrisbanes","description":"Material 3 Window Size Class for Compose Multiplatform","archived":true,"fork":false,"pushed_at":"2024-10-15T21:39:22.000Z","size":470,"stargazers_count":360,"open_issues_count":0,"forks_count":15,"subscribers_count":9,"default_branch":"main","last_synced_at":"2025-03-10T17:58:08.750Z","etag":null,"topics":[],"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/chrisbanes.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":"2023-06-20T07:25:51.000Z","updated_at":"2025-02-16T22:21:22.000Z","dependencies_parsed_at":null,"dependency_job_id":"33f708e2-880a-45e2-bed9-6580bd58702b","html_url":"https://github.com/chrisbanes/material3-windowsizeclass-multiplatform","commit_stats":null,"previous_names":["chrisbanes/material3-windowsizeclass-multiplatform"],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrisbanes%2Fmaterial3-windowsizeclass-multiplatform","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrisbanes%2Fmaterial3-windowsizeclass-multiplatform/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrisbanes%2Fmaterial3-windowsizeclass-multiplatform/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chrisbanes%2Fmaterial3-windowsizeclass-multiplatform/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chrisbanes","download_url":"https://codeload.github.com/chrisbanes/material3-windowsizeclass-multiplatform/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243569333,"owners_count":20312406,"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":"2024-07-30T20:00:19.571Z","updated_at":"2025-03-14T11:31:05.453Z","avatar_url":"https://github.com/chrisbanes.png","language":"Kotlin","funding_links":[],"categories":["Libraries","Uncategorized"],"sub_categories":["🍎 Compose UI","Uncategorized"],"readme":"# Deprecated\n\nThis library is now deprecated, as JetBrains have released their own version as part of [Compose Multiplatform 1.7.0](https://www.jetbrains.com/help/kotlin-multiplatform-dev/whats-new-compose-170.html#material3-material3-window-size-class). See the [tracking issue](https://github.com/chrisbanes/material3-windowsizeclass-multiplatform/issues/100) for more info.\n\n---\n\n\n[![Maven Central](https://img.shields.io/maven-central/v/dev.chrisbanes.material3/material3-window-size-class-multiplatform)](https://search.maven.org/search?q=g:dev.chrisbanes.material3) ![Build status](https://github.com/chrisbanes/material3-windowsizeclass-multiplatform/actions/workflows/build.yml/badge.svg)\n\n## Compose Multiplatform: Material 3 Window Size Class\n\nThe [Material 3 Window size classes](https://m3.material.io/foundations/layout/applying-layout/window-size-classes) are a set of  opinionated breakpoints, the window size at which a layout needs to change to match available space, device conventions, and ergonomics. All devices fall into one of three Material Design window size classes: compact, medium, or expanded. Rather than designing for an ever increasing number of display states, focusing on window class sizes ensures layouts work across a range of devices.\n\nThe `androidx.compose.material3:material3-window-size-class` library is available for Jetpack Compose, but it is not currently available for Compose Multiplatform. This library changes that, by providing the [WindowSizeClass](https://developer.android.com/reference/kotlin/androidx/compose/material3/windowsizeclass/WindowSizeClass) for many of the platforms supported by Compose Multiplatform.\n\n| Platform      | Supported        | Sample                                                                                                            |\n|---------------|------------------|-------------------------------------------------------------------------------------------------------------------|\n| Android       | ✅                | [android-app](https://github.com/chrisbanes/material3-windowsizeclass-multiplatform/tree/main/sample/android-app) |\n| iOS           | ✅                | [ios-app](https://github.com/chrisbanes/material3-windowsizeclass-multiplatform/tree/main/sample/ios-app)         |\n| Desktop (JVM) | ✅                | [desktop-app](https://github.com/chrisbanes/material3-windowsizeclass-multiplatform/tree/main/sample/desktop-app) |\n| Web           | ✅ (experimental) | [web-js-app](https://github.com/chrisbanes/material3-windowsizeclass-multiplatform/tree/main/sample/web-js-app) [web-wasm-app](https://github.com/chrisbanes/material3-windowsizeclass-multiplatform/tree/main/sample/web-wasm-app)         |\n\n## Usage\n\nUsage is very simple:\n\n```kotlin\nimport androidx.compose.material3.windowsizeclass.calculateWindowSizeClass\n\n@Composable\nfun MyApplication() {\n    val windowSizeClass = calculateWindowSizeClass()\n\n    // Example of how to change the font size based on the screen width\n    val fontSize = when (windowSizeClass.widthSizeClass) {\n        WindowWidthSizeClass.Compact -\u003e 16.sp\n        WindowWidthSizeClass.Medium -\u003e 24.sp\n        else -\u003e 30.sp\n    }\n\n    Column( /* ... */) {  \n        Box (/* ... */){\n            Image (/* ... */)\n            Text (fontSize = fontSize)\n        }\n    }\n}\n```\n\nYou'll note that I have kept the package name the same as that in AndroidX. This is to enable easy migration for when support is added to Compose Multiplatform ([tracking issue](https://github.com/JetBrains/compose-multiplatform/issues/2404)).\n\n## Download\n\n[![Maven Central](https://img.shields.io/maven-central/v/dev.chrisbanes.material3/material3-window-size-class-multiplatform)](https://central.sonatype.com/namespace/dev.chrisbanes.material3)\n\n```kotlin\nval commonMain by getting {\n    dependencies {\n        implementation(\"dev.chrisbanes.material3:material3-window-size-class-multiplatform:0.5.0\")\n    }\n}\n```\n\n## License\n\n```\nCopyright 2022 The Android Open Source Project\nPortions 2023 Christopher Banes\n \nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    https://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchrisbanes%2Fmaterial3-windowsizeclass-multiplatform","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchrisbanes%2Fmaterial3-windowsizeclass-multiplatform","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchrisbanes%2Fmaterial3-windowsizeclass-multiplatform/lists"}