strikethrough

Applies a strikethrough to the text.

Text ModifieriOS 13.0+macOS 10.15+tvOS 13.0+watchOS 6.0+

Overloads

2 ways to call compose().strikethrough(). Each is one SwiftUI overload, picked by the arguments you pass.

React
compose().strikethrough(
  isActive?: boolean,
  options?: {
    color?: SwiftUI.Color | null;
  }
)
Swift
nonisolated func strikethrough(
    _ isActive: Bool = true,
    color: Color? = nil
) -> Text

Parameters

  • isActiveboolean

    A Boolean value that indicates whether the text has a strikethrough applied.

  • options.colorSwiftUI.Color | null

    The color of the strikethrough. If color is nil, the strikethrough uses the default foreground color.

Return value

Text with a line through its center.

See also

More in Text modifiers.