{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "badge",
  "title": "Badge",
  "type": "registry:ui",
  "files": [
    {
      "path": "packages/registry-native/components/badge/Badge.tsx",
      "content": "import * as React from 'react'\nimport { Text, View, type ViewProps } from 'react-native'\nimport Animated, {\n  useAnimatedStyle,\n  useReducedMotion,\n  useSharedValue,\n  withRepeat,\n  withTiming,\n} from 'react-native-reanimated'\nimport { cn } from '@/lib/utils'\nimport { enterFor, exitFor, motionDurations, type EnterPreset, type ExitPreset } from '@/lib/motion'\nimport { badgeTextVariants, badgeVariants, type BadgeVariants } from './badge.variants'\n\nexport interface BadgeProps extends ViewProps, BadgeVariants {\n  className?: string\n  children?: React.ReactNode\n  textClassName?: string\n  text?: string\n  /** Looping attention pulse (opacity 1 <-> 0.55). Use sparingly — one pulsing badge per screen. */\n  pulse?: boolean\n  /** Mount entrance. */\n  enter?: EnterPreset\n  /** Unmount exit, for badges removed from a conditional tree. */\n  exit?: ExitPreset\n}\n\nfunction Badge({\n  className,\n  textClassName,\n  variant = 'default',\n  children,\n  text,\n  pulse = false,\n  enter = 'none',\n  exit = 'none',\n  ...props\n}: BadgeProps) {\n  const reduced = useReducedMotion()\n  const opacity = useSharedValue(1)\n  const pulseStyle = useAnimatedStyle(() => ({ opacity: opacity.value }))\n\n  React.useEffect(() => {\n    opacity.value =\n      pulse && !reduced ? withRepeat(withTiming(0.55, { duration: motionDurations.slow * 2 }), -1, true) : 1\n  }, [pulse, reduced, opacity])\n\n  // Entering and pulse live on separate views: Reanimated warns when a layout\n  // animation and an animated style share one view.\n  return (\n    <Animated.View entering={reduced ? undefined : enterFor(enter)} exiting={reduced ? undefined : exitFor(exit)}>\n      <Animated.View cssInterop={false} style={pulse && !reduced ? pulseStyle : undefined}>\n        <View accessibilityRole=\"text\" className={cn(badgeVariants({ variant }), className)} {...props}>\n          {(text ?? typeof children === 'string') ? (\n            <Text className={cn(badgeTextVariants({ variant }), textClassName)}>{text ?? children}</Text>\n          ) : (\n            children\n          )}\n        </View>\n      </Animated.View>\n    </Animated.View>\n  )\n}\n\nexport { Badge }\n",
      "type": "registry:ui",
      "target": "~/components/ui/badge/Badge.tsx"
    },
    {
      "path": "packages/registry-native/components/badge/badge.variants.ts",
      "content": "import type { VariantProps } from 'class-variance-authority'\nimport { cva } from 'class-variance-authority'\n\nexport const badgeVariants = cva('flex-row items-center justify-center rounded-full border px-2 py-0.5', {\n  variants: {\n    variant: {\n      default: 'border-transparent bg-primary',\n      secondary: 'border-transparent bg-secondary',\n      destructive: 'border-transparent bg-destructive',\n      outline: 'border-border',\n      // Solid tokens, not `bg-success/15` tints like web: opacity modifiers on\n      // plain var() colors compile to nothing in the Tailwind v3 pipeline.\n      success: 'border-transparent bg-success',\n      warning: 'border-transparent bg-warning',\n      info: 'border-transparent bg-info',\n    },\n  },\n  defaultVariants: {\n    variant: 'default',\n  },\n})\n\nexport const badgeTextVariants = cva('text-xs font-medium text-center', {\n  variants: {\n    variant: {\n      default: 'text-primary-foreground',\n      secondary: 'text-secondary-foreground',\n      destructive: 'text-destructive-foreground',\n      outline: 'text-foreground',\n      success: 'text-success-foreground',\n      warning: 'text-warning-foreground',\n      info: 'text-info-foreground',\n    },\n  },\n  defaultVariants: {\n    variant: 'default',\n  },\n})\n\nexport type BadgeVariants = VariantProps<typeof badgeVariants>\n",
      "type": "registry:ui",
      "target": "~/components/ui/badge/badge.variants.ts"
    },
    {
      "path": "packages/registry-native/components/badge/index.ts",
      "content": "export { Badge, type BadgeProps } from './Badge'\nexport { badgeTextVariants, badgeVariants, type BadgeVariants } from './badge.variants'\n",
      "type": "registry:ui",
      "target": "~/components/ui/badge/index.ts"
    }
  ],
  "dependencies": [
    "class-variance-authority",
    "react-native-reanimated"
  ],
  "devDependencies": [],
  "registryDependencies": [
    "https://native.uipkge.dev/r/native/motion.json"
  ],
  "description": "Small mobile status pill (View + Text) with 7 variants, attention pulse loop, and opt-in entering/exiting motion.",
  "categories": [
    "data-display"
  ]
}