> For the complete documentation index, see [llms.txt](https://docs.servoy.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.servoy.com/reference/servoyextensions/ui-components/buttons-and-text/badge.md).

# Badge

(part of package '[Bootstrap Extra Components](/reference/servoyextensions/packages/ui-component-packages/bootstrap-extra-components.md)')\
Extends designtime/SolutionModel: [JSWebComponent](/reference/servoycore/dev-api/solutionmodel/jswebcomponent.md)\
Extends runtime: [RuntimeWebComponent](/reference/servoycore/dev-api/forms/runtimeform/elements/runtimewebcomponent.md)

The Badge component displays a small tag-like element that can function as either an interactive button or a static label.\
It shows dynamic text along with an optional secondary badge value (often used to indicate counts or status) and supports\
customizable styles and event handling.

This is a reference page; many components have detailed usage guides [here](https://docs.servoy.com/guides/develop/application-design/ui-components).

## Properties

### badgeText

The secondary badge text, often used to display a count or additional information. Type: [Tagstring](/reference/servoy-developer/component_and_service_property_types.md#tagstring)

***

### displayType

Specifies the display type of the badge.\
Possible values are "BUTTON" (for interactive badges) and "LABEL" (for static display). Type: [String](/reference/servoycore/dev-api/js-lib/string.md) Default Value: "BUTTON"

***

### enabled

Indicates whether the badge is enabled for user interaction. Type: [Enabled](/reference/servoy-developer/component_and_service_property_types.md#protected) Default Value: true

***

### imageStyleClass

CSS style classes for an image that may be displayed with the badge. Type: [Styleclass](/reference/servoy-developer/component_and_service_property_types.md#styleclass)

***

### location

The location of the badge component within its parent container. Type: [Point](https://github.com/Servoy/gitbook/blob/master/reference/servoycore/dev-api/js-lib/point.md)

***

### styleClass

Additional CSS style classes for customizing the badge appearance. Type: [Styleclass](/reference/servoy-developer/component_and_service_property_types.md#styleclass)

***

### text

The main text displayed on the badge.\
This text is dynamic and supports internationalization. Type: [Tagstring](/reference/servoy-developer/component_and_service_property_types.md#tagstring)

***

### toolTipText

Tooltip text displayed when hovering over the badge (supports internationalization). Type: [Tagstring](/reference/servoy-developer/component_and_service_property_types.md#tagstring)

***

### visible

Determines whether the badge is visible. Type: [Visible](/reference/servoy-developer/component_and_service_property_types.md#visible)

***

## Events

### onAction(event)

Fired when the badge is clicked.

**Parameters:**

> * {[JSEvent](/reference/servoycore/dev-api/application/jsevent.md)} event The event object containing details about the click event e.g. target element, mouse coordinates

***

### onDoubleClick(event)

Fired when the badge is double-clicked.

**Parameters:**

> * {[JSEvent](/reference/servoycore/dev-api/application/jsevent.md)} event The event object containing details about the double-click event e.g. target element, click timing

***

### onRightClick(event)

Fired when the badge is right-clicked.

**Parameters:**

> * {[JSEvent](/reference/servoycore/dev-api/application/jsevent.md)} event The event object containing details about the right-click event e.g. target element, context menu trigger

***

***


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.servoy.com/reference/servoyextensions/ui-components/buttons-and-text/badge.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
