{"id":15288661,"url":"https://github.com/flowductive/shiny-swift-ui","last_synced_at":"2025-10-10T06:38:13.565Z","repository":{"id":37245242,"uuid":"425961328","full_name":"Flowductive/shiny-swift-ui","owner":"Flowductive","description":"✨ Write cleaner, conciser, and more consistent SwiftUI code with a suite of pre-made extensions, view modifiers, and components.","archived":false,"fork":false,"pushed_at":"2024-12-06T21:12:19.000Z","size":5104,"stargazers_count":64,"open_issues_count":0,"forks_count":5,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-28T23:13:25.422Z","etag":null,"topics":["appdevelopment","apps","ios","mac-os","macos","swift","swift-ui","swiftui","uikit","view","views"],"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/Flowductive.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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,"zenodo":null}},"created_at":"2021-11-08T19:06:59.000Z","updated_at":"2025-09-20T09:13:28.000Z","dependencies_parsed_at":"2025-04-13T11:09:14.815Z","dependency_job_id":"01878505-d7bb-4c74-9565-bbd995a9f98b","html_url":"https://github.com/Flowductive/shiny-swift-ui","commit_stats":{"total_commits":95,"total_committers":2,"mean_commits":47.5,"dds":"0.11578947368421055","last_synced_commit":"b9244dfea5a6f0529f6302b9ff5f4ba3cffc63b3"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/Flowductive/shiny-swift-ui","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Flowductive%2Fshiny-swift-ui","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Flowductive%2Fshiny-swift-ui/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Flowductive%2Fshiny-swift-ui/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Flowductive%2Fshiny-swift-ui/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Flowductive","download_url":"https://codeload.github.com/Flowductive/shiny-swift-ui/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Flowductive%2Fshiny-swift-ui/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279002970,"owners_count":26083489,"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-10-10T02:00:06.843Z","response_time":62,"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":["appdevelopment","apps","ios","mac-os","macos","swift","swift-ui","swiftui","uikit","view","views"],"created_at":"2024-09-30T15:51:52.015Z","updated_at":"2025-10-10T06:38:13.549Z","avatar_url":"https://github.com/Flowductive.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Social Preview](./Assets/Social%20Preview%20(640).png)\n\n\u003ch2 align=\"center\"\u003eSwiftUI extensions and components that just make sense.\u003c/h2\u003e\n\n\u003cp align=\"center\"\u003e📦 Lightweight, Swift-y looking code for modern SwiftUI developers\u003c/p\u003e\n\u003cp align=\"center\"\u003e⚙️ Dozens of view modifiers to add expected functionality\u003c/p\u003e\n\u003cp align=\"center\"\u003e💨 Custom, built-in transitions \u0026 animations for views\u003c/p\u003e\n\u003cp align=\"center\"\u003e💻 Cross-platform Support for iOS, macOS, watchOS\u003c/p\u003e\n\u003cp align=\"center\"\u003e🧩 Pre-made components that look great in any app\u003c/p\u003e\n\n***\n\n💕 This package **works great with** and is inspired by [SwiftUIX](https://github.com/SwiftUIX/SwiftUIX)!\n\n🚧 **Wiki under construction.** Read below to get started!\n\n![GitHub release (latest SemVer)](https://img.shields.io/github/v/release/Flowductive/shiny-swift-ui?label=version)\n![GitHub Release Date](https://img.shields.io/github/release-date/Flowductive/shiny-swift-ui?label=latest%20release)\n![GitHub issues](https://img.shields.io/github/issues/Flowductive/shiny-swift-ui)\n![GitHub pull requests](https://img.shields.io/github/issues-pr/Flowductive/shiny-swift-ui)\n\n[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2FFlowductive%2Feasy-firebase%2Fbadge%3Ftype%3Dswift-versions)](https://swiftpackageindex.com/Flowductive/shiny-swift-ui)\n[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2FFlowductive%2Feasy-firebase%2Fbadge%3Ftype%3Dplatforms)](https://swiftpackageindex.com/Flowductive/shiny-swift-ui)\n\n## What is ShinySwiftUI?\n\nShinySwiftUI aims to turn messy Swift + SwiftUI code into cleaner, Swift-ier code. It also aims to provide a library of useful modifiers, components, and extensions to create consistent, good-looking apps.\n\n```swift\n// 😴 Before\nHStack {\n  ViewA()\n  ViewB()\n}\n\n// ✨ After\nViewA() + ViewB()\n```\n\n```swift\n// 😴 Before\nMyView().frame(width: 30.0, height: 30.0)\nMyView().frame(maxWidth: 40.0, maxHeight: 40.0)\n\n// ✨ After\nMyView().frame(30.0)\nMyView().frame(max: 40.0)\n```\n\n```swift\n// 😴 Before\nMyView().onAppear {\n  UIApplication.shared.sendAction(#selector(UIResponder.resignFirstResponder), to: nil, from: nil, for: nil)\n}\n\n// ✨ After\nMyView().onAppear {\n  hideKeyboard()\n}\n```\n\n```swift\n// 😴 Before\nMyView().overlay(RoundedRectangle(cornerRadius: 5.0).stroke(.red, lineWidth: 2.0))\n\n// ✨ After\nMyView().roundedBorder(.red, cornerRadius: 5.0, lineWidth: 2.0)\n```\n\n## Completed Features\n\n- App Layout\n  - Pre-defined spacing values [→](https://github.com/Flowductive/shiny-swift-ui#pre-defined-spacing-values)\n  - Layout using Generic Stack [→](https://github.com/Flowductive/shiny-swift-ui#layout-using-generic-stack)\n  - Layout using Shove View [→](https://github.com/Flowductive/shiny-swift-ui#layout-using-shove-view)\n  - Fixed-width spacers [→](https://github.com/Flowductive/shiny-swift-ui#fixed-width-spacers)\n- View Functionality\n  - Operations on views [→](https://github.com/Flowductive/shiny-swift-ui#operations-on-views)\n  - View frame modifiers [→](https://github.com/Flowductive/shiny-swift-ui#view-frame-modifiers)\n  - View refresh modifier [→](https://github.com/Flowductive/shiny-swift-ui#view-refresh-modifier)\n  - View styling modifiers [→](https://github.com/Flowductive/shiny-swift-ui#view-styling-modifiers)\n  - View timing modifiers [→](https://github.com/Flowductive/shiny-swift-ui#view-timing-modifiers)\n  - Custom animation/transitions [→](https://github.com/Flowductive/shiny-swift-ui#custom-animationtransitions)\n  - Debugging view modifier [→](https://github.com/Flowductive/shiny-swift-ui#debugging-view-modifier)\n  - Screenshot view method [→](https://github.com/Flowductive/shiny-swift-ui#screenshot-view-method)\n  - Hover tooltip modifier (macOS) [→](https://github.com/Flowductive/shiny-swift-ui#hover-tooltip-modifier-macos)\n  - View mouse position checking (macOS) [→](https://github.com/Flowductive/shiny-swift-ui#view-mouse-position-checking-macos)\n- Other Features\n  - Image modifiers\n  - Color features [→](https://github.com/Flowductive/shiny-swift-ui#color-features)\n  - Quick dividers\n  - Visual effects [→](https://github.com/Flowductive/shiny-swift-ui#visual-effects)\n  - Pre-made buttons\n  - Action item highlight modifier\n\nMost of the above features are **cross-platform** and are supported on both iOS and macOS.\n\n## Get Started\n\nAdd **ShinySwiftUI** to your project using Swift Package Manager:\n\n```\nhttps://github.com/Flowductive/shiny-swift-ui\n```\n\n## 📐 App Layout Features\n\n### Pre-defined spacing values\n\nImprove code consistency with `CGFloat` spacing values:\n\n```swift\nMyView().padding(.m).cornerRadius(.xs)\n```\n\nThese values include: `.xxs`, `.xs`, `.s`, `.m`, `.l`. `.xl`, and `.xxl`.\n\n### Layout using Generic Stack\n\nYou can use a generic stack, or `GStack`, to position items vertically or horizontally using a `Bool` input:\n\n```swift\nGStack(platform == .iOS ? .vertical : .horizontal) {\n  MyViewA()\n  MyViewB()\n}\n```\n\nA typical use case of `GStack` is for changing display layout on macOS vs. iOS devices.\n\n### Layout using Shove View\n\nUse a `ShoveView` to quickly push inner content to one side/corner:\n\n```swift\n// Position MyView right\nShoveView(.trailing) {\n  MyView()\n}\n\n// Position MyView top-left\nShoveView(.topLeading) {\n  MyView()\n}\n```\n\n### Fixed-width spacers\n\nUse fixed-width spacers for consistent spacing:\n\n```swift\n// Large vertical spacer\nSpacer.VL\n\n// Extra-small vertical spacer\nSpacer.HXS\n```\n\nVertical spacer variants include `.VXXS`, `.VXS`, `.VS`, `.VM`, `.VL`, `.VXL`, and `.VXXL`.\nHorizontal spacer variants include `.HXXS`, `.HXS`, `.HS`, `.HM`, `.HL`, `.HXL`, and `.HXXL`.\n\n## ⚙️ View Functionality\n\n### Operations on views\n\nYou can quickly group views using operators:\n\n```swift\n// Horizontal stack\nMyViewA() + MyViewB()\n\n// Vertical stack, center-aligned\nMyViewA() / MyViewB()\n\n// Vertical stack, left-aligned\nMyViewA() /- MyViewB();\n```\n\n### View frame modifiers\n\nEasily set the dimensions of a square frame:\n\n```swift\n// Sets MyView's frame to width = 30.0, height = 30.0\nMyView().frame(30.0)\n```\n\nStretch the view:\n\n```swift\n// Stretch horizontally\nMyViewA().stretchH()\n\n// Stretch vertically\nMyViewB().stretchV()\n\n// Stretch in both directions\nMyViewC().stretch()\n```\n\n### View refresh modifier\n\nUse a `@State` boolean to refresh a view quickly:\n\n```swift\n@State var refresh: Bool = false\n\nvar body {\n  MyView().refreshable(with: refresh)\n}\n```\n\nUpdating the view would require that `refresh.toggle()` is called.\n\n### View styling modifiers\n\nSet the relative opacity of a view:\n\n```swift\nMyView().opacity(.half)\n```\n\nYou can choose from (in order of opacity) `.opaque`, `.most`, `.half`, `.quarter`, `.almostInvisible`, `.invisible`.\n\nAdd a rounded border to any view:\n\n```swift\nMyViewA().roundedBorder(.green)\nMyViewB().roundedBorder(.red, cornerRadius: .s, lineWidth: 2.0)\n```\n\n### View timing modifiers\n\nRepeat an action in a specified interval:\n\n```swift\nMyView().every(3.0) {\n  print(\"Hello\") // Runs every 3 seconds\n}\n```\n\nPerform an action after a specified delay:\n\n```swift\nMyView().after(3.0) {\n  print(\"Hello\") // Runs 3 seconds after the view appears\n}\n```\n\n### Custom animation/transitions\n\nAdd a slick transition to a view using `.slickAnimation(value:)`:\n\n```swift\nMyViewA().slickAnimation()\nMyViewB().slickAnimation(value: myVal)\n```\n\nAdd a custom built-in animation; i.e. `.slickEaseOut`, `.slickEaseIn`, `.rampEaseOut`, `.rampEaseIn`, `.bounce`, `.lightBounce`, or `.page`:\n\n```swift\nMyViewA().animation(.rampEaseOut)\nMyViewB().animation(.slickEaseOut(duration: 1.0), value: myVal)\n```\n\nAdd a custom built-in transition; i.e. `.turn`, `.swipe`, `.pop`:\n\n```swift\nMyViewA().transition(.turn)\n```\n\n### Debugging view modifier\n\nUse the `.debug()` view modifier to randomly change the background color of the view for debugging:\n\n```swift\nMyView().debug()\n```\n\n### Screenshot view method\n\nTake a screenshot of a view and save the image to path:\n\n```swift\nmyView.snapshot()\n```\n\n### Hover tooltip modifier (macOS)\n\nAdd a tooltip upon hover to a view:\n\n```swift\nMyView()\n.withTooltip(present: $showTooltip) {\n  Text(\"This is a tooltip!\")\n}\n```\n\nAdd a keyboard shortcut, which automatically adds the shortcut tooltip:\n\n```swift\nMyViewA().shortcut(\"c\", modifiers: [.shift, .command])\nMyViewB().shortcut(.defaultAction)\n```\n\n### View mouse position checking (macOS)\n\nTrack the relative position of the mouse pointer within the view:\n\n```swift\nMyView().trackingMouse { pos in\n  // ...\n}\n```\n\n## 🎁 Other Features\n\n### Color features\n\nTake advantage of color utilities:\n\n```swift\n// Init color from hex code\nvar color = Color(hex: \"#ffffff\")\n\n// If bindingBool.wrappedValue is true, show the color\nMyView().foregroundColor(.red.if($bindingBool))\n\n// Get a lighter version of a color\nlighter = color.ligher(by: 0.3)\n\n// Colors also have relative opacities, just like views\nhalfColor = color.opacity(.half)\n```\n\nWhen importing ShinySwiftUI, colors will also conform to `Codable`.\n\n### Visual effects\n\nEasily add SwiftUI wraps of `UIVisualEffectView`:\n\n```swift\nVisualEffectView()\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflowductive%2Fshiny-swift-ui","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fflowductive%2Fshiny-swift-ui","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflowductive%2Fshiny-swift-ui/lists"}