A paging scroll view for SwiftUI, using internal SwiftUI components

Related tags

UI PagingView
Overview

PagingView

A paging scroll view for SwiftUI, using internal SwiftUI components.

This is basically the same as TabView in the paging mode with the index style set to never. The major difference is having control over the spacing / margins for items in the scroll view, allowing you to create card-like where the next and previous cards can "peek".

Screen Shot 2022-02-08 at 11 25 19 AM

Documentation

Configuration

  • direction: Horizontal or Vertical. The direction the paging view scrolls in.
  • margin: The margin at each end of the list of paging items in the paging direction.
  • spacing: The spacing between each paging item in the paging direction.
  • size: The size of each item in the paging direction.
  • constrainedDeceleration: If true deceleration animations caused by drags may not scroll further than the size of the scroll view in the paging direction.

Example

Using TabView:

import SwiftUI

struct ContentView: View {
  var body: some View {
    TabView {
      Color.red
      Color.blue
      Color.green
    }
    .tabViewStyle(.page(indexDisplayMode: .never))
  }
}

Using PagingView:

import SwiftUI
import PagingView

struct ContentView: View {
  var body: some View {
    PagingView {
      Color.red
      Color.blue
      Color.green
    }
  }
}

Card like interface:

import SwiftUI
import PagingView

struct ContentView: View {
  var body: some View {
    PagingView(config: .init(margin: 20, spacing: 10)) {
      Group {
        Color.red
        Color.green
        Color.blue
      }
      .mask(RoundedRectangle(cornerRadius: 10))
      .aspectRatio(1.4, contentMode: .fit)
    }
  }
}
You might also like...
It provides UI components such as popover, popup, dialog supporting iOS apps
It provides UI components such as popover, popup, dialog supporting iOS apps

Overview LCUIComponents is an on-going project, which supports creating transient views appearing above other content onscreen when a control is selec

NotSwiftUI is designed to help you create UI components quickly and efficiently with code!
NotSwiftUI is designed to help you create UI components quickly and efficiently with code!

NotSwiftUI NotSwiftUI is designed to help you create UI components quickly and efficiently with code! Capitalizing on the idea that most of the UI ele

A horizontal scroll dial like Instagram.
A horizontal scroll dial like Instagram.

HorizontalDial Preview Requirements iOS 8.0+ Swift 5 Storyboard support Installation CocoaPods use_frameworks! pod "HorizontalDial" Manually To instal

Medium's upper and lower Menu in Scroll.
Medium's upper and lower Menu in Scroll.

Notice: MediumScrollFullScreen is no longer being maintained/updated. MediumScrollFullScreen Medium's upper and lower menu in Scroll. Demo Description

Easy-to-use HStack that snaps to elements on scroll.

SnapToScroll Drop-in SwiftUI-based container view for horizontal snapping. example-video.mp4 Getting Started Using SnapToScroll is straightforward. Th

A way to quickly add a notification badge icon to any view. Make any view of a full-fledged animated notification center.
A way to quickly add a notification badge icon to any view. Make any view of a full-fledged animated notification center.

BadgeHub A way to quickly add a notification badge icon to any view. Demo/Example For demo: $ pod try BadgeHub To run the example project, clone the r

Confetti View lets you create a magnificent confetti view in your app
Confetti View lets you create a magnificent confetti view in your app

ConfettiView Confetti View lets you create a magnificent confetti view in your app. This was inspired by House Party app's login screen. Written in Sw

Play BreakOut while loading - A playable pull to refresh view using SpriteKit
Play BreakOut while loading - A playable pull to refresh view using SpriteKit

BreakOutToRefresh Play BreakOut while loading - A playable pull to refresh view using SpriteKit BreakOutToRefresh uses SpriteKit to add a playable min

Full configurable spreadsheet view user interfaces for iOS applications. With this framework, you can easily create complex layouts like schedule, gantt chart or timetable as if you are using Excel.
Full configurable spreadsheet view user interfaces for iOS applications. With this framework, you can easily create complex layouts like schedule, gantt chart or timetable as if you are using Excel.

kishikawakatsumi/SpreadsheetView has moved! It is being actively maintained at bannzai/SpreadsheetView. This fork was created when the project was mov

Comments
  • Disable bounces for the scroll in PagingView

    Disable bounces for the scroll in PagingView

    Hi, I am pretty new to SwiftUI and I am trying to recreate a Peeking paging view for an existing project. I was able to achieve the peeking effect and the paging effect with your solution, however there does not seem to be a way to disable the bounces. Any way this can be implemented here ?

    opened by cedanmisquith 0
Releases(0.1.1)
Owner
Eric Lewis
Developer & Father. Feel free to reach out on twitter if I don't get back to you here.
Eric Lewis
📖 A lightweight, paging view solution for SwiftUI

Getting Started | Customization | Installation Getting Started Basic usage Using Pages is as easy as: import Pages struct WelcomeView: View { @S

Nacho Navarro 411 Dec 29, 2022
Infinite paging controller, scrolling through contents and title bar scrolls with a delay

PageController PageController is infinite paging controller, scrolling through contents and title bar scrolls with a delay. Then it provide user inter

Hirohisa Kawasaki 408 Nov 28, 2022
SwiftUI: Components Library Inspired by Twitter's Bootstrap

bootswiftui SwiftUI: Components Library Inspired by Twitter's Bootstrap Warning This is just SwiftUI exercise. Please do not consider using this repo

Robert Sandru 1 Oct 27, 2022
A few drop-in SwiftUI components for easily importing and thumb-nailing files

FilesUI A few drop-in SwiftUI components for easily importing and thumb-nailing files Usage 1. Import Files To import files you can use the FileImport

Brianna Zamora 3 Oct 19, 2022
SwiftUI components and extensions that seem to be highly reusable

SwiftUI components and extensions that seem to be highly reusable

Yusuke Hosonuma 56 Dec 15, 2022
💾 A collection of classic-style UI components for iOS

A collection of classic-style UI components for UIKit, influenced by Windows 95 Introduction This is a little exploration into applying '90s-era desig

Blake Tsuzaki 2.2k Dec 22, 2022
Spinner loader components with liquid animation

LiquidLoader LiquidLoader is the spinner loader UI components with liquid animation, inspired by Spinner Loader - Gooey light Effect [] (https://githu

Takuma Yoshida 1.3k Dec 21, 2022
Modular and customizable Material Design UI components for iOS

Material Components for iOS Material Components for iOS (MDC-iOS) helps developers execute Material Design. Developed by a core team of engineers and

Material Components 4.6k Dec 29, 2022
Material design components for iOS written in Swift

MaterialKit NOTE: This project is unmaintained. Material design components (inspired by Google Material Design) for iOS written in Swift Please feel f

Le Van Nghia 2.5k Jan 5, 2023
Swift Package for distributing Mozilla's Rust-based application components

Swift Package for Mozilla's Rust Components This repository is a Swift Package for distributing releases of Mozilla's various Rust-based application c

Mozilla 19 Dec 30, 2022