Skip to content

mtdtechnology-net/swiftui-components

Repository files navigation

Components

Swift Version Platform GitHub License

Overview

UIComponents is a Swift Package Manager (SwiftPM) package that provides a collection of SwiftUI elements and design helpers to enhance the development of your SwiftUI-based projects.

Features

Views

  • ImageContentView
  • InputView
  • Toast
  • GenericTextField
  • PrimaryButton

ButtonStyle

  • ActionButtonStyle
  • FullButtonStyle
  • SocialButtonStyle

ViewModifiers

  • FullButtonStyle
  • CardModifier
  • ToastView

Error

  • Alert
  • InterfaceError

Localization

  • Localization using swiftgen

Installation

Swift Package Manager

To integrate UIComponents into your Xcode project, add it as a dependency in your Package.swift file:

.package(url: "https://github.com/MTD-Technology-Romania/swiftui-components)", from: "1.0.0")

Then, add Components to your target's dependencies.

.target(
    name: "Components",
    dependencies: ["Components"]
),

Usage

Here's a simple example demonstrating how to use a component from UIComponents in your SwiftUI code:

import Components

struct ContentView: View {
    var body: some View {
        VStack {
            InputView(title: "Email", color: .gray, systemImage: "envelope", inputBackground: .white, inputOverlay: .gray) {
                TextField("Enter your email here", text: .constant(""))
                  .textContentType(.emailAddress)
                  .keyboardType(.emailAddress)
                  .foregroundColor(.gray)
            }
            .padding()
            // Add more components as needed
        }
    }
}

Documentation

For detailed documentation and examples, refer to the Documentation folder in this repository.

Contributing

Contributions are welcome! Please follow our Contribution Guidelines.

License

YourPackageName is available under the MIT license. See the LICENSE file for more info.