Structure
OUDSAlertMessage
Alert message is a UI element that displays system feedback, status changes or required action; throughout detailed, prominent, persistent and actionable communication. Alert message includes functional icon and semantic colour, and may include as well a close button and/or action link. Alert Message does not disappear automatically and remains visible until dismissed or resolved by the user.
- iOS 15.0+
- macOS 13.0+
- tvOS 16.0+
- visionOS 1.0+
@MainActor struct OUDSAlertMessage
Mentioned In
Code samples
// A basic positive alert message with text and description
OUDSAlertMessage(label: "Label", description: "You should read this text")
// From a localizable in a bundle
OUDSAlertMessage(LocalizedStringKey("label_wording"), bundle: Bundle.module)
// With a rich text for the description (e.g. markdown here, do not forget to manage the errors)
let richDescription = AttributedString(markdown: "You **must read this text**")
OUDSAlertMessage(label: "Label", description: richDescription)
// A more complex alert message for warning status with a description and a close action
// to dismiss the message.
OUDSAlertMessage(label: "Warning", status: .warning, description: "Some details about the warning") {
// Do some stuff here to dismiss the alert message when clicked
}
// Add a custom icon for accent and neutral status
OUDSAlertMessage(label: "Label", status: .accent(icon: OUDSIcon(asset: Image("ic_heart"))))
OUDSAlertMessage(label: "Label", status: .neutral(icon: OUDSIcon(asset: Image("ic_heart"))))
// Add a custom action (i.e Link) at bottom (could also at top trailing position)
@Environment(\.openURL) private var openUrl
let link = OUDSAlertMessage.Link(text: "Action", position: .bottom) {
openUrl.callAsFunction(url)
}
OUDSAlertMessage(label: "Label", link: link)
Rich text
Only the alert message description and bullet list can use rich text.
Strong text can be used sparingly within alert messages to highlight key information. Underlined text must not be used for emphasis, as it is commonly associated with links. If a hyperlink is needed within the content, the underlined style should be used. Italic should be used with care, some brands do not allow it like Orange brand. No other text styles should be used.
Accessibility considerations
Always check the results of rich text mode with high contrast, light and dark modes, and Voice Over vocalization.
Design documentation
unified-design-system.orange.com
Themes rendering
Orange

Orange Compact

Sosh

Wireframe

Version
1.1.0 (Figma component design version)
Since
1.3.0
Topics
Structures
Initializers
init(LocalizedStringKey, tableName: String?, bundle: Bundle, status: OUDSAlertStatus, description: AttributedString, bulletList: [String], link: OUDSAlertMessage.Link?, onClose: (() -> Void)?)Creates an alert message with a localized label, looking up the key in the given bundle, and a rich text description.
init(LocalizedStringKey, tableName: String?, bundle: Bundle, status: OUDSAlertStatus, description: String?, bulletList: [String], link: OUDSAlertMessage.Link?, onClose: (() -> Void)?)Creates an alert message with a localized label, looking up the key in the given bundle.
init(LocalizedStringKey, tableName: String?, bundle: Bundle, status: OUDSAlertStatus, description: String?, bulletList: [AttributedString], link: OUDSAlertMessage.Link?, onClose: (() -> Void)?)Creates an alert message with a localized label, looking up the key in the given bundle, and a rich text description. Uses rich text for the bullet list.
init(LocalizedStringKey, tableName: String?, bundle: Bundle, status: OUDSAlertStatus, description: AttributedString, bulletList: [AttributedString], link: OUDSAlertMessage.Link?, onClose: (() -> Void)?)Creates an alert message with a localized label, looking up the key in the given bundle, and a rich text description. Uses rich text for the bullet list.
init(label: String, status: OUDSAlertStatus, description: AttributedString, bulletList: [AttributedString], link: OUDSAlertMessage.Link?, onClose: (() -> Void)?)Creates an alert message with description and bullet list containing rich texts.
init(label: String, status: OUDSAlertStatus, description: String?, bulletList: [AttributedString], link: OUDSAlertMessage.Link?, onClose: (() -> Void)?)Creates an alert message with bullet list containing rich text.
init(label: String, status: OUDSAlertStatus, description: String?, bulletList: [String], link: OUDSAlertMessage.Link?, onClose: (() -> Void)?)Creates an alert message.
init(label: String, status: OUDSAlertStatus, description: AttributedString, bulletList: [String], link: OUDSAlertMessage.Link?, onClose: (() -> Void)?)Creates an alert message with a rich text for the description.
Instance Properties