{"id":15170543,"url":"https://github.com/tarciziu/horizontalpager","last_synced_at":"2026-03-02T14:32:52.788Z","repository":{"id":255821445,"uuid":"849550942","full_name":"Tarciziu/HorizontalPager","owner":"Tarciziu","description":"Native Horizontal Pager in SwiftUI","archived":false,"fork":false,"pushed_at":"2024-09-07T07:26:35.000Z","size":339,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-21T16:58:27.131Z","etag":null,"topics":["horizontal","ios","pager","swift5","swiftui","swiftuicomponents"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Tarciziu.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-29T19:46:24.000Z","updated_at":"2025-03-20T20:46:42.000Z","dependencies_parsed_at":"2024-09-07T09:38:10.736Z","dependency_job_id":"365ddd13-7114-4607-aa36-8fe4ac1a4f3f","html_url":"https://github.com/Tarciziu/HorizontalPager","commit_stats":null,"previous_names":["tarciziu/horizontalpager"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Tarciziu/HorizontalPager","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tarciziu%2FHorizontalPager","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tarciziu%2FHorizontalPager/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tarciziu%2FHorizontalPager/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tarciziu%2FHorizontalPager/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Tarciziu","download_url":"https://codeload.github.com/Tarciziu/HorizontalPager/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Tarciziu%2FHorizontalPager/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273068858,"owners_count":25039911,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-01T02:00:09.058Z","response_time":120,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["horizontal","ios","pager","swift5","swiftui","swiftuicomponents"],"created_at":"2024-09-27T08:03:58.882Z","updated_at":"2026-03-02T14:32:52.727Z","avatar_url":"https://github.com/Tarciziu.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Horizontal Pager View\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\n`HorizontalPagerView` provides a paging component built with SwiftUI native components. Pager is a view that renders a scrollable container to display multiple items paginated.\n\nThis is an improved version of a solution posted by [mecid](https://gist.github.com/mecid) on [gist](https://gist.github.com/mecid/e0d4d6652ccc8b5737449a01ee8cbc6f).\n\n### Table of Contents  \n- [Requirements](#requirements)  \n- [Showcase](#showcase)\n- [Usage](#usage)\n    - [Initialization](#initialization)\n    - [UI Customization](#ui-customization)\n- [License](#license)\n\n## Requirements\n\n- iOS 15.0+ (it might work on older versions)\n- Swift 5.0+\n\n## Showcase\n\n![](Images/showcase.gif)\n\n## Usage\n\n### Initialization\n\nCreating a `HorizontalPagerView` can be done easy by providing at least 3 parameters:\n- `items` which is an array of Hashable \u0026 Equatable conforming entities\n- `selectedItem` which is the centered item\n- `contentBuilder` which is a `@escaping` `ViewBuilder` which takes an item and builds its view\n\n```swift\nHorizontalPagerView(\n  items: items,\n  selectedItem: $selectedCard\n) { item in\n  Text(item.name)\n    .frame(maxWidth: .infinity)\n    .padding(.horizontal, 16)\n    .padding(.vertical, 12)\n    .background(.red)\n    .scaleEffect(y: selectedCard.id == item.id ? 1.0 : 0.8)\n    .cornerRadius(12)\n}\n```\n\n### UI Customization\n\n`HorizontalPagerView` can be customized by using `spacing` parameters in order to increase the space between two items in the list.\n\n```swift\nHorizontalPagerView(\n  items: items,\n  selectedItem: $selectedCard\n  spacing: 20\n) { item in\n  Text(item.name)\n    .frame(maxWidth: .infinity)\n    .padding(.horizontal, 16)\n    .padding(.vertical, 12)\n    .background(.red)\n    .scaleEffect(y: selectedCard.id == item.id ? 1.0 : 0.8)\n    .cornerRadius(12)\n}\n```\n\nAlso, `itemWidthRatio` modifier can be used in order to change the width of a card item from the list relative to the available width.\n\n```swift\nHorizontalPagerView(\n  items: items,\n  selectedItem: $selectedCard\n  spacing: 20\n) { item in\n  Text(item.name)\n    .frame(maxWidth: .infinity)\n    .padding(.horizontal, 16)\n    .padding(.vertical, 12)\n    .background(.red)\n    .scaleEffect(y: selectedCard.id == item.id ? 1.0 : 0.8)\n    .cornerRadius(12)\n}\n  .itemWidthRatio(0.7)\n```\n\n![](Images/customization.png)\n\n## License\n\n`HorizontalPagerView` is available under the MIT license. See the [LICENSE](License) file for more info.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftarciziu%2Fhorizontalpager","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftarciziu%2Fhorizontalpager","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftarciziu%2Fhorizontalpager/lists"}