Badge

fun Badge(count: Int, modifier: Modifier = Modifier, badgeStyle: BadgeStyle = BadgeStyle.Medium, intent: BadgeIntent = BadgeIntent.Danger, overflowCount: Int = BADGE_MAX_COUNT, hasStroke: Boolean = false)

Spark Badge.

A badge is a visual indicator for numeric values such as tallies and scores.

Parameters

count

to use inside the label

modifier

the Modifier to be applied to this badge

badgeStyle

style of the badge which defines its size

intent

The BadgeIntent color to use

overflowCount

defines the max count starting from which + is displayed

hasStroke

whether a border should be drawn


fun Badge(modifier: Modifier = Modifier, badgeStyle: BadgeStyle = BadgeStyle.Medium, intent: BadgeIntent = BadgeIntent.Danger, hasStroke: Boolean = false, contentDescription: String? = null, content: @Composable () -> Unit? = null)

Spark Badge.

A badge is a visual indicator for numeric values such as tallies and scores.

Parameters

badgeStyle

style of the badge which defines its size

modifier

the Modifier to be applied to this badge

intent

The BadgeIntent color to use

hasStroke

whether a border should be drawn

contentDescription

text used by accessibility services to describe what this icon represents. This should always be provided unless this icon is used for decorative purposes, and does not represent a meaningful action that a user can take. This text should be localized, such as by using androidx.compose.ui.res.stringResource or similar

content

optional content to be rendered inside this badge