BadgeDefaults

Contains default values used by Badge and BadgeBox.

Properties

Link copied to clipboard

The BadgeBox overhang for a count badge on a rectangular icon (COUI coui_hint_red_dot_medium_number_topend_margin_rectangle).

Link copied to clipboard

The diameter of the plain dot form (COUI coui_dot_diameter).

Link copied to clipboard

The default BadgeBox overhang for a plain dot on a rectangular icon (COUI coui_hint_red_dot_medium_icon_topend_margin_rectangle).

Link copied to clipboard

The diameter of one ellipsis dot (COUI couiEllipsisDiameter).

Link copied to clipboard

The gap between two ellipsis dots (COUI coui_hint_red_dot_ellipsis_spacing).

Link copied to clipboard
val Height: Dp

The height of the number capsule form (COUI coui_height).

Link copied to clipboard

The capsule width for counts under 1000 (COUI coui_large_width).

Link copied to clipboard

The capsule width for counts under 100 and the 1000+ ellipsis (COUI coui_medium_width).

Link copied to clipboard

The duration of the COUI badge show / hide scale animation (COUIHintRedDot RED_POINT_ANIM_DURATION), for hosts animating badge visibility.

Link copied to clipboard

The capsule width for counts under 10 (COUI coui_small_width).

Link copied to clipboard

The width of the white outline in the stroke forms (COUI coui_dot_stroke_width).

Link copied to clipboard

The size of the count text (COUI coui_hint_text_size). Defined in dp like the original, so the badge ignores the user font scale; converted with the current density.

Functions

Link copied to clipboard
fun badgeColors(containerColor: Color = if (COUITheme.colorScheme.background.luminance() < 0.5f) BadgeRedDark else BadgeRedLight, contentColor: Color = Color.White, strokeColor: Color = Color.White): BadgeColors

The default BadgeColors. COUIHintRedDot fills with couiColorAdditionalRed - a dedicated badge red distinct from the error color - with white text and stroke.