Open
Description
Summary
Would like to be able to use the badge
slot on the badge component, so that I can wrap it with a ButtonBase
and make it interactive. The badge exposes a slot for the "badge" component, but no way to reuse the default component.
Exporting the default component could potentially make sense for any slot that is offered.
Examples
import Badge, { BadgeSlot } from '@mui/material/badge'
import ButtonBase from '@mui/material/ButtonBase'
function MyBadge() {
return <ButtonBase onClick={() => alert('hello word!')}><BadgeSlot {...props} /></ButtonBase>
}
<Badge
badgeContent="click me"
slots={{
badge: MyBadge
}}
>
...
</Badge>
Motivation
No response
Search keywords: badge slot