{"id":15288683,"url":"https://github.com/jasonnam/astack","last_synced_at":"2025-12-11T22:53:02.881Z","repository":{"id":40626284,"uuid":"249122200","full_name":"jasonnam/AStack","owner":"jasonnam","description":"The Missing SwiftUI Adaptive and Accessible Stacks Library.","archived":false,"fork":false,"pushed_at":"2021-03-25T09:59:56.000Z","size":319,"stargazers_count":114,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-10T23:09:10.719Z","etag":null,"topics":["a11y","accessibility","ios","stacks","swiftui","swiftui-components"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":false,"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/jasonnam.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}},"created_at":"2020-03-22T05:52:01.000Z","updated_at":"2024-07-19T05:27:00.000Z","dependencies_parsed_at":"2022-08-28T10:21:12.385Z","dependency_job_id":null,"html_url":"https://github.com/jasonnam/AStack","commit_stats":null,"previous_names":["zntfdr/astack"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jasonnam%2FAStack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jasonnam%2FAStack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jasonnam%2FAStack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jasonnam%2FAStack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jasonnam","download_url":"https://codeload.github.com/jasonnam/AStack/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249116056,"owners_count":21215140,"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":["a11y","accessibility","ios","stacks","swiftui","swiftui-components"],"created_at":"2024-09-30T15:52:05.238Z","updated_at":"2025-12-11T22:53:02.850Z","avatar_url":"https://github.com/jasonnam.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n    \u003cimg src=\".assets/logo/logo.png\" width=\"400\" max-width=\"90%\" alt=\"AStack\" /\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/swift-5.2-orange.svg\" /\u003e\n    \u003ca href=\"https://swift.org/package-manager\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/swiftpm-compatible-brightgreen.svg?style=flat\" alt=\"Swift Package Manager\" /\u003e\n    \u003c/a\u003e\n     \u003cimg src=\"https://img.shields.io/badge/platforms-macOS+iOS+iPadOS+tvOS+watchOS-brightgreen.svg?style=flat\" alt=\"MacOS + iOS + iPadOS + tvOS + watchOS\" /\u003e\n    \u003ca href=\"https://twitter.com/zntfdr\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/twitter-@zntfdr-blue.svg?style=flat\" alt=\"Twitter: @zntfdr\" /\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n\nWelcome to **\u003cins\u003eA\u003c/ins\u003eStack**, a library bringing you adaptive and accessible SwiftUI stacks.\n\n## Introduction\n \n\u003cins\u003eA\u003c/ins\u003eStack introduces four new SwiftUI views: \n\n- `AHStack`\n- `AVStack`\n- `LazyAHStack`\n- `LazyAVStack`\n\nTheir behavior is based on the [environment][environment]'s [`ContentSizeCategory`][ContentSizeCategory] and/or [`UserInterfaceSizeClass`][UserInterfaceSizeClass]:\n\n- when the **content size** category is one that is **not** associated with accessibility, they are equivalent to SwiftUI's counterparts\n- when the **content size** category is one that **is** associated with accessibility, the views switch alignment (e.g. from horizontal to vertical)\n- when the associated **class size** is `.regular`, they are equivalent to SwiftUI's counterparts\n- when the associated **class size** is `.compact`, the views switch alignment (e.g. from horizontal to vertical)\n\nBy default all views observe just `ContentSizeCategory`, however this can be changed to observing either `ContentSizeCategory` or  `UserInterfaceSizeClass`, both, or none via the `observing` parameter.\n\n## Usage\n\nUse any \u003cins\u003eA\u003c/ins\u003eStack view as any other stack view:\n\n```swift\nimport AStack\nimport SwiftUI\n\nstruct ContentView: View {\n  var body: some View {\n    AHStack {\n      ...\n    }\n  }\n}\n\n@available(macOS 11, iOS 14, watchOS 7, tvOS 14, *)\nstruct ContentView2: View {\n  var body: some View {\n    LazyAVStack {\n      ...\n    }\n  }\n}\n```\n\nProperties such as alignment and spacing can be customized:\n\n```swift\nimport AStack\nimport SwiftUI\n\nstruct ContentView: View {\n  var body: some View {\n    AHStack(\n      hAlignment: .top,    // HStack alignment\n      vAlignment: .leading // VStack alignment\n    ) {\n      ...\n    }\n  }\n}\n```\n## Examples\n\n### AHStack\n\n\u003cimg src=\".assets/example.png\" height=\"452px\" align=\"right\" style=\"padding-left: 20px\"\u003e\n\n```swift\nimport AStack\nimport SwiftUI\n\nstruct ContentView: View {\n  var body: some View {\n    AHStack {\n      ZStack {\n        RoundedRectangle(cornerRadius: 12).strokeBorder()\n        Text(\"1\")\n      }\n      ZStack {\n        RoundedRectangle(cornerRadius: 12).strokeBorder()\n        Text(\"2\")\n      }.foregroundColor(.purple)\n      ZStack {\n        RoundedRectangle(cornerRadius: 12).strokeBorder()\n        Text(\"3\")\n      }.foregroundColor(.blue)\n    }\n  }\n}\n```\n\n### AVStack\n\n\u003cimg src=\".assets/example2.png\" height=\"452px\" align=\"right\" style=\"padding-left: 20px\"\u003e\n\n```swift\nimport AStack\nimport SwiftUI\n\nstruct ContentView: View {\n  var body: some View {\n    AVStack {\n      ZStack {\n        RoundedRectangle(cornerRadius: 12).strokeBorder()\n        Text(\"1\")\n      }\n      ZStack {\n        RoundedRectangle(cornerRadius: 12).strokeBorder()\n        Text(\"2\")\n      }.foregroundColor(.purple)\n      ZStack {\n        RoundedRectangle(cornerRadius: 12).strokeBorder()\n        Text(\"3\")\n      }.foregroundColor(.blue)\n    }\n  }\n}\n```\n\n## Installation\n\n\u003cins\u003eA\u003c/ins\u003eStack is distributed using the [Swift Package Manager](https://swift.org/package-manager). To install it into a project, follow [this tutorial](https://developer.apple.com/documentation/swift_packages/adding_package_dependencies_to_your_app) and use this repository URL: `https://github.com/zntfdr/AStack.git`.\n\n## Credits\n\n\u003cins\u003eA\u003c/ins\u003eStack was built by [Federico Zanetello](https://twitter.com/zntfdr) as a component of [Bangkok Metro](http://yourmetro.app).\n\n## Contributions and Support\n\nAll users are welcome and encouraged to become active participants in the project continued development — by fixing any bug that they encounter, or by improving the documentation wherever it’s found to be lacking.\n\nIf you'd like to make a change, please [open a Pull Request](https://github.com/zntfdr/AStack/pull/new), even if it just contains a draft of the changes you’re planning, or a test that reproduces an issue.\n\nThank you and please enjoy using **\u003cins\u003eA\u003c/ins\u003eStack**!\n\n[ContentSizeCategory]: https://developer.apple.com/documentation/swiftui/environmentvalues/3284540-sizecategory\n[Environment]: https://developer.apple.com/documentation/swiftui/environment\n[UserInterfaceSizeClass]: https://developer.apple.com/documentation/swiftui/userinterfacesizeclass","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjasonnam%2Fastack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjasonnam%2Fastack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjasonnam%2Fastack/lists"}