Usage
Signature:
interface CBadgeElement
Typescript Import Format
//To typecheck the element APIs, import as below.
import { CBadgeElement } from "oj-c/badge";
//For the transpiled javascript to load the element's module, import as below
import "oj-c/badge";
For additional information visit:
Note: Application logic should not interact with the component's properties or invoke its methods until the BusyContext indicates that the component is ready for interaction.
Attributes
-
edge :"none"|"end"
-
Specifies the edge of the badge. Badges can be attached to the end edge of another component. They lose their default corner rounding on right side for ltr direction or left side for rtl direction.
Names
Item Name Property edge
Property change event edgeChanged
Property change listener attribute (must be of type function, see Events and Listeners for additional information.) on-edge-changed
-
label* :string
-
"Specifies the text to be displayed in the badge.
Names
Item Name Property label
Property change event labelChanged
Property change listener attribute (must be of type function, see Events and Listeners for additional information.) on-label*-changed
-
size :"sm"|"md"
-
Specifies the size of the badge. Consists of two options: medium and small. The default value of this property is theme driven.
Names
Item Name Property size
Property change event sizeChanged
Property change listener attribute (must be of type function, see Events and Listeners for additional information.) on-size-changed
-
variant :"success"|"danger"|"info"|"warning"|"neutral"|"neutralSubtle"|"dangerSubtle"|"successSubtle"|"warningSubtle"|"infoSubtle"
-
Sets the variant for the badge. Badge can be subtle or solid with different colors. The default value of this property is theme driven.
Names
Item Name Property variant
Property change event variantChanged
Property change listener attribute (must be of type function, see Events and Listeners for additional information.) on-variant-changed
Methods
-
getProperty(property) : {any}
-
Retrieves the value of a property or a subproperty.
Parameters:
Name Type Description property
string The property name to get. Supports dot notation for subproperty access. Returns:
- Type
- any
-
setProperties(properties) : {void}
-
Performs a batch set of properties.
Parameters:
Name Type Description properties
object An object containing the property and value pairs to set. Returns:
- Type
- void
-
setProperty(property, value) : {void}
-
Sets a property or a single subproperty for complex properties and notifies the component of the change, triggering a corresponding event.
Parameters:
Name Type Description property
string The property name to set. Supports dot notation for subproperty access. value
any The new value to set the property to. Returns:
- Type
- void