Visibility
The visibility of a UI element, chosen automatically based on the platform, current context, and other factors.
Declaration
type Visibility = 'automatic' | 'hidden' | 'visible';@frozen enum VisibilityPass a literal, or build one with SwiftUI.Visibility from import { SwiftUI } from 'swiftui-react-native'.
Type properties
'automatic'SwiftUI.Visibility.automaticThe element may be visible or hidden depending on the policies of the component accepting the visibility configuration.
'visible'SwiftUI.Visibility.visibleThe 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
- confirmationDialogPresents a confirmation dialog when a given condition is true, using a localized string resource for the title.
- labelsVisibilityControls the visibility of labels of any controls contained within this view.
- listRowSeparatorSets the display mode for the separator associated with this specific row.
- listSectionIndexVisibilityChanges the visibility of the list section index.
- listSectionSeparatorSets whether to hide the separator associated with a list section.
- menuIndicatorSets the menu indicator visibility for controls within this view.
- navigationLinkIndicatorVisibilityConfigures whether navigation links show a disclosure indicator.
- persistentSystemOverlaysSets the preferred visibility of the non-transient system views overlaying the app.
- presentationDragIndicatorSets the visibility of the drag indicator on top of a sheet.
- scrollContentBackgroundSpecifies the visibility of the background for scrollable views within this view.
- searchSuggestionsConfigures the search suggestions for this view.
- sliderThumbVisibilitySets the thumb visibility for Sliders within this view.
- tableColumnHeadersControls the visibility of a Table's column header views.
- textInputFormattingControlVisibilitySpecifies which system text formatting controls are available for people to format text.
- toolbarBackgroundVisibilitySpecifies the preferred visibility of backgrounds on a bar managed by SwiftUI.
- toolbarVisibilitySpecifies the visibility of a bar managed by SwiftUI.
- writingToolsAffordanceVisibilitySpecifies whether the system should show the Writing Tools affordance for text input views affected by the environment.
See also
More in Appearance.
- BackgroundProminenceThe prominence of backgrounds underneath other views.
- BadgeProminenceThe visual prominence of a badge.
- ButtonSizingThe sizing behavior of Buttons and other button-like controls.
- ColorA representation of a color that adapts to a given context.
- ColorRenderingModeThe set of possible working color spaces for color-compositing operations.
- ColorResolvedA concrete color value.
- ColorResolvedHDRA concrete color value, including HDR headroom information.
- ColorRGBColorSpaceA profile that specifies how to interpret a color value for display.
- ColorSchemeThe possible color schemes, corresponding to the light and dark appearances.
- GlassA structure that defines the configuration of a physical glass material.
- GlassChainGlass with chained calls: SwiftUI.Glass.interactive(...).
- ImageScaleA scale to apply to vector images relative to text.