BadgeProminence

The visual prominence of a badge.

StructureiOS 17.0+macOS 14.0+BadgeProminence in SwiftUI

Declaration

React
type BadgeProminence = 'decreased' | 'increased' | 'standard';
Swift
struct BadgeProminence

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

Type properties

Overview

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)

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

Used by

See also

More in Appearance.