A versatile decorator for use within other components.
The q2-badge element has one or more properties that support text localization. Those properties are indicated by the localizable badge in the description.
maxLengthmax-lengthThe number of characters to show. A maximum limit of 18 characters is acceptable.
sizeThe size of the badge.
statusThe stoplight color of the element when theme is not present.
themeThe color of the badge when in the active state.
The theme has higher priority than status.
valueWhat to display in the badge. Negative numbers will be shown as positive.
q2-badge also has limited support for slotted HTML elements.
The q2-badge element exposes methods that can be used to perform various actions on the component.
Returns the text content of the badge. This accounts for the text in slotted elements or the Shadow DOM.
getTextContent() => Promise<string>This component uses other components in the Tecton library, including:
Other components in the Tecton library use this component, including:
q2-data-tableq2-inputq2-tab-containerInitial Release
value property accepts text
"empty" display state
When using the q2-badge in its "empty" state as a decorator in other elements, it is the implementer's responsibility to ensure proper screen reader text is made available for assistive technologies.
When the q2-badge has a value, the element will be visible to assistive technologies and will be read aloud.
The following CSS variables are available to override the default theme styles of the q2-badgecomponent.