# Badge

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

## Preview

<div align="left"><figure><img src="/files/7JwNdn3hiUfO383iIm22" alt="Gravity badge component" width="72"><figcaption></figcaption></figure></div>

### Usage

```javascript
import { Badge } from 'components/lib';

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

### Props

| Prop      | Description   | Required | Value                                                        |
| --------- | ------------- | -------- | ------------------------------------------------------------ |
| className | custom styles | optional | SCSS or Tailwind                                             |
| children  | badge text    | required | string                                                       |
| variant   | badge variant | optional | string (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.](https://ui.shadcn.com/docs/components/badge)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.usegravity.app/gravity-web/components/badge.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
