Skip to content
Gravity Logo / Docs Gravity home
Browse documentation
Documentation/Gravity Web

Badge

The Badge component displays a badge or a component that looks like a badge. It supports different variants for various badge styles.

Usage

import { Badge } from 'components/lib';

function MyComponent({ ...props }){
  return (
    <Badge variant='blue'>
      Badge Text
    </Badge>
  );
}

Props

PropDescriptionRequiredValue
classNamecustom stylesoptionalSCSS or Tailwind
childrenbadge textrequiredstring
variantbadge variantoptionalstring (secondary/destructive/outline/red/blue/green/orange)

Notes

  • The Badge component uses the cn function from 'components/lib' to handle class names.
  • The variant prop determines the styling of the badge.
  • Custom styles can be applied using the className prop.
  • For more details, refer to the Shadcn Badge documentation.