UNPKG

979 BTypeScriptView Raw
1/// <reference types="react" />
2export interface UseBadgeParameters {
3 /**
4 * The content rendered within the badge.
5 */
6 badgeContent?: React.ReactNode;
7 /**
8 * If `true`, the badge is invisible.
9 * @default false
10 */
11 invisible?: boolean;
12 /**
13 * Max count to show.
14 * @default 99
15 */
16 max?: number;
17 /**
18 * Controls whether the badge is hidden when `badgeContent` is zero.
19 * @default false
20 */
21 showZero?: boolean;
22}
23export interface UseBadgeReturnValue {
24 /**
25 * Defines the content that's displayed inside the badge.
26 */
27 badgeContent: React.ReactNode;
28 /**
29 * If `true`, the component will not be visible.
30 */
31 invisible: boolean;
32 /**
33 * Maximum number to be displayed in the badge.
34 */
35 max: number;
36 /**
37 * Value to be displayed in the badge. If `badgeContent` is greater than `max`, it will return `max+`.
38 */
39 displayValue: React.ReactNode;
40}