Meta

Astryx Badge

Component 4

About

Badge highlights a short status, count, or category label, from Meta's Astryx design system. Ships semantic variants (neutral, info, success, warning, error) plus a full color palette (blue, purple, pink, teal, orange, cyan, green, red, yellow) for tags and counts.

Built with React and Tailwind. Copy the prompt and paste it into Claude Code, Cursor or Lovable: your agent adds Astryx Badge to your project and fits it to your theme.

Code

How Astryx Badge is used: the demo's code. The component's own source comes with a free account.

Usage.tsx

'use client';

import Badge from '@/components/ui/astryx-badge';
import {Theme} from '@astryxdesign/core/theme';
import {neutralTheme} from '@astryxdesign/theme-neutral/built';
import {Stack} from '@astryxdesign/core/Layout';
import {Text} from '@astryxdesign/core/Text';

const COUNTS = [
  {variant: 'info' as const, label: '3', note: 'Messages'},
  {variant: 'error' as const, label: '99+', note: 'Alerts'},
  {variant: 'success' as const, label: '12', note: 'Completed'},
  {variant: 'warning' as const, label: '5', note: 'Pending'},
];

export default function BadgeCountBadges() {
  return (
    <Theme theme={neutralTheme}>
      <div
        style={{
          minHeight: '100dvh',
          display: 'grid',
          placeItems: 'center',
          padding: 24,
        }}>
        <Stack direction="horizontal" gap={8} hAlign="center" vAlign="center">
          {COUNTS.map(({variant, label, note}) => (
            <Stack key={note} direction="vertical" gap={2} hAlign="center">
              <Badge variant={variant} label={label} />
              <Text type="supporting" color="secondary">
                {note}
              </Text>
            </Stack>
          ))}
        </Stack>
      </div>
    </Theme>
  );
}

Dependencies

More by Meta

View all
  • Astryx Banner

    Astryx Banner

    56
  • Astryx Avatar

    Astryx Avatar

    28
  • Astryx Aspect Ratio

    Astryx Aspect Ratio

    28
  • Astryx Button Group

    Astryx Button Group

    23
  • Astryx Toggle Button

    Astryx Toggle Button

    16
  • Astryx Avatar Group

    Astryx Avatar Group

    8
  • Astryx Chat Composer Drawer

    Astryx Chat Composer Drawer

    6
  • Astryx Button

    Astryx Button

    4