SweetUI

Search items

Jump to an item

component

alert

Inline alert: informational, positive, destructive; optional caller actions.

alertbannernoticefeedbackstatusshadcn
alert, light

On iPad

The same installed source at a regular width. It adapts its layout without a separate design.

alert on iPad, light

Install

With the sweetui tool (brew install mangobyte-dev/tap/sweetui):

sweetui install alert --destination Sources/YourFeature/Components

Installs in order: button 0.5.2, alert 0.2.1. Point --destination at a folder inside the consuming target's sources.

Usage

InlineAlert(
    "Card delivery delayed",
    message: Text("Your new card now arrives on Thursday.")
)

InlineAlert(
    "Payment failed",
    message: Text("The card on file was declined.")
) {
    Button("Retry") {}
        .buttonStyle(.registry)
}
.registryVariant(.destructive)

Accessibility contract

  • Symbol-color pair; MUST NOT rely on color alone.
  • Title+message: one element. Buttons: separate, activatable.
  • VoiceOver skips symbol; title MUST name outcome.
  • MUST NOT interrupt; required answers SHOULD use .alert.

Details

Kindcomponent
Version0.2.1
PlatformsiOS 26.0+
Dependenciesbutton
SourceRegistry/sources/components/InlineAlert.swift
Xcode previewInline Alert