Const
Badge component
Displays a badge anchored to a child element. Commonly used for notifications, counts, or status indicators. Supports flexible positioning, colors, and variants.
// Basic notification badgem(Badge, { badgeContent: 5 }, m('button.btn', 'Messages'))// Dot badge on avatarm(Badge, { variant: 'dot', color: 'green', overlap: 'circular'}, m('img.circle', { src: 'avatar.jpg' })) Copy
// Basic notification badgem(Badge, { badgeContent: 5 }, m('button.btn', 'Messages'))// Dot badge on avatarm(Badge, { variant: 'dot', color: 'green', overlap: 'circular'}, m('img.circle', { src: 'avatar.jpg' }))
Badge component
Displays a badge anchored to a child element. Commonly used for notifications, counts, or status indicators. Supports flexible positioning, colors, and variants.