Badge

Documentation and examples for the Badge component.

Preview

Default!Success!Failure!warning | mediumOutline | large

Properties

PropTypeDefaultDescription
variant'default' | 'success' | 'failure' | 'warning' | 'outline'"default"The visual style of the badge.
size'sm' | 'md' | 'xl'"sm"The visual size of the badge.
classNamestringdefault classesAny tailwind classes to modify the look.

Usage

Follow these steps to add and use Badge.

1

Create next app (skip if you already have setup a next app)

terminal
npx create-next-app@latest --yes
2

Install

terminal
npx modui-uikit@latest add badge
3

Implement

typescript
import { Badge } from '@/components/ui/badge'
  
  export default function Example() {
    return (
      <Badge variant="warning" size="md">
        badge of size: medium, variant: warning
      </Badge>
    )
  }