Contents

elizavetaios/dialoggy

**Dialoggy** is a lightweight and flexible SwiftUI library for displaying custom dialogs in iOS apps.

✨ Features

  • Fully customizable buttons, fonts, and colors
  • Easy to integrate via .dialogable() modifier
  • Supports multiple actions
  • Optional icon/image support
  • iOS 17+ compatibility

πŸ“Ί Preview

<p float="left"> <img src="dialoggy-preview.gif" width="200" alt="Dialoggy preview 1" /> <img src="dialoggy-preview2.gif" width="200" alt="Dialoggy preview 2" /> </p>

πŸš€ Installation

Swift Package Manager

Add Dialoggy to your Package.swift:

.package(url: "https://github.com/yourname/Dialoggy.git", from: "1.0.4")

Or via Xcode: File β†’ Add Packages… and paste the repo URL.


πŸ§ͺ Usage Example

struct ContentView: View {
    @State private var dialog: DialogModel?

    var body: some View {
        VStack {
            Button("Show Dialog") {
                dialog = DialogModel(
                    title: "Hello!",
                    message: "This is an example dialog.",
                    actions: [
                        DialogAction(title: "OK", style: .primary) {
                            dialog = nil
                        }
                    ]
                )
            }
        }
        .dialog($dialog)
        .dialogable(style: DialogStyleConfig.default)
    }
}

🎨 Customization

DialogStyleConfig(
    primaryButtonStyle: DialogButtonStyle(
        backgroundColor: .blue,
        foregroundColor: .white,
        cornerRadius: 10
    ),
    secondaryButtonStyle: DialogButtonStyle(
        backgroundColor: .gray.opacity(0.2),
        foregroundColor: .black,
        cornerRadius: 10
    ),
    titleFont: .title2,
    titleForegroundColor: .primary,
    messageFont: .body,
    messageForegroundColor: .secondary,
    imageSize: CGSize(width: 64, height: 64)
)

πŸ“‚ Example

See Examples/DialoggyDemo.swift for a live demo with multiple configurations.


πŸ“„ License

MIT

Package Metadata

Repository: elizavetaios/dialoggy

Default branch: main

README: README.md