Badge API

This page provides an overview of the Badge component API, detailing its props, emits, slots, and exposed methods/states.

Props

The Badge component accepts the following props:

PropDefaultTypeDescription
mode"primary""primary" or "secondary" or "outline" or "neutral" or undefinedThe visual style of the badge.
class""StyleClass or undefinedCustom CSS class for the badge container.
classContent""StyleClass or undefinedCustom CSS class for the badge content.
pointfalseboolean or undefinedWhether to display a small circular point indicator on the badge.
closeButtonfalseboolean or undefinedWhether to display a close button on the badge.

Emits

The Badge component emits the following events:

EventPayloadDescription
deletevoidEmitted when the close button is clicked or the badge is otherwise removed.

Slots

The Badge component provides the following slots:

SlotPayloadDescription
defaultVNode[]Default slot for custom content inside the badge component.

Expose

The Badge component exposes the following methods and states via ref:

ExposeValueDescription
modeBadgeProps["mode"]Current visual style mode of the badge.
isPointBadgeProps["point"]Indicates whether the point indicator is enabled.
isCloseButtonBadgeProps["closeButton"]Indicates whether the close button is enabled.
deleteBadge() => voidDeletes the badge and triggers the delete event.
© 2025 FishtVue by Egoka