BadgeIcon is a SwiftUI library that lets you create beautiful, scalable icons, using SF Symbols or custom assets:
BadgeIcon comes with 49 predefined icons, and lets you create custom icons with rich customization options.
BadgeIcon can be installed with the Swift Package Manager:
https://github.com/danielsaidi/BadgeIcon.git
You can become a sponsor to help me dedicate more time on my various open-source tools. Every contribution, no matter the size, makes a real difference in keeping these tools free and actively developed.
BadgeIcon has 49 predefined icons, like .alert
, .bug
, and .heart
, which will scale to fill the available space:
struct ContentView: View {
var body: some View {
BadgeIcon.calendar
BadgeIcon.heart.frame(width: 150)
}
}
You can also create your own badge icons, with a rich set of icon and badge style options:
extension BadgeIcon {
public static let prominentError = Self(
icon: MyCustomErrorIcon(),
style: .init(
badgeColor: .red
)
)
}
You can use both Image
values or custom views as the icon that is shown inside the badge.
The online documentation has more information, articles, code examples, etc.
Feel free to reach out if you have questions or want to contribute in any way:
- Website: danielsaidi.com
- E-mail: daniel.saidi@gmail.com
- Bluesky: @danielsaidi@bsky.social
- Mastodon: @danielsaidi@mastodon.social
BadgeIcon is available under the MIT license. See the LICENSE file for more info.