{"id":13396439,"url":"https://github.com/DanielMartinus/konfetti","last_synced_at":"2025-03-13T23:31:07.110Z","repository":{"id":41094959,"uuid":"86191112","full_name":"DanielMartinus/Konfetti","owner":"DanielMartinus","description":"Celebrate more with this lightweight confetti particle system 🎊","archived":false,"fork":false,"pushed_at":"2024-08-19T17:57:39.000Z","size":4928,"stargazers_count":3165,"open_issues_count":20,"forks_count":300,"subscribers_count":48,"default_branch":"main","last_synced_at":"2024-10-29T15:10:40.394Z","etag":null,"topics":["android","android-animation","android-ui","animations","canvas","compose","kotlin","particle-system","particles","party"],"latest_commit_sha":null,"homepage":"","language":"Kotlin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DanielMartinus.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":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-03-25T21:58:25.000Z","updated_at":"2024-10-28T17:48:36.000Z","dependencies_parsed_at":"2022-07-16T05:30:42.531Z","dependency_job_id":"5c1773eb-4b89-455e-b0bd-ba609695e639","html_url":"https://github.com/DanielMartinus/Konfetti","commit_stats":{"total_commits":798,"total_committers":28,"mean_commits":28.5,"dds":0.3721804511278195,"last_synced_commit":"6183596b5fbdd2c1fc6ea2656c85da8f883f3f51"},"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DanielMartinus%2FKonfetti","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DanielMartinus%2FKonfetti/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DanielMartinus%2FKonfetti/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DanielMartinus%2FKonfetti/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DanielMartinus","download_url":"https://codeload.github.com/DanielMartinus/Konfetti/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243499956,"owners_count":20300725,"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","android-animation","android-ui","animations","canvas","compose","kotlin","particle-system","particles","party"],"created_at":"2024-07-30T18:00:51.646Z","updated_at":"2025-03-13T23:31:07.101Z","avatar_url":"https://github.com/DanielMartinus.png","language":"Kotlin","readme":"\u003c!-- LOGO --\u003e\n\u003cbr /\u003e\n\u003ch1\u003e\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://user-images.githubusercontent.com/1636897/147644327-112cc446-75ea-4477-80ac-1d0cd60fc45e.png\" alt=\"Logo\"\u003e\n\u003c/h1\u003e\n\u003cp align=\"center\"\u003e\n    Easily celebrate little and big moments in your app with this lightweight confetti library!\n    \u003cbr /\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://opensource.org/licenses/ISC\"\u003e\u003cimg alt=\"License\" src=\"https://img.shields.io/badge/License-ISC-yellow.svg\"/\u003e\u003c/a\u003e\n    \u003ca href=\"https://android-arsenal.com/api?level=16s\"\u003e\u003cimg alt=\"API level 16\" src=\"https://img.shields.io/badge/API-16%2B-brightgreen.svg?style=flat\"/\u003e\u003c/a\u003e\n    \u003ca href=\"http://twitter.com/dionsegijn\"\u003e\u003cimg alt=\"API level 16\" src=\"https://img.shields.io/badge/Twitter-@dionsegijn-blue.svg?style=flat\"/\u003e\u003c/a\u003e\n    \u003ca href=\"https://github.com/DanielMartinus/Konfetti/actions\"\u003e\u003cimg alt=\"Build Status\" src=\"https://github.com/DanielMartinus/Konfetti/workflows/CI/badge.svg\"/\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"#getting-started\"\u003eGetting started\u003c/a\u003e •\n  \u003ca href=\"#usage\"\u003eHow To Use\u003c/a\u003e •\n  \u003ca href=\"#community\"\u003eCommunity\u003c/a\u003e •\n  \u003ca href=\"#contribute\"\u003eContribute\u003c/a\u003e •\n  \u003ca href=\"#report-an-issue\"\u003eReport issue\u003c/a\u003e •\n  \u003ca href=\"#license\"\u003eLicense\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cstrong\u003eNew version: 2.0.0 is now released! Jetpack compose support - improved animations and API - \u003ca href=\"https://dionsegijn.dev/konfetti-migration-guide-v2.x.x\"\u003esee migration guide here\u003c/a\u003e\u003c/strong\u003e\n\u003c/p\u003e\n\n## Getting started\n\nCompose project:\n```groovy\ndependencies {\n    implementation 'nl.dionsegijn:konfetti-compose:2.0.5'\n}\n```\n\nView based (XML) project:\n```groovy\ndependencies {\n    implementation 'nl.dionsegijn:konfetti-xml:2.0.5'\n}\n```\n\nFind latest version and release notes [here](https://github.com/DanielMartinus/Konfetti/releases)\n\n## Usage\n\n\u003cp align=\"center\"\u003e\n  \u003cstrong\u003eSamples:\u003c/strong\u003e\u003c/br\u003e\n  \u003ca href=\"/samples/compose-kotlin/src/main\"\u003ecompose\u003c/a\u003e •\n  \u003ca href=\"/samples/xml-kotlin/src/main\"\u003exml-kotlin\u003c/a\u003e •\n  \u003ca href=\"/samples/xml-java/src/main\"\u003exml-java\u003c/a\u003e •\n  \u003ca href=\"/samples/shared/src/main/java/nl/dionsegijn/samples/shared/Presets.kt\"\u003epresets\u003c/a\u003e\n\u003c/p\u003e  \n\n\u003cp align=\"center\"\u003e\n  \u003cimg width=300 src=\"https://user-images.githubusercontent.com/1636897/147699597-2d177073-a2f8-4f49-ad7e-c390dd374557.gif\"/\u003e\n\u003c/p\u003e\n\nConfigure your confetti using the Party configuration object. This holds all the information on how the confetti will be generated.\nAlmost all properties of a Party object have a default configuration! This makes it super easy to create beautiful and natural looking confetti.\n\n\nThe bare minimum you need is an **Emitter** to tell how often and how many confetti should spawn, like this:\n```kotlin\nParty(\n    emitter = Emitter(duration = 5, TimeUnit.SECONDS).perSecond(30)\n)\n```\n\n**But the possibilities are endless!** You can fully control how the confetti will be generated and behave by customizing the values of the Party object.\nAn example of a customized Party configuration is this:\n\n```kotlin\nParty(\n    speed = 0f,\n    maxSpeed = 30f,\n    damping = 0.9f,\n    spread = 360,\n    colors = listOf(0xfce18a, 0xff726d, 0xf4306d, 0xb48def),\n    position = Position.Relative(0.5, 0.3),\n    emitter = Emitter(duration = 100, TimeUnit.MILLISECONDS).max(100)\n)\n```\n_To learn more, see more samples linked at the top of [this section](#usage)_\n\n### Party options\n\n- `Angle` - **Int (default: 0)**: The direction the confetti will shoot. Use any integer between `0-360` or use presets like: Angle.TOP, Angle.RIGHT, Angle.BOTTOM, Angle.LEFT. Angle.RIGHT equates to `0` degrees, and larger values move clockwise from this position.\n- `spread` - **Int (default: 360)**: How wide the confetti will shoot in the direction of Angle. Use any integer between `0-360`. Use 1 to shoot in a straight line and 360 to form a circle\n- `speed` - **Float (default: 30f)**: The start speed of the confetti at the time of creation.\n- `maxSpeed` - **Float (default: 0f)**: Set to -1 to disable maxSpeed. A random speed between `speed` and `maxSpeed` will be chosen. Using randomness creates a more natural and realistic look to the confetti when animating.)\n- `damping` - **Float (default: 0.9f)**: The rate at which the speed will decrease right after shooting the confetti\n- `size` - **`List\u003cSize\u003e` (default: SMALL, MEDIUM, LARGE)**: The size of the confetti. Use: Size.SMALL, MEDIUM or LARGE for default sizes or\n create your custom size using a new instance of `Size`.\n- `colors` - **`List\u003cInt\u003e` (default: 0xfce18a, 0xff726d, 0xf4306d, 0xb48def)**: List of colors that will be randomly picked from\n- `shapes` - **`List\u003cShape\u003e` (default: Shape.Square, Shape.Circle)**: Or use a custom shape with `Shape.DrawableShape`\n- `timeToLive` - **Long (default: 2000)**: The time in milliseconds a particle will stay alive after that the confetti will disappear.\n- `fadeOutEnabled` - **Boolean (default: true)**: If true and a confetti disappears because it ran out of time (set with timeToLive) it will slowly fade out. If set to falls it will instantly disappear from the screen.\n- `position` - **Position (default: Position.Relative(0.5, 0.5))**: the location where the confetti will spawn from relative to the canvas. Use absolute\n coordinates with `[Position.Absolute]` or relative coordinates between 0.0 and 1.0 using `[Position.Relative]`. Spawn confetti between random locations using `[Position.between]`.\n - `delay` - **Int (default: 0)**: the amount of milliseconds to wait before the rendering of the confetti starts\n - `rotation` - **Rotation (default: Rotation)**: enable the 3D rotation of a Confetti. See [Rotation] class for the configuration\n options. Easily enable or disable it using [Rotation].enabled() or [Rotation].disabled() and control the speed of rotations.\n - `emitter` - **EmitterConfig**: Instructions how many and how often a confetti particle should spawn. Use Emitter(duration, timeUnit).max(amount) or Emitter(duration, timeUnit).perSecond(amount) to configure the Emitter. \n\nSee Party implementation [here](/konfetti/core/src/main/java/nl/dionsegijn/konfetti/core/Party.kt)\n\n### KonfettiView\n\nCreate a `KonfettiView` in your compose UI or add one to your xml layout depending on your setup.\n\nCompose\n```Kotlin\nKonfettiView(\n    modifier = Modifier.fillMaxSize(),\n    parties = state.party,\n)\n```\n\nView-based (xml)\n```xml\n\u003cnl.dionsegijn.konfetti.xml.KonfettiView\n    android:id=\"@+id/konfettiView\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\" /\u003e\n```\n\n```kotlin\nParty(\n    speed = 0f,\n    maxSpeed = 30f,\n    damping = 0.9f,\n    spread = 360,\n    colors = listOf(0xfce18a, 0xff726d, 0xf4306d, 0xb48def),\n    emitter = Emitter(duration = 100, TimeUnit.MILLISECONDS).max(100),\n    position = Position.Relative(0.5, 0.3)\n)\nviewKonfetti.start(party)\n```\n\nAnd that's it! There are endless possibilities to configure the confetti. If you want to learn more on how to implement Konfetti in a java, xml or compose project then see the samples linked at the top of [this section](#usage)\n\n## Community\n\n- Follow me on twitter for updates [here](https://twitter.com/dionsegijn)\n- Do you have any questions or need help implementing this library? Search if your question is already asked [here](https://github.com/DanielMartinus/Konfetti/issues?q=is%3Aissue)\n- Or join our telegram chat group and maybe someone can help you out [here](https://t.me/konfetti_chat) \n\n## Contribute\n\nDo you see any improvements or want to implement a missing feature? Contributions are very welcome!\n- Is your contribution relatively small? You can, make your changes, run the code checks, open a PR and make sure the CI is green. That's it! \n- Are the changes big and do they make a lot of impact? Please open an issue [here](https://github.com/DanielMartinus/Konfetti/issues?q=is%3Aissue) or reach out and let's discuss.\n\nTake into account that changes and requests can be rejected if they don't align with the **purpose of the library**. To not waste any time you can always open an issue [here](https://github.com/DanielMartinus/Konfetti/issues?q=is%3Aissue) to talk before you start making any changes.\n\n### What is the purpose of this library?\nTo have a lightweight particle system to easily generate confetti particles to celebrate little and big moments. Even though this is a particle system the purpose is not to be a fully fledged particle system. Changes and features are meant to be in line with being a confetti library. A great example is the implementation of custom shapes by @mattprecious [here](https://github.com/DanielMartinus/Konfetti/pull/129).\n\n## Report an issue\n\n- Did you find an issue and want to fix it yourself? See [Contribute](#contribute) for more information\n- Want to report an issue? You can do that [here](https://github.com/DanielMartinus/Konfetti/issues?q=is%3Aissue). By adding as much details when reporting the issue and steps to reproduce you improve the change it will be solved quickly. \n\n## License\n\nKonfetti is released under the ISC license. See [LICENSE](https://github.com/DanielMartinus/Konfetti/blob/main/LICENSE) for details.\n","funding_links":[],"categories":["Index `(light-weight pages)`","Index"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDanielMartinus%2Fkonfetti","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FDanielMartinus%2Fkonfetti","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FDanielMartinus%2Fkonfetti/lists"}