SkillAgentSearch skills...

MacToastKit

A minimal toast library for macOS

Install / Use

/learn @daniyalmaster693/MacToastKit
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

MacToastKit

MacToastKit provides an easy and minimal way to include toast messages in your mac app. It focuses on giving developers an easy way to provide visual feedback to users with minimal effort.

<img src="/Assets/Screenshots/MacToastKit-1.png" width="100%" alt="MacToastKit"/>

Install

Compatibility: macOS 13+

Add https://github.com/daniyalmaster693/MacToastKit in the “Swift Package Manager” tab in Xcode.

Features

  • Minimal and Native Design
  • Customizable Messages and Icons
  • Customizable durations
  • Adjustable Positioning
  • Dismiss to Click
  • Show's on active display

Usage

Call the showToast() function when you want to display a message. That's it.

import SwiftUI
import MacToastKit

@main
struct MyApp: App {
    var body: some Scene {
        WindowGroup {
            Button("Delete task") {
                let toast = ToastWindowController()

                  toast.showToast(
                    message: "Deleted Task",
                    icon: Image(systemName: "trash.fill"),
                    duration: 3,
                    position: .bottomCenter(100)
                )
            }
        }
    }
}

Parameters

The showToast() function supports parameters to control what it displays and how it behaves.

  • message: A string that describes the purpose of the toast
  • icon: An optional icon that displays with the text
  • duration: An optional double value that controls how long the toast will be visible
  • position: Controls the position of the toast on the user's screen, with an offset parameter

Template Toasts

You can create template toasts for messages that are repeatedly used throughout your app.

import SwiftUI
import MacToastKit

func showSuccessToast(
    _ message: String = "Action Completed",
    icon: Image? = nil,
    duration: TimeInterval = 3,
    position: ToastPosition = .bottomCenter(100)
) {
    DispatchQueue.main.async {
        let toast = ToastWindowController()
        toast.showToast(
            message: message,
            icon: icon ?? Image(systemName: "checkmark.circle.fill"),
            duration: duration,
            position: position
        )
    }
}

func showErrorToast(
    _ message: String = "Action Failed",
    icon: Image? = nil,
    duration: TimeInterval = 3,
    position: ToastPosition = .bottomCenter(100)
) {
    DispatchQueue.main.async {
        let toast = ToastWindowController()
        toast.showToast(
            message: message,
            icon: icon ?? Image(systemName: "x.circle.fill"),
            duration: duration,
            position: position
        )
    }
}

Showcase

License

This project is licensed under the MIT license.

View on GitHub
GitHub Stars31
CategoryDevelopment
Updated1mo ago
Forks1

Languages

Swift

Security Score

95/100

Audited on Feb 16, 2026

No findings