Components
AlertModal
The success and outcome screen — a visual, a centred title and description, and a footer of actions, full screen or as a bottom sheet.
Figma description ·
alert-modalOpen in Figma ↗This component has no description in Figma yet.
Props
import SwiftUI import EandTokens // V1.2 alert-modal is a success screen, not a dialog. Full-screen on surface/base/default // (or a bottom sheet over the Scrim): close (top-end, glass) → visual → centred title // block padded 32/16/48 → footer padded 20. struct AlertModal<Visual: View, Footer: View>: View { let title: String; let description: String var onClose: () -> Void @ViewBuilder var visual: Visual @ViewBuilder var footer: Footer var body: some View { VStack(spacing: 0) { HStack { Spacer(); CloseLink(glass: true, action: onClose) } // 40pt section-link .padding([.top, .horizontal], EandSpacing.xl) visual.padding([.top, .horizontal], EandSpacing.xs) VStack(spacing: EandSpacing.xs) { Text(title) // typography/heading/lg variables: 28 / 120%, bold .font(.system(size: EandTypography.headingXl.size, weight: .bold)) Text(description).font(.system(size: EandTypography.bodyLg.size)) } .multilineTextAlignment(.center) .foregroundColor(EandColor.textDefaultDefault) .padding(.top, EandSpacing.spacing3xl).padding(.horizontal, EandSpacing.lg) .padding(.bottom, EandSpacing.spacing5xl) Spacer(minLength: 0) footer.padding(EandSpacing.xl) } .background(EandColor.surfaceBaseDefault.ignoresSafeArea()) } }
When to use
- Use at the end of a flow, when the outcome deserves its own screen: an order placed, a
plan changed, a payment completed. Use
bottom-sheetwhen the user should keep sight of the page behind. - Don't use to ask for confirmation before an action: in V1.2 this is an outcome screen, not a confirmation dialog. For an outcome inside a section or sheet, use PageTitle. For a brief confirmation, use Snackbar.
Anatomy
- Integration —
full-screen(default) fills the viewport onsurface/base/defaultand scrolls.bottom-sheetplaces the same content on a sheet with 24px top corners, over a Scrim. - Visual —
visual, the hero illustration, framed with a 4px inset. - Title block —
titlein bold 28px anddescriptioninbody/lg, both centred. - Footer —
footer, usually one or two block Buttons. - Close —
onCloseshows a glass close button at the top end. On the bottom sheet, a scrim click also calls it.
<AlertModal
integration="bottom-sheet"
visual={<img src={banner} alt="" />}
title="You're all set"
description="Your new plan starts today."
footer={<Button block onClick={done}>Done</Button>}
onClose={done}
/>Deprecated: the centred dialog
When integration is unset and tone, body or actions is passed, the V1.0 centred
confirmation dialog still renders, for existing screens. To move to V1.2, set integration,
and replace body with description, actions with footer and onDismiss with onClose.
Props
| Prop | Type | Default | Description |
|---|---|---|---|
actions? | ReactNode | — | Deprecated. Centred dialog only — use footer. |
body? | ReactNode | — | Deprecated. Centred dialog only — use description. |
description? | ReactNode | — | alert-title description. |
footer? | ReactNode | — | The cta-bar content — usually one or two block Buttons. Padded spacing/xl. |
integration? | 'full-screen' | 'bottom-sheet' | — | Figma integration. Default full-screen. |
onClose? | (() => void) | — | Shows the top-group close button. |
onDismiss? | (() => void) | — | Deprecated. Use onClose. Still dismisses on a scrim click in the centred dialog. |
open? | boolean | true | |
title? | ReactNode | — | alert-title heading. |
tone? | 'warning' | 'info' | 'positive' | 'danger' | — | Deprecated. Centred dialog only. |
visual? | ReactNode | — | The status-banner hero (illustration). Framed with a 4px inset. |
Design
Figma source: alert-modal — etisalat Consumer App DSL V1.2
- Title block (
alert-title): padding 32/16/48 (spacing/3xl,spacing/lg,spacing/5xl), gap 4 (spacing/xs). The title binds thetypography/heading/lgvariables: bold 28px, 120%, tight tracking. - Footer padding 20 (
spacing/xl). The close button sits 20px from the top and end, onsection-link/glass/defaultwith a 20px blur. - The bottom sheet's top corners are 24px (
border-radius/8). - Figma's
status-bannerillustrations are not shipped with the library; supply your own artwork throughvisual.