ListKit is a SwiftUI library that provides additional list, grid, and shelf utilities to simplify listing items in flexible ways.
Installation
ListKit can be installed with the Swift Package Manager:
https://github.com/danielsaidi/ListKit.git
Getting started
ListKit has a bunch of predefined view components, and native view extensions. Below are the most useful views. Please have a look at the online documentation and the source code previews for more examples.
List Button Group
The ListButtonGroup lets you add quick list actions, like you can see in apps like the native Contacts app:
struct ContentView: View { var body: some View { List { ListButtonGroup { Button(action: doSomething) { ... } Button(action: doSomething) { ... } Button(action: doSomething) { ... } Button(action: doSomething) { ... } } } .listBackgroundGradient(colors: [.mint, .blue]) } }
The default glass style works best with a prominent background. You can use the .listBackgroundGradient(...) extension to make this happen.
Shelf
The Shelf view can be used to build vertical list of horizontally scrolling shelves, as seen in many streaming apps:
Shelf(items: [1, 2, 3, 4, 5]) { Text("Shelf Title") .padding(5) .frame(maxWidth: .infinity, alignment: .leading) .background(Color.yellow) .clipShape(.rect(cornerRadius: 10)) } content: { item in Button { print("Tapped") } label: { Color.red .frame(height: 150) .aspectRatio(15/9, contentMode: .fit) .clipShape(.rect(cornerRadius: 10)) } #if os(tvOS) .buttonStyle(.card) #endif } .shelfEdgePadding(25) .shelfItemSpacing(25) .shelfScrollBehavior(.enabled)
A shelf has a custom title and content view, and lets you customize edge padding, item spacing and scroll behavior.
More Views
ListKit has more views, not listed here to avoid bloating the overview:
ListDragHandleListSectionTitleListSelectItemPlainListContent
View Extensions
ListKit also provides many view extensions to simplify common tasks:
.listBackgroundGradient(.blue).listBackgroundGradient(colors: [.mint, .blue]).preferredListSectionSpacing(10).preferredScrollContentHidden()
See the online documentation for more information.
Documentation
The online documentation has more information, articles, code examples, etc.
Demo Application
This repository will get a demo app once it has 100+ stars. Until then, check out the source code demos.
Support My Work
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.
Contact
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
License
ListKit is available under the MIT license. See the LICENSE file for more info.

