logoNamu Design

⌘ K
  • Design
  • Development
  • Components
  • Blog
  • Resources
1.0.0
  • Components Overview
  • General
    • Button
    • FloatButtonNew
    • Icon
    • Typography
  • Layout
    • Divider
    • Grid
    • Layout
    • Space
  • Navigation
    • Anchor
    • Breadcrumb
    • Dropdown
    • Menu
    • Pagination
    • Steps
  • Data Entry
    • AutoComplete
    • Cascader
    • Checkbox
    • ColorPickerNew
    • DatePicker
    • Form
    • Input
    • InputNumber
    • Mentions
    • Radio
    • Rate
    • Select
    • Slider
    • Switch
    • TimePicker
    • Transfer
    • TreeSelect
    • Upload
  • Data Display
    • Avatar
    • Badge
    • Calendar
    • Card
    • Carousel
    • Collapse
    • Descriptions
    • Empty
    • Image
    • List
    • Popover
    • QRCodeNew
    • Segmented
    • Statistic
    • Table
    • Tabs
    • Tag
    • Timeline
    • Tooltip
    • TourNew
    • Tree
  • Feedback
    • Alert
    • Drawer
    • Message
    • Modal
    • Notification
    • Popconfirm
    • Progress
    • Result
    • Skeleton
    • Spin
    • Watermark
  • Other
    • Affix
    • AppNew
    • ConfigProvider
When To Use
Examples
Basic
Standalone
Overflow Count
Red badge
Dynamic
Clickable
Offset
Size
Status
Colorful Badge
Ribbon
API
Badge
Badge.Ribbon (4.5.0+)
styles and classNames attribute
Design Token

Badge

  • AvatarCalendar

    Resources

    Namu Design Charts
    Namu Design Pro
    Namu Design Pro Components
    Namu Design Mobile
    Namu Design Mini
    Namu Design Landing-Landing Templates
    Scaffolds-Scaffold Market
    Umi-React Application Framework
    dumi-Component doc generator
    qiankun-Micro-Frontends Framework
    ahooks-React Hooks Library
    Ant Motion-Motion Solution
    China Mirror 🇨🇳

    Community

    Awesome Namu Design
    Medium
    Twitter
    yuqueNamu Design in YuQue
    Namu Design in Zhihu
    Experience Cloud Blog
    seeconfSEE Conf-Experience Tech Conference

    Help

    GitHub
    Change Log
    FAQ
    Bug Report
    Issues
    Discussions
    StackOverflow
    SegmentFault

    Ant XTechMore Products

    yuqueYuQue-Document Collaboration Platform
    AntVAntV-Data Visualization
    EggEgg-Enterprise Node.js Framework
    kitchenKitchen-Sketch Toolkit
    xtechAnt Financial Experience Tech
    Theme Editor
    Made with ❤ by
    Ant Group and Namu Design Community

    Small numerical value or status descriptor for UI elements.

    When To Use

    Badge normally appears in proximity to notifications or user avatars with eye-catching appeal, typically displaying unread messages count.

    Examples

    Basic

    Simplest Usage. Badge will be hidden when count is 0, but we can use showZero to show it.

    expand codeexpand code
    Overflow Count

    ${overflowCount}+ is displayed when count is larger than overflowCount. The default value of overflowCount is 99.

    expand codeexpand code
    Dynamic

    The count will be animated as it changes.

    expand codeexpand code
    Offset

    Set offset of the badge dot, the format is [left, top], which represents the offset of the status dot from the left and top of the default position.

    expand codeexpand code
    Status

    Standalone badge with status.

    expand codeexpand code
    Ribbon

    Use ribbon badge.

    expand codeexpand code
    Standalone

    Used in standalone when children is empty.

    expand codeexpand code
    Red badge

    This will simply display a red badge, without a specific count. If count equals 0, it won't display the dot.

    expand codeexpand code
    Clickable

    The badge can be wrapped with a tag to make it linkable.

    expand codeexpand code
    Size

    Set size of numeral Badge.

    expand codeexpand code
    Colorful Badge

    We preset a series of colorful Badge styles for use in different situations. You can also set it to a hex color string for custom color.

    expand codeexpand code

    API

    Common props ref:Common props

    Badge

    PropertyDescriptionTypeDefaultVersion
    colorCustomize Badge dot colorstring-
    countNumber to show in badgeReactNode-
    classNamesSemantic DOM classRecord<SemanticDOM, string>-5.7.0
    dotWhether to display a red dot instead of countbooleanfalse
    offsetSet offset of the badge dot[number, number]-
    overflowCountMax count to shownumber99
    showZeroWhether to show badge when count is zerobooleanfalse
    sizeIf count is set, size sets the size of badgedefault | small-4.6.0
    statusSet Badge as a status dotsuccess | processing | default | error | warning-
    stylesSemantic DOM styleRecord<SemanticDOM, CSSProperties>-5.7.0
    textIf status is set, text sets the display text of the status dotReactNode-
    titleText to show when hovering over the badgestring-

    Badge.Ribbon (4.5.0+)

    PropertyDescriptionTypeDefaultVersion
    colorCustomize Ribbon colorstring-
    placementThe placement of the Ribbon, start and end follow text direction (RTL or LTR)start | endend
    textContent inside the RibbonReactNode-

    styles and classNames attribute

    PropertyDescriptionVersion
    rootset root element5.7.0
    indicatorset badge element5.7.0

    Design Token

    Global Token

    5
    0
    99
    99+
    10+
    999+
    5
    5

    Success
    Error
    Default
    Processing
    Warning
    Pushes open the window
    and raises the spyglass.
    Hippies
    Pushes open the window
    and raises the spyglass.
    Hippies
    Pushes open the window
    and raises the spyglass.
    Hippies
    Pushes open the window
    and raises the spyglass.
    Hippies
    Pushes open the window
    and raises the spyglass.
    Hippies
    Pushes open the window
    and raises the spyglass.
    Hippies
    Pushes open the window
    and raises the spyglass.
    Hippies
    Pushes open the window
    and raises the spyglass.
    Hippies
    11
    25
    99+
    Link something
    5
    5
    5
    Presets
    pink
    red
    yellow
    orange
    cyan
    green
    blue
    purple
    geekblue
    magenta
    volcano
    gold
    lime
    Custom
    #f50
    rgb(45, 183, 245)
    hsl(102, 53%, 61%)
    hwb(205 6% 9%)