Per item style overrides
perItemStyleOverrides : PerItemStyleOverrides
type EntitiesType = 'playerId' | 'teamId' | 'gameId';
type PerItemStyleOverrides = Record<EntitiesType, Array<{ name: string; theme: IWidgetTheme }>>;The perItemStyleOverrides property in IWidgetViewOptions facilitates custom styling for individual items within a widget based on specific entity identifiers.
This feature enhances flexibility by allowing unique visual representations for each item within the widget.
Structure
The perItemStyleOverrides structure comprises an object with keys that identify entities within the widget, such as playerId, teamId, or gameId.
Each key corresponds to an array of objects, where each object defines custom styling for a specific entity.
Entity Identifier
An entity identifier, such as playerId, teamId, or gameId, specifies the particular entity to be styled individually within the widget.
Within the array, each object contains the following properties:
name: This property serves as a unique identifier or key associated with the entity. It distinguishes one entity from another within the widget.
theme: This property refers to an instance of IWidgetTheme, which defines customized styling for the specified entity. It encapsulates visual attributes like colors, fonts, and layout configurations tailored to the entity's representation.
perItemStyleOverrides: {
"playerId": [
{
name: "35450",
theme: rowCircleThemePlayer
},
{
name: "28237",
theme: rowCircleThemePlayer
},
{
name: "46046",
theme: rowCircleThemePlayer
}
],
"teamId": [
{
name: "real-madrid",
theme: rowCircleThemeRealMadrid
}
]
} Pass perItemStyleOverrides as part of IWidgetViewOptions when you create a widget. See BlazeSDK class.
Updated 16 days ago
