# 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: 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.servoy.com/reference/servoyextensions/ui-components/buttons-and-text/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.
