Skip to content

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.

License

Notifications You must be signed in to change notification settings

killer5962/StackWrapper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

StackWrapper 🌟

GitHub release
Download the latest release


Table of Contents

  1. Introduction
  2. Features
  3. Installation
  4. Usage
  5. Customization
  6. Examples
  7. Contributing
  8. License
  9. Support

Introduction

Welcome to StackWrapper! This component simplifies the process of arranging elements in a flexible layout. It adapts to different screen sizes, making it perfect for iOS development. With StackWrapper, you can easily manage your UI elements, ensuring a smooth user experience across devices.

Features

  • Dynamic Layout: Automatically adjusts height and width based on the elements and screen size.
  • Customizable Properties: Tailor your design with various layout options.
  • SwiftUI Compatibility: Built with Swift and SwiftUI for seamless integration.
  • Lightweight: Minimal overhead for fast performance.
  • Flexible Stacking: Use horizontal or vertical stacking as needed.

Installation

To install StackWrapper, you can use Swift Package Manager (SPM). Follow these steps:

  1. Open your Xcode project.
  2. Go to File > Swift Packages > Add Package Dependency.
  3. Enter the repository URL: https://github.com/killer5962/StackWrapper.
  4. Choose the version you want to use.

You can also download the latest release directly from here. Download the file and execute it in your project.

Usage

Using StackWrapper is straightforward. Here’s a simple example to get you started:

import SwiftUI
import StackWrapper

struct ContentView: View {
    var body: some View {
        StackWrapper {
            Text("Hello, World!")
            Image(systemName: "star")
        }
        .padding()
    }
}

This code creates a basic layout with a text label and an image. StackWrapper takes care of arranging these elements for you.

Customization

StackWrapper offers several properties for customization:

  • Spacing: Control the space between elements.
  • Alignment: Align elements to the start, center, or end.
  • Padding: Add padding around the stack.

Here’s how to customize the spacing and alignment:

StackWrapper(spacing: 10, alignment: .center) {
    Text("Welcome")
    Image(systemName: "heart")
}

Examples

Vertical Stack

StackWrapper(axis: .vertical) {
    Text("Item 1")
    Text("Item 2")
    Text("Item 3")
}

Horizontal Stack

StackWrapper(axis: .horizontal) {
    Text("Left")
    Spacer()
    Text("Right")
}

Custom Spacing and Alignment

StackWrapper(spacing: 20, alignment: .leading) {
    Text("First")
    Text("Second")
}

Contributing

We welcome contributions! If you want to improve StackWrapper, please follow these steps:

  1. Fork the repository.
  2. Create a new branch (git checkout -b feature-branch).
  3. Make your changes.
  4. Commit your changes (git commit -m 'Add new feature').
  5. Push to the branch (git push origin feature-branch).
  6. Create a pull request.

License

StackWrapper is licensed under the MIT License. See the LICENSE file for details.

Support

If you have any questions or need support, feel free to open an issue on GitHub. You can also check the Releases section for updates and changes.

Thank you for using StackWrapper! We hope it enhances your development experience. Happy coding!

About

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.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages