Interactive previews iPhone

Item Alert

Presents an alert using the given data to produce the alert’s content and a text view as a title.

Item Alert - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview

Platform Compatibility

iOS 27.0+ iPadOS 27.0+ macOS 27.0+ watchOS 27.0+ tvOS 27.0+ visionOS 27.0+

Tags

SwiftUI Code

Docs
struct Item {}

@State var item: Item? = .init()

var body: some View {
    Text("Foo")
        .alert("Title", item: $item) { alertItem in
            Button("Ok") {
                print("Item nilled")
            }
        }
}

Found an issue or have a suggestion?

Created: June 9, 2026Updated: June 9, 2026
Connect Wizard

Connect Wizard

Unlock insights App Store Connect doesn’t show you.

Get Started

More Alert Components

View all
Message Error Alert - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
modifier

Message Error Alert

Presents an alert with a message when an error is present.

Message Item Alert - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
modifier

Message Item Alert

Presents an alert with a message using the given data to produce the alert’s content and a localized string key for a title.

Error Alert - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
modifier

Error Alert

Presents an alert when an error is present.

Explore Other Components

Browse all
Tab View Side Bar Header - iPadOS - Landscape - Liquid Glass - Light Mode - Preview
modifier

Tab View Side Bar Header

Adds a custom header to the sidebar of a tab view.

NavigationLinkPickerStyle - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
style

NavigationLinkPickerStyle

A picker style represented by a navigation link that presents the options by pushing a List-style picker view.

Content Unavailable Search Text - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
type

Content Unavailable Search Text

A pre-built placeholder for empty search results with search text

Picker - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
initializer

Picker

Creates a pickers with title, image, systemImage, and custom label.

Button Roles - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
style

Button Roles

A value that describes the purpose of a button.

ButtonToggleStyle - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
style

ButtonToggleStyle

A toggle style that displays as a button with its label as the title.

TabsPickerStyle - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
style

TabsPickerStyle

A picker style that presents options as segmented tabs. On macOS, this style produces a segmented picker with a visual treatment that distinguishes tab navigation from value selection. On iOS, tvOS, and visionOS, the visual appearance matches that of the standard standard .segmented style. On all supported platforms, VoiceOver announces options as tabs.

ToolbarItem Shared Background Visibility - iOS on iPhone - Portrait - Liquid Glass - Light Mode - Preview
modifier

ToolbarItem Shared Background Visibility

Controls the visibility of the glass background effect on items in the toolbar. In certain contexts, such as the navigation bar on iOS and the window toolbar on macOS, toolbar items will be given a glass background effect that is shared with other items in the same logical grouping