logoAnt Design

⌘ K
  • 디자인
  • 개발
  • 컴포넌트
  • 블로그
  • 자료
5.21.3
  • Components Overview
  • General
    • Button
    • FloatButton
      5.0.0
    • Icon
    • Typography
  • Layout
    • Divider
    • Flex
      5.10.0
    • Grid
    • Layout
    • Space
    • Splitter
      5.21.0
  • Navigation
    • Anchor
    • Breadcrumb
    • Dropdown
    • Menu
    • Pagination
    • Steps
  • Data Entry
    • AutoComplete
    • Cascader
    • Checkbox
    • ColorPicker
      5.5.0
    • 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
    • QRCode
      5.1.0
    • Segmented
    • Statistic
    • Table
    • Tabs
    • Tag
    • Timeline
    • Tooltip
    • Tour
      5.0.0
    • Tree
  • Feedback
    • Alert
    • Drawer
    • Message
    • Modal
    • Notification
    • Popconfirm
    • Progress
    • Result
    • Skeleton
    • Spin
    • Watermark
      5.1.0
  • Other
    • Affix
    • App
      5.1.0
    • ConfigProvider
    • Util
      5.13.0

Badge

UI 요소에 대한 작은 숫자 값 또는 상태 설명자입니다.
가져오기import{ Badge }from"antd";
소스components/badge
문서
이 페이지 수정변경 로그

Resources

Ant Design Charts
Ant Design Pro
Ant Design Pro Components
Ant Design Mobile
Ant Design Mini
Ant 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 Ant Design
Medium
Twitter
yuque logoAnt Design in YuQue
Ant Design in Zhihu
Experience Cloud Blog
seeconf logoSEE Conf-Experience Tech Conference
Work with Us

Help

GitHub
Change Log
FAQ
Bug Report
Issues
Discussions
StackOverflow
SegmentFault

Ant XTech logoMore Products

yuque logoYuQue-Document Collaboration Platform
AntV logoAntV-Data Visualization
Egg logoEgg-Enterprise Node.js Framework
Kitchen logoKitchen-Sketch Toolkit
Galacean logoGalacean-Interactive Graphics Solution
xtech logoAnt Financial Experience Tech
Theme Editor
Made with ❤ by
Ant Group and Ant Design Community
loading

When To Use

배지는 일반적으로 알림 또는 프로필 사진에 근접하여 눈길을 끌도록 표시되며, 보통 읽지 않은 메시지 수가 표시됩니다.

Examples

API

Common props ref:Common props

Badge

프로퍼티설명타입기본값버전
color배지 도트 색상의 사용자 지정string-
count배지에 표시할 숫자, overflowCount보다 큰 경우 ${overflowCount}+로 표시되고, 0일 경우 숨김ReactNode-
classNames시맨틱 DOM 클래스Record<SemanticDOM, string>-5.7.0
dotcount 대신 빨간 색 도트를 표시 여부booleanfalse
offset배지 도트의 오프셋 설정[number, number]-
overflowCount표시할 최대 개수number99
showZerocount가 0일 때 배지를 표시할지에 대한 여부booleanfalse
sizecount가 설정되어 있다면, size는 배지의 크기를 설정default | small--
status배지를 상태 표시 도트로 설정success | processing | default | error | warning-
styles시멘틱 DOM 스타일Record<SemanticDOM, CSSProperties>-5.7.0
textstatus가 설정되어 있다면, text는 dot 상태 표시 내용을 설정ReactNode-
title배지 위에 커서가 올라갔을 때 표시할 내용string-

Badge.Ribbon

프로퍼티설명타입기본값버전
color리본 색상의 사용자 지정string-
placement리본의 배치, start 와 end를 통한 텍스트 방향 설정 (RTL 혹은 LTR)start | endend
text리본 내의 콘텐츠ReactNode-

Semantic DOM

Design Token

컴포넌트 토큰어떻게 사용하나요?

토큰 이름설명타입기본값
dotSize도트 배지의 크기number6
indicatorHeight배지의 높이string | number20
indicatorHeightSM작은 배지의 높이string | number14
indicatorZIndex배지의 z-indexstring | numberauto
statusSize상태 배지의 크기number6
textFontSize배지 텍스트의 글씨 크기number12
textFontSizeSM작은 배지 텍스트의 글씨 크기number12
textFontWeight배지 텍스트의 글씨 굵기string | numbernormal

글로벌 토큰어떻게 사용하나요?

Basic

기본적인 사용. 배지는 count가 0일 때 숨겨지지만, showZero 를 통해 표시할 수 있습니다.

codepen icon
External Link Icon
expand codeexpand code
Overflow Count

overflowCount보다 카운트가 클 경우 ${overflowCount}+가 표시됩니다. 기본 overflowCount값은 99입니다.

codepen icon
External Link Icon
expand codeexpand code
Dynamic

카운트가 변경되면 애니메이션이 적용됩니다.

codepen icon
External Link Icon
expand codeexpand code
Offset

배지 도트의 오프셋을 설정합니다. 기본 위치의 왼쪽과 위쪽에서 상태 도트의 오프셋을 나타내는 [left, top]형식입니다.

codepen icon
External Link Icon
expand codeexpand code
Status

상태가 포함된 독립형 배지.

codepen icon
External Link Icon
expand codeexpand code
Ribbon

리본 배지를 사용합니다.

codepen icon
External Link Icon
expand codeexpand code
Mixed usage

사용자 지정 status/color와 함께 count/dot 사용.

codepen icon
External Link Icon
expand codeexpand code
Colorful Badge support count Debug

Colorful badge 사용 시 count를 지원합니다.

codepen icon
External Link Icon
expand codeexpand code
Standalone

어떠한 요소도 감싸지 않고 독립적으로 사용되며 맞춤형 연출이 가능합니다.

오른쪽 상단의 배지는 빨간색으로 한정되어 있습니다.

codepen icon
External Link Icon
expand codeexpand code
Red badge

특정 카운트 없이 빨간색 배지만 표시됩니다. 카운트가 0이면 점이 표시되지 않습니다.

codepen icon
External Link Icon
expand codeexpand code
Clickable

배지를 통해 링크될 수 있도록 a태그로 감쌀 수 있습니다.

codepen icon
External Link Icon
expand codeexpand code
Size

숫자 배지의 크기를 설정합니다.

codepen icon
External Link Icon
expand codeexpand code
Colorful Badge

다양한 상황에서 사용할 수 있는 다양한 색상의 배지 스타일이 설정되어 있습니다. 사용자 지정 색상을 위해 헥스 색상 문자열로 설정할 수도 있습니다.

codepen icon
External Link Icon
expand codeexpand code
Ribbon Debug

Buggy!

codepen icon
External Link Icon
expand codeexpand code
Title

커서가 올라갔을 때 배지가 count 대신 title를 표시합니다.

codepen icon
External Link Icon
expand codeexpand code
Component Token

Component Token 디버그

codepen icon
External Link Icon
expand codeexpand code
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
5
5
5
5
0
0
0
0
0
pink
44
red
44
yellow
44
orange
44
cyan
44
green
44
blue
44
purple
44
geekblue
44
magenta
44
volcano
44
gold
44
lime
44
loading
loading
loading
loading
loading
loading
loading
loading
loading
loading
loading
loading
loading
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%)
推开窗户举起望远镜
啦啦啦啦
推开窗户举起望远镜
啦啦啦啦
推开窗户举起望远镜
啦啦啦啦
推开窗户举起望远镜
啦啦啦啦
推开窗户举起望远镜
啦啦啦啦
5
-5
5
26
Success
0
5
  • root
    5.7.0
    루트 요소
  • indicator
    5.7.0
    지시 요소