Skip to content

Callout - iOS ​

Callouts are snippets of information, drawing attention to important content.

AndroidreleasedElementsreleasediOSreleasedReactreleasedVuereleased

iOS ​

Syntax ​

swift
Warp.Callout(
    size: CalloutSize = .default,
    type: CalloutType = .inline,
    title: String,
    arrowEdge: Edge = .top,
    arrowOffset: CGFloat? = nil // customizable arrow offset from edge
)
swift
Warp.Callout(title: "This is a Callout")

There are a variety of variants and positions supported for the Callout component:

swift
enum Warp.CalloutSize {
    case small
    case `default`
}

enum Warp.CalloutType {
    case inline
    case popover(onTapped: (() -> Void)?)
}

enum Edge {
    case top
    case leading
    case bottom
    case trailing
}

Legacy support ​

By default all Warp components return a SwiftUI View but there is always a UIKit UIView available to use also.

swift
Warp.Callout(title: "This is a Callout").uiView

Parameters ​

Required props ​

NameTypeDefaultDescription
titleStringThe text to be displayed

Optional Props ​

NameTypeDefaultDescription
sizeWarp.CalloutSize.defaultThe size of the Callout. Use one of the predefined CalloutSize values: .default, or .small.
typeWarp.CalloutType.inlineThe type of the Callout. Use one of the predefined CalloutType values: .inline, or .popover. Popover accepts an optional onClose action, which will display a close button.
arrowEdgeEdge.topThe direction of the arrow. Use one of the predefined Edge values: .top, .leading, .bottom, or .trailing
arrowOffsetCGFloat?nilThe offset of the arrow from the edge. If nil, the arrow will be centered.

Questions? ​

Feel free to ask any questions on usage in the Warp DS Slack channel: #warp-design-system