PagerKit
Expert guidance on PagerKit, a SwiftUI library for advanced, customizable page-based navigation. Use when developers mention: (1) PagerKit, PKPagesView, PKPage, (2) custom page controls, indicators, o
Expert guidance on PagerKit, a SwiftUI library for advanced, customizable page-based navigation. Use when developers mention: (1) PagerKit, PKPagesView, PKPage, (2) custom page controls, indicators, o
Real data. Real impact.
Emerging
Developers
Per week
Open source
Skills give you superpowers. Install in 30 seconds.
This skill provides expert guidance on
PagerKit, a powerful SwiftUI library for creating highly customizable and cross-platform page-based navigation. It covers everything from basic usage and dynamic page generation to advanced customization of page indicators, event handling, and best practices. Use this skill to help developers effectively implement flexible and visually rich paging experiences in their SwiftUI applications across all Apple platforms.
PKPageBuilder and ForEach for declarative page construction, aligning with SwiftUI's design principles.UIPageViewController options, always specify platform availability and correct type (UIImage vs. Image, UIPageControlProgress).PKPagesView or PKPage modifiers for customization, using full modifier signatures (e.g., .pkPageNavigationOrientation(_:)).PKPagesView or PKPage context.#if os(...) directives.PagerKit's behavior is influenced by the project's deployment targets and Swift version.
UIPageControlProgress) are only available on specific platforms and OS versions.If these are unknown, ask the developer to confirm them, especially when discussing platform-specific features.
When a developer needs PagerKit guidance, follow this decision tree:
Setting up a new pager?
references/PagerKit.mdreferences/PKPagesView.mdreferences/PKPage.mdGenerating pages dynamically from data?
references/ForEach.mdControlling page flow or structure?
references/PKPageBuilder.mdreferences/PKPagesView.md (.pkPageNavigationOrientation)Customizing the page indicator (dots)?
references/PKPagesView.md (.pkPageControlIndicatorTintColor, .pkPageControlIndicatorCurrentIndicatorTintColor)references/PKPageControlBackgroundStyle.mdreferences/PKPagesView.md (.pkPageControlIndicatorAlignment, .pkPageControlPadding)references/PKPageControlDirection.mdreferences/PKPagesView.md, references/PKPage.mdreferences/PKPagesView.mdHandling page change events or state?
references/PKPagesView.md (.pkCurrentPageIndex)references/PKPagesView.md (.pkOnManualPageChange)references/PKPagesView.md (.pkOnAutoPageChange)references/PKPageDirection.mdreferences/PKPagesView.mdCustomizing individual page behavior?
references/PKPage.md (.pkPageDuration)references/PKPage.md (.pkPageFooter)PKPagesView contains valid PKPage instances. Refer to references/PKPagesView.md, references/PKPage.md.ForEach implementation. Refer to references/ForEach.md..pkPageControlIndicatorAlignment, .pkPageControlIndicatorBackgroundStyle, .pkPageControlIndicatorDirection modifiers on PKPagesView. Refer to references/PKPagesView.md, references/PKPageControlBackgroundStyle.md, references/PKPageControlDirection.md..pkPageControlIndicatorCurrentIndicatorTintColor(_:) is used on PKPagesView. Refer to references/PKPagesView.md..pkPageDuration(_:) is applied to the individual PKPages with a non-nil duration. Refer to references/PKPage.md.if statements) inside PKPagesView is giving compiler errors."
PKPageBuilder concepts, ensuring all branches return valid PKPage components. Refer to references/PKPageBuilder.md.PKPageDirection parameter in .pkOnManualPageChange. Refer to references/PKPagesView.md, references/PKPageDirection.md.PKPagesView { PKPage { Text("Page A").font(.title) } PKPage { Text("Page B").font(.title) } PKPage { Text("Page C").font(.title) } } .pkCurrentPageIndex(index: $currentPage) // Bind to @State .pkPageNavigationOrientation(.horizontal)
struct Item: Identifiable { let id = UUID() let title: String }// ... inside a View let items = [Item(title: "Item 1"), Item(title: "Item 2")]
PKPagesView { ForEach(items) { item in PKPage { Text(item.title) } .pkPageFooter { Text("Footer for (item.title)") } } }
.pkPageControlIndicatorAlignment(spacing: 10, alignment: .bottomTrailing) .pkPageControlIndicatorBackgroundStyle(.prominent) .pkPageControlIndicatorDirection(.topToBottom) // Vertical dots .pkPageControlIndicatorTintColor(.gray) .pkPageControlIndicatorCurrentIndicatorTintColor(.blue) // Custom images #if os(iOS) .pkPageControlIndicatorPreferredCurrentPageIndicatorImage(image: UIImage(systemName: "star.fill")) #else .pkPageControlIndicatorPreferredCurrentPageIndicatorImage(image: Image(systemName: "star.fill")) #endif
.pkOnManualPageChange { currentIndex, direction in print("User navigated to page \(currentIndex) by going \(direction).") } .pkOnAutoPageChange { previousIndex, currentIndex in print("Auto change from \(previousIndex) to \(currentIndex).") } .pkOnTransitionEnd { previous, current in print("Transition ended. Was on \(previous), now on \(current).") }
PagerKit is integrated via Swift Package Manager.
https://github.com/SzpakKamil/PagerKit.git.import PagerKit in your Swift files.For detailed setup, see
references/PagerKit.md.
Load these files as needed for specific topics:
PagerKit.md - General overview, setup, and core benefits.PKPagesView.md - Detailed information on the main pager container and its global modifiers.PKPage.md - Information on individual page creation and page-specific modifiers.ForEach.md - How to generate pages from collections of data.PKPageBuilder.md - Understanding the declarative content building for PKPagesView.PKPageControlBackgroundStyle.md - Options for the background style of the page indicator.PKPageControlDirection.md - Options for the layout direction of the page indicator dots.PKPageDirection.md - Understanding the direction of page transitions._index.md - A comprehensive index for all PagerKit reference documentation.PKPageBuilder with ForEach for flexible and maintainable page construction.pkCurrentPageIndex to external state (@State or @Binding) for programmatic control and observation..pkOnManualPageChange, .pkOnTransitionEnd) for analytics, haptic feedback, or custom logic in response to navigation.Note: This skill is based on the comprehensive documentation for PagerKit. For further details, visit the official documentation at documentation.kamilszpak.com/documentation/pagerkit/ or the project website at kamilszpak.com/pl/pagerkit.
No automatic installation available. Please visit the source repository for installation instructions.
View Installation Instructions1,500+ AI skills, agents & workflows. Install in 30 seconds. Part of the Torly.ai family.
© 2026 Torly.ai. All rights reserved.