This documentation is available as Markdown for AI agents and LLMs. See the full Markdown index or append .md to any documentation URL.
BadgedBox
用于在内容上叠加徽章的 Jetpack Compose BadgedBox 组件。
Android
Included in Expo Go
Expo UI BadgedBox 与官方 Jetpack Compose BadgedBox API 一致。它会在图标等内容上叠加徽标。


安装
Terminal
If you are installing this in an existing React Native app, make sure to install expo in your project.
用法
带计数徽标的图标
IconWithBadge.tsx
交互式计数器
InteractiveBadge.tsx
API
import { BadgedBox } from '@expo/ui/jetpack-compose';
Component
Type: React.Element<BadgedBoxProps>
A badged box matching Compose's BadgedBox.
Overlays a badge on top of content (for example, an icon).
Optional • Type:
ReactNodeChildren containing the main content and a BadgedBox.Badge slot.