Skip to content

harispdev/lucide-swiftui

Repository files navigation

LucideSwiftUI

SwiftUI wrapper for Lucide icons. Drop in 1500+ icons into your apps.

Quick start

Add it via Swift Package Manager:

dependencies: [
    .package(url: "https://github.com/harispdev/lucide-swiftui.git", from: "1.0.0")
]

Or in Xcode: File -> Add Packages and paste the repo URL.

Then use it:

import LucideSwiftUI

LucideIcon(name: "heart", size: 32, color: .red)

That's it. Works with any Lucide icon.

Customization

You can tweak size, color, and stroke width:

LucideIcon(
    name: "star",
    size: 48,
    color: .yellow,
    strokeWidth: 3.0
)

Type-safe icons

For common icons, there's a type-safe enum to avoid typos:

LucideIcon(icon: .heart, size: 32, color: .red)
LucideIcon(icon: .star, size: 32, color: .yellow)
LucideIcon(icon: .arrowDown, size: 32)

The enum covers the most commonly used icons. For everything else, just use the string name, all the icons are available that way.

Examples

Here's a simple icon list:

HStack {
    LucideIcon(name: "heart", size: 24, color: .red)
    LucideIcon(name: "star", size: 24, color: .yellow)
    LucideIcon(name: "bookmark", size: 24, color: .blue)
}

Or use them in buttons:

Button(action: { /* do something */ }) {
    LucideIcon(name: "download", size: 20, color: .blue)
}

Requirements

  • iOS 14.0+ / macOS 11.0+ / tvOS 14.0+ / watchOS 7.0+
  • Swift 5.5+

Dependencies

This library uses SVGView by Exyte for SVG rendering.

License & attribution

This library is provided free of charge for personal and commercial use, subject to the following conditions:

  1. You may not repackage, wrap, modify, rebrand, sublicense, or otherwise redistribute this library, in whole or in part, in a manner that represents the library as your own original work or obscures the authorship.

  2. You may not distribute derivative works whose primary purpose is to provide this library or any substantial portion of it under a different name or identity.

  3. Use of this library within a larger application or service is permitted, provided that no claim of authorship over the library itself is made.

  4. Attribution to the original author must be retained in all copies or substantial portions of the library.

By using this library, you agree to be bound by these terms.

About

SwiftUI package providing 1500+ Lucide icons with customizable size, color, and stroke width

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages