gluestack-ui logo
Get Updates
Prompt to React Native UI
Home
Components
Hooks
Apps
MCP Server
Guides
Home
Overview
IntroductionQuick Start
Getting Started
InstallationTooling SetupVS Code ExtensionsFigma UI KitCLIgluestack-ui-nativewind-utils
Core Concepts
AccessibilityUniversal
Performance
Benchmarks
Theme Configuration
Default TokensCustomizing ThemeDark Mode
Components
All Components
Typography
HeadingrscTextrsc
Layout
BoxrscCenterrscDividerHStackrscVStackrscGridalpha, rsc
Feedback
AlertProgressSpinnerToast
Data Display
BadgeCardrscTablealpha
Forms
ButtonCheckboxFormControlInputLinkPressableRadioSelectSliderSwitchTextarea
Overlay
AlertDialogDrawerMenuModalPopoverPortalTooltip
Disclosure
ActionsheetAccordionBottomSheetalpha
Media And Icons
AvatarImageIconrsc
Others
FabSkeletonalpha, rsc
Hooks
useBreakPointValue
useMediaQuery
Apps
Dashboard App
Kitchensink App
Todo App
Starter Kit
MCP Server
MCP Server
Guides
Recipes
LinearGradient
Tutorials
Building Ecommerce App
More
Upgrade to v2Upgrade to v3FAQsReleasesRoadmapTroubleshootingDiscord FAQs

Badge

Display status indicators with the Badge component. Perfect for notifications, labels, and status tags in your React Native app. This is an illustration of Badge component.
variant
action
size

Installation

Run the following command:

npx gluestack-ui add badge

API Reference

To use this component in your project, include the following import statement in your file.
import { Badge } from '@/components/ui/badge';
anatomy-imageanatomy-image
export default () => (
  <Badge>
    <BadgeText />
    <BadgeIcon />
  </Badge>
);

Component Props

This section provides a comprehensive reference list for the component props, detailing descriptions, properties, types, and default behavior for easy project integration.

Badge

It inherits all the properties of React Native's View component.

BadgeText

It inherits all the properties of React Native's Text component.

BadgeIcon

Contains all Icon related layout style props and actions. It inherits all the properties of gluestack Style's AsForwarder component.

Props

Badge component is created using View component from react-native. It extends all the props supported by React Native View.

Badge

PropTypeDefaultDescription
action
error | warning | success | info | mutedsuccessDetermines the color scheme of the badge.
variant
solid | outlinesolidDetermines the visual style of the badge.
size
sm | md | lgmdDetermines the size of the badge.
Important Note
Note: These props are exclusively applicable when utilizing the default configuration of gluestack-ui/config. If you are using a custom theme, these props may not be available.

Examples

The Examples section provides visual representations of the different variants of the component, allowing you to quickly and easily determine which one best fits your needs. Simply copy the code and integrate it into your project.

Badge with Avatar

An example of the Badge component being used with the Avatar component to display badges alongside user avatars for enhanced visual representation or identification.

Badge Composition

An example of the Badge component being used with the Composition component, allowing for the display of badges within a composition of other UI elements.
Edit this page on GitHub
Go backToast
Up nextCard
Go backToast
Up nextCard