Lucide offers over 1,700 icons for SwiftUI, rendered as native shapes without the need for UIKit bindings. Each icon is a SwiftUI.Shape created from pure code, ensuring high quality and zero runtime dependencies. With type-safe options and automatic updates that track upstream releases, Lucide provides a seamless and efficient way to enhance SwiftUI applications.
Lucide icons for SwiftUI offer a comprehensive library of over 1,700 handcrafted icons natively designed for SwiftUI applications. Each icon is implemented as a generated SwiftUI.Shape, avoiding the complexity of SVG libraries, XML parsers, or image assets, ensuring a lightweight and streamlined integration. This library matches the capabilities of SwiftUI, allowing icons to scale seamlessly, adjust coloring via .foregroundStyle, and participate in animations, scaling, and masking operations like any other shape.

Shape with its path(in:) defined in pure Swift code, compiled at build time, eliminating any runtime parsing overhead..foregroundStyle, .opacity, .rotationEffect, and .animation.LucideIcon enum provides autocompletion and compile-time safety, with dynamic lookup capabilities available through Lucide("iconName").lucide-static npm source and updates the icons appropriately, ensuring compatibility with the latest releases.Path commands with no leftover decoded images or SVG document trees.Integrating an icon into a SwiftUI view is simple and straightforward. Here’s a quick example:
import SwiftUI
import Lucide
struct ContentView: View {
var body: some View {
Lucide(.heart)
.foregroundStyle(.red)
.frame(width: 24, height: 24)
}
}
Icons can be customized using their kebab-case names from the Lucide icon gallery, allowing for a seamless mapping to their respective LucideIcon cases. The icons are filled outline geometries, which means there is no stroke width adjustment necessary, as the stroke weights are configured during the generation process.
To facilitate continuous development, Lucide icons can be regenerated easily using provided scripts, which can be run locally or as part of a CI pipeline to sync with upstream changes. For detailed installation and development instructions, please refer to the README in the repository.
No comments yet.
Sign in to be the first to comment.