Morphing Bottom Sheet

Morphing Bottom Sheet

A custom draggable sheet over a map with peek, half and full heights and velocity-aware snapping. Its content morphs as it crosses each height: a compact row, swipeable cards, then a full list.

Luiz Mello
  • sheet
  • gesture
  • animation

snippet.swift845 lines

9 files • Scroll to see all →
/// The three resting heights, mirroring Apple Maps: a compact search bar,/// a medium list and a large, scrollable detail view.public enum MorphingBottomSheetDetent: Int, CaseIterable, Hashable {    case compact, medium, large}​/// A place pinned on the map and listed in the sheet.public struct MorphingBottomSheetPlace: Identifiable, Hashable {    public let id: String    public let name: String    /// Filter group shown as a chip in the compact layout, e.g. "Coffee".    public let category: String    public let subtitle: String    public let neighborhood: String    public let address: String    public let hours: String    public let systemImage: String    public let tint: Color    public let rating: Double    public let reviewCount: Int​// ... (click "Show full code" to see more)
Viewing: Model.swift•1 of 9