[BadgeUnstyled] Unstyled API shape discussion #31868
Labels
component: badge
This is the name of the generic UI component, not the React module!
new feature
New feature or request
package: base-ui
Specific to @mui/base
When writing the docs for the unstyled badge, a few improvements to the API came to my mind:
classes
prop can be removed to match other unstyled componentsanchorOrigin
doesn't do anything except set a class name. I propose to remove it and let developers implement positioning props of their choosing.variant="dot"
is not necessarily a dot - it must be styled by the developer. SettingbadgeContent
to an empty string and making the badge smaller would have the same effect. Therefore,variant
could be removed from the unstyled component.max
andshowZero
make sense only whenbadgeContent
is a number. We could have two overloads of the badge function - one that takes a{ badgeContent: number, max?: number, showZero?: boolean }
and the other one with{ badgeContent?: ReactNode }
MuiBadgeUnstyled-
prefixcc @hbjORbj, @mnajdova
The text was updated successfully, but these errors were encountered: