explaingit

scenee/floatingpanel

5,806SwiftAudience · developerComplexity · 2/5LicenseSetup · easy

TLDR

FloatingPanel is a Swift library for iOS that adds a sliding bottom-drawer panel to your app, like Apple Maps' search panel, with snap positions, spring animation, and scroll coordination.

Mindmap

mindmap
  root((floatingpanel))
    What it does
      Sliding iOS panel
      Snap to anchor positions
      Spring animation
    Tech Stack
      Swift
      SwiftUI and UIKit
      SPM and CocoaPods
    Use Cases
      Maps-style search drawer
      Content preview panel
      Multi-panel layouts
    Audience
      iOS developers
      Swift engineers
      Mobile app builders
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Add a Maps-style sliding bottom panel to an iOS app that snaps to tip, half-height, and full-screen positions.

USE CASE 2

Build a SwiftUI search interface with a floating panel that scrolls smoothly when the user swipes through a list.

USE CASE 3

Display multiple floating panels simultaneously on one screen, each anchored to a different edge.

Tech stack

SwiftSwiftUIUIKitCocoaPodsSwift Package Manager

Getting it running

Difficulty · easy Time to first run · 30min

Requires iOS 12+ and Swift 5.0+, install via Swift Package Manager or CocoaPods.

MIT license, use freely in any app including commercial, as long as you keep the copyright notice.

In plain English

FloatingPanel is a Swift library for iOS that adds a sliding panel to your app, similar to the drawer that appears at the bottom of Apple Maps when you search for a location. The panel sits in front of the main content, can be dragged up and down between several preset positions (such as a small tip at the bottom, a half-height view, and full-screen), and scrolls naturally when the user swipes through content inside it. The component supports four attachment positions: bottom, top, left, and right. You define one or more anchor points (called magnetic anchors) where the panel snaps into place, and the library handles the spring animation between them. If you want to let users dismiss the panel entirely, you can enable a swipe-to-remove interaction. Multiple panels can be displayed in the same screen at once. The library works with both SwiftUI and UIKit. In SwiftUI you attach it as a view modifier on your main content. In UIKit you create a FloatingPanelController, assign it a content view controller, and add it as a child. Both paths support scroll tracking, which means if the panel contains a scrollable list, the library coordinates the drag gesture between the panel's movement and the scroll view's content offset so the interaction feels continuous. FloatingPanel requires iOS 12 or later and Swift 5.0 or later. It can be installed via Swift Package Manager or CocoaPods. The repository includes several example projects demonstrating the Maps and Stocks app layouts, plus SwiftUI and Objective-C samples. Full API documentation is available on Swift Package Index. The library is MIT licensed and maintained by Shin Yamamoto.

Copy-paste prompts

Prompt 1
How do I add a FloatingPanel to my SwiftUI iOS app so it behaves like the Apple Maps search drawer with snap positions?
Prompt 2
Show me the UIKit code to create a FloatingPanelController with three anchor positions and a scrollable table view inside.
Prompt 3
How do I enable swipe-to-dismiss on a FloatingPanel and get a callback when the user removes it?
Prompt 4
How do I coordinate scroll tracking in FloatingPanel so dragging the inner list and dragging the panel feel seamless?
Prompt 5
Show me a FloatingPanel config that anchors the panel to the left side of the screen instead of the bottom.
Open on GitHub → Explain another repo

← scenee on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.