{"id":20336641,"url":"https://github.com/ksemianov/wrappinghstack","last_synced_at":"2025-04-09T19:17:41.106Z","repository":{"id":65552232,"uuid":"573246015","full_name":"ksemianov/WrappingHStack","owner":"ksemianov","description":"WrappingHStack (FlowLayout) is a SwiftUI component similar to HStack that wraps horizontally overflowing subviews onto the next lines.","archived":false,"fork":false,"pushed_at":"2024-01-09T15:52:39.000Z","size":14,"stargazers_count":241,"open_issues_count":2,"forks_count":15,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-09T19:17:35.835Z","etag":null,"topics":["components","ios","layout","macos","swift","swiftui","swiftui-components"],"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/ksemianov.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":"2022-12-02T02:26:55.000Z","updated_at":"2025-04-06T13:47:11.000Z","dependencies_parsed_at":"2025-02-24T20:51:39.022Z","dependency_job_id":"ecd676a2-29ce-4616-9f4c-9eef8861380c","html_url":"https://github.com/ksemianov/WrappingHStack","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ksemianov%2FWrappingHStack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ksemianov%2FWrappingHStack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ksemianov%2FWrappingHStack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ksemianov%2FWrappingHStack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ksemianov","download_url":"https://codeload.github.com/ksemianov/WrappingHStack/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248094988,"owners_count":21046770,"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","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":["components","ios","layout","macos","swift","swiftui","swiftui-components"],"created_at":"2024-11-14T21:06:15.058Z","updated_at":"2025-04-09T19:17:41.079Z","avatar_url":"https://github.com/ksemianov.png","language":"Swift","readme":"# WrappingHStack\n\nA SwiftUI component similar to `HStack` that wraps horizontally overflowing subviews onto the next lines.\n\n  * [Overview](#overview)\n  * [Examples](#examples)\n  * [Installation](#installation)\n  * [License](#license)\n\n## Overview\n\nThe library is based on the SwiftUI's `Layout` protocol and thus has the following deployment requirement:\n\n\u003e iOS 16.0+, iPadOS 16.0+, macOS 13.0+, Mac Catalyst 16.0+, tvOS 16.0+, watchOS 9.0+\n\nThe component's signature:\n\n``` swift\nWrappingHStack(alignment: Alignment = .center,\n               horizontalSpacing: CGFloat? = nil,\n               verticalSpacing: CGFloat? = nil,\n               fitContentWidth: Bool = false)\n```\n\nThe component, by default, uses the `.center` alignment, but also supports the following alignment values: `.center`, `.leading`, `.topLeading`, `.top`, `.topTrailing`, `.trailing`, `.bottomTrailing`, `.bottom`, `.bottomLeading`. The rest are treated as `.center`.\n\nThe component, by default, uses the system provided spacing, but it's also possible to specify explicit `horizontalSpacing` and `verticalSpacing`.\n\nThe component, by default, spans the entire available width. However, you can set `fitContentWidth` to `true` to make it adjust its width based on its content.\n\nThe component assumes that the largest subview fits into the bounds and there are no infinitely growing subviews. The component assumes that it can grow vertically as much as necessary to fit into the width constraint.\n\n## Examples\n\nAn array of tags:\n\n![WrappingHStack](https://user-images.githubusercontent.com/18328341/205410620-19e66e2c-6dc4-4354-9c6a-f25a3704b2ac.gif)\n\n``` swift\nWrappingHStack(alignment: .leading) {\n    ForEach(tags) {\n        Text($0.text)\n            .foregroundColor(Color.white)\n            .padding(.horizontal, $0.horizontalPadding)\n            .padding(.vertical, $0.verticalPadding)\n            .background(Color.gray)\n            .cornerRadius(16)\n    }\n}\n```\n\n\n## Installation\n\nYou can add WrappingHStack to an Xcode project by adding it as a package dependency.\n\n\u003e https://github.com/ksemianov/WrappingHStack\n\nIf you want to use WrappingHStack in a [SwiftPM](https://swift.org/package-manager/) project, \nit's as simple as adding it to a `dependencies` clause in your `Package.swift`:\n\n``` swift\ndependencies: [\n    .package(url: \"https://github.com/ksemianov/WrappingHStack\", from: \"0.2.0\")\n]\n```\n\nIf you want to use WrappingHStack in a [CocoaPods](https://cocoapods.org) project,\nadd this line to your `Podfile`:\n\n``` ruby\n'WrappingHStackLayout', '~\u003e 0.2.0'\n```\n\n## License\n\nThis library is released under the MIT license. See [LICENSE](LICENSE) for details.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fksemianov%2Fwrappinghstack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fksemianov%2Fwrappinghstack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fksemianov%2Fwrappinghstack/lists"}