Badge
A small count on the corner of an icon, like unread mail.
Add it to your project
Or install the packages yourselfTerminal
npm install @mui/icons-material @mui/material
First time with Material UI? Set it up once.
The code
'use client';
import IconButton from '@mui/material/IconButton';
import Badge from '@mui/material/Badge';
import MailIcon from '@mui/icons-material/Mail';
const maxVisibleNotifications = 99;
const unreadNotificationsCount = 100;
function getUnreadNotificationsLabel(count: number) {
if (count === 0) {
return 'show no unread notifications';
}This comes with paid plans
The code for every component comes with paid plans, along with the rest of the AI toolkit. The first component under each heading is free.