Model or dataset
krispuckett/SwiftUIShaders avatar
krispuckett/SwiftUIShaders

SwiftUIShaders: 41 curated Metal shader effects as one-line SwiftUI view modifiers

41 hand-curated drop-in SwiftUI Metal shader effects — holographic foil, kaleidoscope, magnetic fields, glitch, neon edges and more. Typed View modifiers, agent-friendly docs.

335 stars12 forksMetalMIT

At a glance

What is it?
SwiftUIShaders is an MIT Swift package of 41 Metal shader effects, each a stitchable Metal function wrapped in a typed SwiftUI View modifier so it drops onto a view in one line. They were curated by testing each on a real book cover and cutting the duds.
Who is it for?
Use SwiftUIShaders if you build for recent Apple platforms and want dramatic, curated Metal shader effects, holographic foil, kaleidoscope, glitch and more, dropped onto SwiftUI views as one-line modifiers with self-driving animation and no Metal code: the real-content curation, where every effect was tested on an actual book cover, is what makes the set trustworthy.
Can I use it commercially?
Yes. MIT is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
Is it still maintained?
Yes. The repository last received commits 109 days ago.
What is it written in?
Mainly Metal, according to GitHub's language statistics.

Answers come from the project's GitHub data, last synced on September 17, 2026, and from our analysis. They are not legal advice.

DEEP OPEN-SOURCE ANALYSIS

Shader effects you add with one line

SwiftUIShaders is a Swift package of 41 Metal shaders for SwiftUI: holographic foil, kaleidoscope mandalas, magnetic fields, glitch, neon edges and more. The README's key design point is that each is a `[[ stitchable ]]` Metal function with a typed SwiftUI `View` modifier wrapped around it, so dropping one onto a view is a single line.

The user is an iOS, macOS, tvOS or visionOS developer who wants striking visual effects without writing Metal shading code or wiring up the SwiftUI-to-Metal plumbing themselves. The one-line modifier form, for example `.bcsHolographic(intensity:scale:speed:)` on an image, is what makes these usable by a developer who is not a graphics programmer.

What gives the collection credibility is how it was curated. The README explains these started as a hidden shader lab inside the author's reading app, Epilogue, and only the ones that actually looked good on a real book cover were kept, with the washed-out ones and the ones that only work on a blank gradient cut. That real-content curation is the difference between a shader dump and a usable library: every effect here survived a test on actual content.

Stitchable Metal functions with self-driving animation

The technical shape is what makes these drop-in. Each shader is a stitchable Metal function, the mechanism SwiftUI uses to apply custom Metal shaders to views, and SwiftUIShaders wraps each in a typed SwiftUI View modifier with sensible parameter defaults. So instead of managing a Metal pipeline, you call a modifier and pass typed parameters like intensity, scale and speed.

The animated shaders drive themselves. The README notes the animated ones run with `TimelineView(.animation)`, so there is no timer for you to babysit, and every parameter has a sensible default, meaning the simplest call needs no tuning. That self-driving animation is a real convenience, because coordinating a repaint timer for an animated effect is exactly the boilerplate a developer wants to avoid.

The package is also built for agent-assisted tuning. The README suggests handing the repo to a coding agent like Claude Code or Codex and pointing it at the included `AGENTS.md` and `Docs/parameters.json` to build a slider-based tuning tool or riff on the effects. That the parameters are documented in a machine-readable JSON, and the tuning recipe is written for an agent, reflects a modern workflow where you dial an effect in against your own content and paste the resulting line into your code.

Installing via Swift Package Manager, with one Xcode caveat

SwiftUIShaders installs through Swift Package Manager. In Xcode you add it via File then Add Package Dependencies pointed at the repo URL, or in a `Package.swift`:

swift
.package(url: "https://github.com/krispuckett/SwiftUIShaders.git", from: "1.0.0")

and add `SwiftUIShaders` to your target's dependencies. A first use is a one-line modifier on a view:

swift
Image("book-cover")
    .resizable()
    .scaledToFit()
    .bcsHolographic(intensity: 0.6, scale: 12, speed: 1.2)

The README flags one important gotcha: build with Xcode or `xcodebuild`, not bare `swift build`. SwiftPM's command-line driver on macOS does not run the Metal toolchain, so `Bundle.module` and the compiled `default.metallib` never get produced, and the shaders will not load. In Xcode it works because the Metal toolchain compiles the shaders into the package's metallib.

The requirements are iOS 17+, macOS 14+, tvOS 17+ or visionOS 1+, and Xcode 15+. That build-with-Xcode caveat is the one thing that will trip up anyone trying to use it from a pure command-line SwiftPM workflow, and the README is right to call it out prominently.

The limitations: Metal, recent OSes, and a fixed set

The honest limitations start with the platform floor. These are Metal shaders, so they require Apple platforms and the recent OS versions the README lists, iOS 17+, macOS 14+ and equivalents, plus Xcode 15+ to compile the Metal toolchain. That rules out older OS targets and any non-Apple platform, which is inherent to using Metal.

The `swift build` caveat is a real usability limitation for certain workflows. Because the command-line SwiftPM driver does not run the Metal toolchain, the package must be built through Xcode or `xcodebuild`, so CI or tooling that relies on bare `swift build` will find the shaders missing. That is a consequence of how SwiftPM handles Metal, not a bug in the package, but it constrains how it can be built.

It is also a fixed, curated set of 41 effects, not a shader authoring toolkit. The curation is the value, only effects that looked good on real content survived, but if you need an effect outside the collection, you are writing Metal yourself or tuning the existing ones. The parameters are exposed and documented for tuning, but the set of effects is what it is, which is the right trade for a drop-in library and a limitation if you need something bespoke.

Against writing Metal yourself or using SwiftUI's built-in effects

The alternatives are writing your own Metal shaders, or using SwiftUI's built-in visual effects and materials. Writing Metal gives unlimited control but requires shading-language expertise and the SwiftUI plumbing SwiftUIShaders already provides, which is a large amount of work for effects someone has already curated. SwiftUI's built-in effects are easy but limited to blurs, materials and simple filters, nothing like holographic foil or kaleidoscope mandalas.

SwiftUIShaders's difference is that it delivers 41 striking, real-content-tested effects as one-line modifiers with self-driving animation and documented parameters, so a non-graphics developer gets bespoke-looking visuals immediately. The cost is the Apple-platform, recent-OS requirement, the build-with-Xcode caveat, and the fixed set. Choose writing Metal yourself when you need a specific effect outside the collection and have the expertise. Choose SwiftUI's built-ins when a blur or material is enough. Choose SwiftUIShaders when you want dramatic, curated shader effects dropped onto SwiftUI views in one line, on recent Apple platforms, without touching Metal or a repaint timer.

MIT, SPM updates, and where to start

SwiftUIShaders is MIT, so the effects can be used, forked and adapted commercially with attribution, and the README is clear that the `bcs_` prefix is just a namespace with nothing wired to the author's actual app code, so there is no hidden coupling to Epilogue. That makes the package safe to drop into any project.

Updates come through Swift Package Manager version resolution, and because the shaders compile into the package's metallib at build time, upgrading is the ordinary SPM flow with no separate asset step. The documented `parameters.json` and `AGENTS.md` also mean the package is set up to be tuned and extended with an agent's help rather than by hand.

The concrete first step is to add the package in Xcode, not via bare `swift build`, and apply one modifier to a real image to see it in context: try `.bcsHolographic` on an actual asset from your app rather than a blank gradient, since the README's whole curation philosophy is that effects should look good on real content. If you want to dial an effect in, hand the repo and its `parameters.json` to a coding agent as the README suggests and have it build a slider tool, then paste the tuned modifier line into your code.

Editorial conclusion

Use SwiftUIShaders if you build for recent Apple platforms and want dramatic, curated Metal shader effects, holographic foil, kaleidoscope, glitch and more, dropped onto SwiftUI views as one-line modifiers with self-driving animation and no Metal code: the real-content curation, where every effect was tested on an actual book cover, is what makes the set trustworthy. It is the wrong choice for non-Apple platforms or OS targets below iOS 17 / macOS 14, or for workflows that rely on bare swift build, which the README warns does not run the Metal toolchain. Start by adding the package in Xcode, apply one modifier like .bcsHolographic to a real image from your app, and use the documented parameters.json with a coding agent to tune an effect against your own content.

Frequently asked questions

How do I add a SwiftUIShaders effect to a view?

The README says each shader is a typed SwiftUI View modifier, so it is one line, for example .bcsHolographic(intensity: 0.6, scale: 12, speed: 1.2) on an image. Animated shaders run themselves via TimelineView(.animation), so there is no timer to manage.

Why must I build SwiftUIShaders with Xcode instead of swift build?

The README explains SwiftPM's command-line driver on macOS does not run the Metal toolchain, so Bundle.module and the compiled default.metallib are never produced and the shaders will not load. Building with Xcode or xcodebuild compiles the shaders correctly.

What platforms does SwiftUIShaders support?

The README lists iOS 17+, macOS 14+, tvOS 17+ and visionOS 1+, with Xcode 15+ required to compile the Metal shaders into the package's metallib. It is installed via Swift Package Manager.

Official sources

  1. Issues
  2. krispuckett/SwiftUIShaders on GitHub
  3. License: MIT
  4. README
  5. Releases
Community notes

Community notes