Declaration
compose().badgeProminence(prominence: SwiftUI.BadgeProminence)nonisolated func badgeProminence(
_ prominence: BadgeProminence
) -> some ViewParameters
prominence*SwiftUI.BadgeProminenceThe prominence to apply to badges.
Discussion
Badges can be used for different kinds of information, from the passive number of items in a container to the number of required actions. The prominence of badges in Lists can be adjusted to reflect this and be made to draw more or less attention to themselves.
Badges will default to standard prominence unless specified.
The following example shows a List displaying a list of folders
with an informational badge with lower prominence, showing the number
of items in the folder.
List(folders) { folder in
Text(folder.name)
.badge(folder.numberOfItems)
}
.badgeProminence(.decreased)See also
More in Appearance.
- backgroundSets the view's background to a style.
- badgeGenerates a badge for the view from a localized string resource.
- borderAdds a border to this view with the specified style and width.
- buttonSizingThe preferred sizing behavior of buttons in the view hierarchy.
- containerBackgroundSets the container background of the enclosing container using a view.
- headerProminenceSets the header prominence for this view.
- hiddenHides this view unconditionally.
- imageScaleScales images within the view according to one of the relative sizes available including small, medium, and large images sizes.
- labelIconToTitleSpacingSet the spacing between the icon and title in labels.
- labelReservedIconWidthSet the width reserved for icons in labels.
- labelsHiddenHides the labels of any controls contained within this view.
- labelsVisibilityControls the visibility of labels of any controls contained within this view.