When to use it
Cap large counts, such as 99+.
Apple availability
Import LumenUI in the target that uses this component. iPad support follows the iOS package baseline and uses native iPad layout behavior.
Native example
Cap large counts, such as 99+.
import LumenUI
import SwiftUI
struct FloatingBadgeExample: View {
var body: some View {
HStack(spacing: LumenSpacing.xl) {
LumenFloatingBadge(count: 12) {
LumenIconButton(name: .mail, label: "Inbox, 12 unread", intent: .outline) {}
}
LumenFloatingBadge(count: 120) {
LumenIconButton(name: .bell, label: "Alerts, more than 99", intent: .outline) {}
}
}
}
}Reference
The primary shared and platform-specific options exposed by LumenFloatingBadge.
| API | Values or type | Default | Description |
|---|---|---|---|
| count / max / content | number / cap / anchor | required / 99 / required | Cap large counts, such as 99+. |
Native behavior
Cap large counts, such as 99+.
Decorative by default; put the count in the anchor's name.
Shared component