UNPKG

1.3 kBTypeScriptView Raw
1import * as React from 'react';
2import type { PresetStatusColorType } from '../_util/colors';
3import type { LiteralUnion } from '../_util/type';
4import type { PresetColorKey } from '../theme/internal';
5import Ribbon from './Ribbon';
6export type { ScrollNumberProps } from './ScrollNumber';
7type CompoundedComponent = React.ForwardRefExoticComponent<BadgeProps & React.RefAttributes<HTMLSpanElement>> & {
8 Ribbon: typeof Ribbon;
9};
10export interface BadgeProps {
11 /** Number to show in badge */
12 count?: React.ReactNode;
13 showZero?: boolean;
14 /** Max count to show */
15 overflowCount?: number;
16 /** Whether to show red dot without number */
17 dot?: boolean;
18 style?: React.CSSProperties;
19 prefixCls?: string;
20 scrollNumberPrefixCls?: string;
21 className?: string;
22 rootClassName?: string;
23 status?: PresetStatusColorType;
24 color?: LiteralUnion<PresetColorKey>;
25 text?: React.ReactNode;
26 size?: 'default' | 'small';
27 offset?: [number | string, number | string];
28 title?: string;
29 children?: React.ReactNode;
30 classNames?: {
31 root?: string;
32 indicator?: string;
33 };
34 styles?: {
35 root?: React.CSSProperties;
36 indicator?: React.CSSProperties;
37 };
38}
39declare const Badge: CompoundedComponent;
40export default Badge;