温馨提示:本站仅提供公开网络链接索引服务,不存储、不篡改任何第三方内容,所有内容版权归原作者所有
AI智能索引来源:http://www.mui.com/base-ui/react-badge/hooks-api/
点击访问原文链接

React Badge component and hook - MUI Base

React Badge component and hook - MUI BaseSkip to content🎉 Material UI v7 is out now! Check out the announcement blog post.

MUI Basev5.0.0-beta.70Getting startedComponentsAll componentsInputsAutocompleteButtonCheckboxInputNumber InputRadio GroupRatingSelectSliderSwitchToggle Button GroupData displayBadgeTooltipFeedbackSnackbarSurfacesAccordionNavigationDrawerMenuPaginationTable PaginationTabsUtilsClick-Away ListenerFocus TrapForm ControlModalNo-SSRPopperPopupPortalTextarea AutosizeTransitionsAPIsHow-to guides + Badge

The Badge component generates a small label that is attached to its child element.

FeedbackBundle sizeDemosComponents APIHooks APIuseBadge APIImport
import { useBadge } from '@mui/base/useBadge';
// or
import { useBadge } from '@mui/base';

Learn about the difference by reading this guide on minimizing bundle size.

ParametersView:tableNameTypeDefaultDescriptionbadgeContentReact.ReactNode-

The content rendered within the badge.

invisiblebooleanfalse

If true, the badge is invisible.

maxnumber99

Max count to show.

showZerobooleanfalse

Controls whether the badge is hidden when badgeContent is zero.

Return valueView:tableNameTypeDescriptionbadgeContentReact.ReactNode

Defines the content that's displayed inside the badge.

displayValueReact.ReactNode

Value to be displayed in the badge. If badgeContent is greater than max, it will return max+.

invisibleboolean

If true, the component will not be visible.

maxnumber

Maximum number to be displayed in the badge.


Edit this page

Was this page helpful?

Toggle Button GroupTooltip

Blog

Store

Contents

useBadgeImportParametersbadgeContentinvisiblemaxshowZeroReturn valuebadgeContentdisplayValueinvisiblemaxBecome a Diamond sponsorMUI stands in solidarity with Ukraine.

React Badge component and hook - MUI Base,AI智能索引,全网链接索引,智能导航,网页索引

    The Badge component generates a small label that is attached to its child element.