FloatingSurfaceKit is a small Swift package for building transparent, shadow-friendly AppKit/SwiftUI floating surfaces on macOS.
It currently includes:
FloatingPanelHostingView, a transparentNSHostingViewfor borderless panel content.FloatingPanelShadowhelpers for giving visible SwiftUI surfaces enough transparent panel padding for unclipped shadows.floatingSurfaceShadow(...)andfloatingPanelShadowPadding(...)SwiftUI modifiers.NSPanel.useTransparentFloatingContentHost()for clear, shadowless panel hosts.KeyablePanel, a borderless panel subclass that can become key for text entry.KeyMonitorfor lightweight Escape-key handling in SwiftUI surfaces.NSWindow.focusFirstEditableText(...)andFirstTextFieldFocusBridgefor focusing the first editableNSTextFieldorNSTextViewafter SwiftUI content attaches to anNSPanel.VisualEffect, a thinNSVisualEffectViewwrapper.
The package is deliberately app-agnostic. It is meant for palettes, HUDs (heads-up displays), popovers, compact tool panels, desktop companions, and other floating macOS UI.