Skip to main content
239

Search Lumen

Find components, APIs, guides, and recipes.

GitHub
Themes
React Native docs
Data displayReact Native

Floating badge

Overlay a count on an icon button or avatar.

Public APILumenFloatingBadgeReact Native

Native example

Use Floating badge

Cap large counts, such as 99+.

Floating badge rendered in the Expo web renderer Lumen playground

Captured exampleExpo web renderer

Open interactive preview
Open the Floating badge demo
tsx
import { LumenFloatingBadge, LumenIconButton } from '@santi020k/lumen-react-native'

export function NotificationsButton({ unread, onPress }: { unread: number; onPress: () => void }) {
  return (
    <LumenFloatingBadge count={unread}>
      <LumenIconButton
        intent="outline"
        label={`Notifications, ${unread} unread`}
        name="bell"
        onPress={onPress}
      />
    </LumenFloatingBadge>
  )
}
React Native
A notification button with an unread count over its corner, capped at 99+.

Reference

Public API

The primary shared and platform-specific options exposed by LumenFloatingBadge.

APIValues or typeDefaultDescription
count / max / contentnumber / cap / anchorrequired / 99 / requiredCap large counts, such as 99+.

Native behavior

Design and accessibility

When to use it

Cap large counts, such as 99+.

Accessibility

Decorative by default; put the count in the anchor's name.

Shared component

Available on other platforms

Apple / SwiftUIAndroid / Compose Web
React Native docsNative primitives