Skip to main content

badge

Function badge 

Source
pub fn badge(count: i64, over: AnyPiece) -> AnyPiece
Expand description

Overlay a small numbered blue pill on the TOP-TRAILING corner of over (a notification badge), via [Decorate::overlay_aligned]. Returns over unchanged when count <= 0, so a zero count shows no badge. Pure composition — the pill is a padded, rounded, colored [label].

badge(3, icon.any())  // the icon with a "3" pill in its corner
Day API ↩ Guides· daybrite.dev