Visibility

The visibility of a UI element, chosen automatically based on the platform, current context, and other factors.

EnumerationiOS 15.0+macOS 12.0+tvOS 15.0+watchOS 8.0+Visibility in SwiftUI

Declaration

React
type Visibility = 'automatic' | 'hidden' | 'visible';
Swift
@frozen enum Visibility

Pass a literal, or build one with SwiftUI.Visibility from import { SwiftUI } from 'swiftui-react-native'.

Type properties

  • 'automatic'SwiftUI.Visibility.automatic

    The element may be visible or hidden depending on the policies of the component accepting the visibility configuration.

  • 'hidden'SwiftUI.Visibility.hidden

    The element may be hidden.

  • 'visible'SwiftUI.Visibility.visible

    The element may be visible.

Overview

For example, the preferred visibility of list row separators can be configured using the View.listRowSeparator(_:edges:).

From Apple’s SwiftUI documentation. Code samples there are Swift.

Used by

See also

More in Appearance.