Badge
A small emblem to attach to avatars, icons, and other elements togenerate notifications.
Usage
import { Badge } from 'matterial'
function App() {
return (
<Badge content={99}>
<Icon icon="Notification" />
</Badge>
)
}
Basic Badge
1<Badge content={1}>
<Icon icon="Notification" />
</Badge>
Colored Badge
P
99S
99D
99L
99C
99E
99W
99I
99S
99M
99M
99M
99M
99H
99Dot Badge
The dot
variant changes a badge into a small dot. This can
be used as a notification that something has changed without giving a
count.
<Badge variant="dot" color="secondary">
<Icon icon="Notification" />
</Badge>
Maximum Content
Use the max
prop to specify the maximum number in the
badge.
<Badge color="red" max={99} content={100}>
<Icon icon="Notification" />
</Badge>
Badge Visibility
The badge automatically hides when content
is zero. You can
override this with the showZero
prop.
00
<Badge color="red" content={0}><Icon icon="Notification" /></Badge>
<Badge color="red" content={0} showZero><Icon icon="Notification" /></Badge>