Skip to content

Button Pill - iOS ​

Button pill allows users to toggle an element to their favourites.

iOSreleased

iOS ​

Syntax ​

swift
Warp.ButtonPill(
    type: ButtonPillType,
    selected: Binding<Bool>
)
swift
Warp.ButtonPill(
    type: .overlay,
    selected: $isSelected
)

Visual options ​

There are a variety of variants supported for the ButtonPill component:

swift
enum Warp.ButtonPillType {
    /// A pill with an overlay appearance.
    case overlay
    /// A pill with a flat appearance.
    case flat
}

Legacy support ​

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

swift
Warp.ButtonPill(
    type: .overlay,
    selected: $isSelected
).uiView

Parameters ​

Required props ​

NameTypeDefaultDescription
typeWarp.ButtonPillTypeThe type of the button (flat or overlay).
selectedBinding BoolA binding to the selected state of the button.

Questions? ​

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