StackWrapper
StackWrapper helps you easily and efficiently arrange your desired elements using a flexible layout. This component dynamically adjusts in height and width based on the elements and the device’s screen size. It also allows you to use various properties to customize your design needs.
Install / Use
/learn @Desp0o/StackWrapperREADME
StackWrapper
StackWrapper helps you easily and efficiently arrange your desired elements using a flexible layout. This component dynamically adjusts in height and width based on the elements and the device’s screen size. It also allows you to use various properties to customize your design needs.
Features 🚀
- Flexible Horizontal Wrapping
- Customizable Spacing
- Alignment Control
- Fixed Size Option
- Animation Support
- Layout Calculation
- Responsive to Screen Size
Configuration ⚙️
| Parameter | Type | Default Value | Description |
| :-------- | :---------------- | :------------------ | :---------- |
| items | [T] | N/A | Required: An array of items conforming to Hashable. |
| hSpacing | CGFloat | 10 | Horizontal spacing between items. |
| vSpacing | CGFloat | 10 | Vertical spacing between rows. |
| alignment| HorizontalAlignment | .leading | The alignment of items horizontally. |
| fixedSize| Bool | true | Whether each item should have a fixed size or not. |
| animation| Animation? | nil | Optional animation when the container height changed. |
Usage Guide 📖
First, import StackWrapper package
import StackWrapper
Default Use:
struct MySkills: View {
@State var skills: [String] = ["Swift", "SwiftUI", "UIKit", "Kotlin", "JavaScript", "HTML", "CSS", "React", "Node.js", "Git", "TypeScript", "MongoDB", "Express.js", "REST APIs"]
var body: some View {
VStack {
Hwrapper(items: skills) {skill in
Text(skill)
.padding(12)
.background(.yellow)
.clipShape(RoundedRectangle(cornerRadius: 12))
}
}
.padding()
}
}
<img width="228" alt="Image" src="https://github.com/user-attachments/assets/61363b09-f303-44c6-9161-2d3513b35e3d" />
With custom parameters
Hwrapper(items: skills, vSpacing: 10, hSpacing: 20, alignment: .center, fixedSize: true) { skill in
Text(skill)
.padding(12)
.background(.yellow)
.clipShape(RoundedRectangle(cornerRadius: 12))
}
<img width="228" alt="Image" src="https://github.com/user-attachments/assets/d695e335-bdc8-4931-ac63-8906e905e85f" />
Animation Support
Smooth transitions when the container’s height increases or decreases
VStack {
Hwrapper(items: skills, animation: .easeIn) { skill in
Text(skill)
.padding(12)
.background(.yellow)
.clipShape(RoundedRectangle(cornerRadius: 12))
}
Button("Delete Skill") {
skills.removeLast()
}
.buttonStyle(.borderedProminent)
}
Installation via Swift Package Manager 🖥️
- Open your project.
- Go to File → Add Package Dependencies.
- Enter URL: https://github.com/Desp0o/StackWrapper.git
- Click Add Package.
Contact 📬
- Email: tornike.despotashvili@gmail.com
- LinkedIn: https://www.linkedin.com/in/tornike-despotashvili-250150219/
- github: https://github.com/Desp0o
Related Skills
clearshot
Structured screenshot analysis for UI implementation and critique. Analyzes every UI screenshot with a 5×5 spatial grid, full element inventory, and design system extraction — facts and taste together, every time. Escalates to full implementation blueprint when building. Trigger on any digital interface image file (png, jpg, gif, webp — websites, apps, dashboards, mockups, wireframes) or commands like 'analyse this screenshot,' 'rebuild this,' 'match this design,' 'clone this.' Skip for non-UI images (photos, memes, charts) unless the user explicitly wants to build a UI from them. Does NOT trigger on HTML source code, CSS, SVGs, or any code pasted as text.
openpencil
2.1kThe world's first open-source AI-native vector design tool and the first to feature concurrent Agent Teams. Design-as-Code. Turn prompts into UI directly on the live canvas. A modern alternative to Pencil.
HappyColorBlend
HappyColorBlendVibe Project Guidelines Project Overview HappyColorBlendVibe is a Figma plugin for color palette generation with advanced tint/shade blending capabilities. It allows designers to
Flyaro-waffle-app
Waffle Delight - Full Stack MERN Application Rules & Documentation Project Overview A comprehensive waffle delivery application built with MERN stack featuring premium UI/UX, admin management, a
