Docs
Sheets

Notice Stack

In-app notices stacked like notifications: the newest on top, a tap spreads the pile, and cards swipe away at your speed.

By · Updated

Notice Stack: SwiftUI Notification Stack for iOS, live preview in light mode

Notice Stack, a SwiftUI Notification Stack for iOS 17+, in its live preview. Open Code for the Swift source.

$npx swiftpieces add NoticeStack
Free · MIT + Commons ClauseiOS 17.0+Liquid Glassnoticesnotificationsstackswipe-to-dismissclear-allglasshaptics
Type
NoticeStack
Files
NoticeStack.swift
Depends on
Nothing (Apple frameworks only)
Version
1.0.0

A pile of in-app notices (alerts, reminders, delivery updates, system messages), newest first. Collapsed, the newest notice shows in full on a glass card, with up to two narrower peeks of the rest beneath it, melted into one liquid shape. Tap the pile and it spreads into a list while Show less and a clear button bud out of the top card. Swipe a card sideways (the top one while collapsed, any of them in the list): it follows the finger, and past 40% of the width, or with a flick, it flies off and leaves notices, while the rest close up. The clear button stretches into a red Clear all capsule; a second tap sends every card off. Insert a notice at the front of notices and it drops in from above. swift @State private var notices: [NoticeStack.Notice] = [] @State private var expanded = false NoticeStack(notices: $notices, expanded: $expanded) { notice in open(notice) }

Notes

  • notices is the stack, newest first, and the source of truth: a swipe or Clear all removes from it, and you add, update and remove notices the same way. Each Notice has a unique id, a title, an optional message, an SF Symbol on a solid tile (tint: .sky, .butter, .sage, .lilac, .sand, .red for the one that can't wait, .neutral for system messages, or .init(color, ink:)), and an optional date.
  • Collapsed, the newest notice shows in full and up to two peeks of the rest sit under it, each 10 points narrower per side and 10 points lower, cut to the front card's height, so the glass of the pile is one liquid shape. More notices still show two peeks. The peeks' words stay hidden so they never print over the front card.
  • Insert a notice at index 0 and it drops in from above as a drop of glass, the pile settling under it, with a soft tick and a VoiceOver announcement. Remove one yourself and it melts into the pile while the rest close up. Empty draws nothing, so your screen decides what to show instead.
  • Tap the pile and it spreads into a list, 12 points apart (Style.spacing), while Show less and a clear button bud out of the top card on liquid necks. With a single notice, a tap calls onSelect instead. In the list, a tap calls onSelect with that notice; leave onSelect out and cards only expand and collapse.
  • Swipe a card sideways (the front card while collapsed, any card in the list): it follows the finger, and the next card's words show in the columns it uncovers. Past 40% of the width, or with a flick that would carry it there, it flies off at the finger's speed on a spring with no bounce, leaves notices while still on its way out, and the rest close up; collapsed, the next card rises out of its peek. Short of that it springs back from where you let go.
  • The clear button stretches into a red Clear all capsule, its words arriving letter by letter. Tap it again and the cards leave one after another from the bottom while the header melts into the top card, which goes last. Tap anywhere else in the stack, or wait three seconds, and it folds back into the clear button.
  • Times read "now", "4m", "2h", "3d", then a date after a week, through Duration and date formatters, and stay current every minute. VoiceOver reads them as "4 minutes ago".
  • Swipes come from a UIKit pan that starts only for a mostly horizontal drag, so the stack sits in a ScrollView, a List or a sheet without stealing vertical scrolls or the sheet's pull. When the list can grow long, put the stack in a scroll view.
  • VoiceOver: the collapsed pile is one button ("3 notices. Gate changed. Boarding is now B12, ten minutes earlier.", hint "Shows all") with Dismiss and Clear all actions. In the list every card is its own element with onSelect as its activation and a Dismiss action, Show less and Clear all are buttons, focus moves to the first card when the list opens, and Escape (the two finger scrub) closes it. Arrivals, dismissals and Clear all are announced.
  • Reduce Motion: cards no longer fly or drop in. A dismissed card slides a short way while its glass closes in place, an arrival opens in place, the list opens and closes on short eases without overshoot, and the header's bubbles fade and close where they are. Letters crossfade.
  • Dynamic Type: cards grow, titles wrap to three lines and messages to eight, and at accessibility sizes the tile moves above the words so they keep the width. The tile, its symbol and the header scale with the text, and the header keeps 44 point targets. All text is one weight, semibold. Right to left mirrors the cards and the header, and swipes follow the finger.
  • Haptics: a soft tick when a notice arrives, a light tap when the list opens or closes, a firm tick when a swipe commits, a selection tick when the clear button arms, and success when Clear all runs.
  • The cards and header are liquid glass in one group, spaced below the list's gap, so separate cards never neck at rest and only melt while they spread, gather or leave. On iOS 26 this is Liquid Glass; before that a frosted material; under Reduce Transparency solid fills. Red appears only on Clear all, and on a tile whose tint is .red.
  • Style sets the title and secondary colors, the Clear all red and its ink, the cards' corner radius and the list's gap (at least 10 points). Messages replaces any copy, such as showLess: "Collapse", and its count, arrived and dismissed closures shape the VoiceOver strings.

Usage

NoticeStackExample()

Parameters

ParameterDescription
noticesThe notices, newest first, each with a unique id. Swipes and Clear all remove from it; insert at index 0 to show a new one, which drops in with a soft tick. Remove one yourself and it melts into the pile. Empty draws nothing, so your screen decides what to show instead.
expandedWhether the pile is spread into a list. Tapping the pile, Show less and Escape set it, and it returns to false when the last notice goes.
styleColors, the cards' corner radius and the gap between cards in the list. Defaults to the SwiftPieces house palette, adapting to light and dark, with red for Clear all.
messagesThe built-in copy, such as "Show less", "Clear all" and the VoiceOver announcements. Defaults are localizable through your String Catalog; replace any line.
onSelectCalled with the notice tapped in the list, or the only notice when there is one. While the pile holds several, a tap spreads it instead. nil, the default, leaves cards to expand and collapse only.

Install

Pick one. Run it from the folder that contains your .xcodeproj and the files land inside your app.

Terminal

$npx swiftpieces add NoticeStack

Or ask your coding agent · Claude Code, Cursor or Xcode, once the MCP server is connected

>Add the SwiftPieces "Notice Stack" piece to my app

Or copy the source above into your app.

New to SwiftUI?If you know React, CSS or Tailwind, SwiftUI is easier to pick up than it looks.Try real app patterns first

Building a whole app? See SwiftPieces Pro →

All sheets →

Build it yourself: SwiftUI haptics guide

On this page

SwiftPiecesPro

Build the whole app with one library.

Production-ready screens, whole flows, complete app templates, a Build Kit your agent follows and Pro remixing.

Explore Pro