{"id":22048596,"url":"https://github.com/stevdza-san/messagebar-kmp","last_synced_at":"2025-04-13T08:33:25.854Z","repository":{"id":237270029,"uuid":"791390608","full_name":"stevdza-san/MessageBar-KMP","owner":"stevdza-san","description":"Compose Multiplatform UI Component used to display informative messages to the user.","archived":false,"fork":false,"pushed_at":"2025-04-03T15:10:35.000Z","size":163,"stargazers_count":73,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-03T16:24:23.593Z","etag":null,"topics":["android","compose-multiplatform","desktop","ios","jetpack-compose","kmp","kotlin","kotlin-multiplatform","kotlin-wasm","wasm"],"latest_commit_sha":null,"homepage":"https://stevdza-san.com","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/stevdza-san.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-04-24T16:25:36.000Z","updated_at":"2025-04-03T15:10:38.000Z","dependencies_parsed_at":"2024-05-03T11:49:51.831Z","dependency_job_id":"1da1bb49-4451-4275-84e7-6d14fe885556","html_url":"https://github.com/stevdza-san/MessageBar-KMP","commit_stats":null,"previous_names":["stevdza-san/messagebar-kmp"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stevdza-san%2FMessageBar-KMP","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stevdza-san%2FMessageBar-KMP/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stevdza-san%2FMessageBar-KMP/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stevdza-san%2FMessageBar-KMP/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stevdza-san","download_url":"https://codeload.github.com/stevdza-san/MessageBar-KMP/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248684330,"owners_count":21145058,"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-multiplatform","desktop","ios","jetpack-compose","kmp","kotlin","kotlin-multiplatform","kotlin-wasm","wasm"],"created_at":"2024-11-30T14:12:51.857Z","updated_at":"2025-04-13T08:33:25.844Z","avatar_url":"https://github.com/stevdza-san.png","language":"Kotlin","funding_links":["https://ko-fi.com/stevdza_san"],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://central.sonatype.com/artifact/com.stevdza-san/messagebarkmp\"\u003e\u003cimg alt=\"Profile\" src=\"https://badgen.net/badge/Maven Central/v1.0.7/blue?icon=github\"/\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n# \u003cp align=\"center\"\u003e☁️ MessageBar\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n👻 Message Bar is a simple animated UI component that you can wrap around your composable content.\nThis component is used to display Error/Success messages to your users,\nand it is built to support Material 3 design system. Android/iOS/Desktop/Web platforms are supported.\n\u003c/p\u003e\u003cbr\u003e\n\n\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://github.com/stevdza-san/MessageBarCompose/blob/master/previews/MessageBar.gif?raw=true\" width=\"268\"/\u003e\n\u003cimg src=\"https://github.com/stevdza-san/MessageBarCompose/blob/master/previews/MessageBar2.gif?raw=true\" width=\"268\"/\u003e\n\u003cimg src=\"https://github.com/stevdza-san/MessageBarCompose/blob/master/previews/MessageBar3.gif?raw=true\" width=\"268\"/\u003e\n\u003c/p\u003e\n\n### Gradle\n\nYou can add a dependency inside the `commonMain` source set:\n```gradle\ncommonMain.dependencies {\n    implementation(\"com.stevdza-san:messagebarkmp:1.0.7\")\n}\n```\n## Usage\n\nThere are two required parameters: `messageBarState` and `content`.\n\n```kotlin\nval state = rememberMessageBarState()\nContentWithMessageBar(messageBarState = state) {\n     // Your Composable Screen               \n}\n```\n\nYou can control what kind of a Message Bar you want to display, by using the `MessageBarState`.\nThere are two functions that you can use to achieve that: `addError()` and `addSuccess()`.\nThey are self explanatory, the first one accepts an Exception type, while the other a simple String.\ndepending on what kind of a message bar you want to see.\n\n### Message Bar - Success\n\u003cimg src=\"https://raw.githubusercontent.com/stevdza-san/MessageBarCompose/9644914665875997fd03aa18ef4cc1d9250c3e74/Success.svg\"/\u003e\n\n```kotlin\nval state = rememberMessageBarState()\nContentWithMessageBar(messageBarState = state) {\n    Column(\n        modifier = Modifier.fillMaxSize(),\n        verticalArrangement = Arrangement.Center,\n        horizontalAlignment = Alignment.CenterHorizontally\n    ) {\n        Button(onClick = {\n            state.addSuccess(message = \"Successfully Updated.\")\n        }) {\n            Text(text = \"Click me\")\n        }\n    }\n}\n```\n\n\n### Message Bar - Error\n\u003cimg src=\"https://raw.githubusercontent.com/stevdza-san/MessageBarCompose/9644914665875997fd03aa18ef4cc1d9250c3e74/Error.svg\"/\u003e\n\n```kotlin\nval state = rememberMessageBarState()\nContentWithMessageBar(messageBarState = state) {\n    Column(\n        modifier = Modifier.fillMaxSize(),\n        verticalArrangement = Arrangement.Center,\n        horizontalAlignment = Alignment.CenterHorizontally\n    ) {\n        Button(onClick = {\n            state.addError(exception = Exception(\"Internet Unavailable.\"))\n            // OR\n            // state.addError(\"Internet Unavailable.\")\n        }) {\n            Text(text = \"Click me\")\n        }\n    }\n}\n```\n\n## Like what you see? :yellow_heart:\n⭐ Give a star to this repository. \u003cbr /\u003e\n☕ Let's get a coffee. You're paying!😜 https://ko-fi.com/stevdza_san\n\n# License\n```xml\nDesigned and developed by stevdza-san (Stefan Jovanović)\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   http://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%2Fstevdza-san%2Fmessagebar-kmp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstevdza-san%2Fmessagebar-kmp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstevdza-san%2Fmessagebar-kmp/lists"}