Swiftpack.co - danielsaidi/DeckKit as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by danielsaidi.
danielsaidi/DeckKit 0.7.1
DeckKit makes it easy to create deck-based apps in SwiftUI.
⭐️ 426
🕓 5 weeks ago
iOS macOS watchOS tvOS
.package(url: "https://github.com/danielsaidi/DeckKit.git", from: "0.7.1")

DeckKit Logo

Version Swift 5.6 MIT License Twitter: @danielsaidi Mastodon: @danielsaidi@mastodon.social

About DeckKit

DeckKit helps you create deck-based apps in SwiftUI. The result can look like this or completely different:

DeckKit decks can be customized to great extent. You can change colors, fonts, corner radius etc. of the standard card views, and also use completely custom views.

DeckKit supports iOS 13, macOS 11, tvOS 13 and watchOS 6.


DeckKit can be installed with the Swift Package Manager:


If you prefer to not have external dependencies, you can also just copy the source code into your app.

Getting started

The online documentation has a getting-started guide that will help you get started with the library.

In DeckKit, a Deck can be used to define a deck of items that implement the DeckItem protocol.

For instance, consider a Hobby type that looks like this:

struct Hobby: DeckItem {
    var name: String
    var text: String

    var id: String { name }

You can now create a deck with hobbies and display it in a DeckView:

struct MyView: View {

    var deck = Deck(
        name: "Hobbies",
        items: [
            Hobby(name: "Music", text: "I love music!"), 
            Hobby(name: "Movies", text: "I also love movies!"), 
            Hobby(name: "Programming", text: "Not to mention programming!")

    var body: some View {
        DeckView(deck: $deck) {
            // Create a view for the hobby here

The DeckView takes an optional DeckViewConfiguration parameter that can be used to configure the view in various ways. You can for instance use it to control the visual direction, the number of visible items, etc.

You can also provide additional actions that should be triggered when a card is dragged to the leading, trailing, top and bottom edges.

For more information, please see the online documentation and getting started guide.


The online documentation has articles, code examples etc. that let you overview the various parts of the library.

Demo Application

This project has a demo app that lets you explore the library on iOS and macOS. To try it out, just open and run Demo/Demo.xcodeproj.

Support this library

You can sponsor this project on GitHub Sponsors or get in touch for paid support.


Feel free to reach out if you have questions or if you want to contribute in any way:


DeckKit is available under the MIT license. See the LICENSE file for more info.


Stars: 426
Last commit: 5 weeks ago
jonrohan Something's broken? Yell at me @ptrpavlik. Praise and feedback (and money) is also welcome.

Related Packages

Release Notes

5 weeks ago

💡 New features

  • Deck has new move functions.

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics