---
modificationDate: May 06, 2026
title: BadgedBox
description: A Jetpack Compose BadgedBox component for overlaying badges on content.
sourceCodeUrl: 'https://github.com/expo/expo/tree/sdk-56/packages/expo-ui'
packageName: '@expo/ui'
platforms: ['android', 'expo-go']
---

<AgentInstructions>

## Submitting Feedback

If this page contains errors, outdated information, or gaps that blocked you from completing a task, report it so the docs can be improved:

curl -X POST https://api.expo.dev/v2/feedback/docs-send -H 'Content-Type: application/json' -d '{"url":"/versions/v56.0.0/sdk/ui/jetpack-compose/badgedbox/","feedback":"🤖 Agent feedback: <specific, actionable description>"}'

Only submit when you have something specific and actionable to report.

</AgentInstructions>

# BadgedBox

A Jetpack Compose BadgedBox component for overlaying badges on content.
Android, Included in Expo Go

> For the complete documentation index, see [llms.txt](/llms.txt). Use this file to discover all available pages.

Expo UI BadgedBox matches the official Jetpack Compose [`BadgedBox`](https://developer.android.com/develop/ui/compose/components/badges) API. It overlays a badge on top of content such as an icon.

## Installation

```sh
npx expo install @expo/ui
```

If you are installing this in an [existing React Native app](/bare/overview), make sure to [install `expo`](/bare/installing-expo-modules) in your project.

## Usage

### Icon with badge count

```tsx
import { Host, Badge, BadgedBox, Icon, Text } from '@expo/ui/jetpack-compose';

// Replace with your own vector drawable asset
const mailIcon = require('./assets/mail.xml');

export default function IconWithBadge() {
  return (
    <Host matchContents>
      <BadgedBox>
        <BadgedBox.Badge>
          <Badge>
            <Text>5</Text>
          </Badge>
        </BadgedBox.Badge>
        <Icon source={mailIcon} size={24} />
      </BadgedBox>
    </Host>
  );
}
```

### Interactive counter

```tsx
import { useState } from 'react';
import { Host, Badge, BadgedBox, Icon, Button, Text, Column } from '@expo/ui/jetpack-compose';

// Replace with your own vector drawable asset
const cartIcon = require('./assets/cart.xml');

export default function InteractiveBadge() {
  const [count, setCount] = useState(0);

  return (
    <Host matchContents>
      <Column>
        <BadgedBox>
          <BadgedBox.Badge>
            {count > 0 ? (
              <Badge>
                <Text>{String(count)}</Text>
              </Badge>
            ) : null}
          </BadgedBox.Badge>
          <Icon source={cartIcon} size={24} />
        </BadgedBox>
        <Button onClick={() => setCount(c => c + 1)}>
          <Text>Add item</Text>
        </Button>
      </Column>
    </Host>
  );
}
```

## API

```tsx
import { BadgedBox } from '@expo/ui/jetpack-compose';
```

## Component

### `BadgedBox`

Supported platforms: Android.

Type: React.[Element](https://www.typescriptlang.org/docs/handbook/jsx.html#function-component)<[BadgedBoxProps](#badgedboxprops)\>

A badged box matching Compose's `BadgedBox`. Overlays a badge on top of content (for example, an icon).

> **See:** [Jetpack Compose BadgedBox](https://developer.android.com/develop/ui/compose/components/badges)

BadgedBoxProps

### `children`

Supported platforms: Android.

Optional • Type: `React.ReactNode`

Children containing the main content and a `BadgedBox.Badge` slot.

### `modifiers`

Supported platforms: Android.

Optional • Type: `ModifierConfig[]`

Modifiers for the component.
