UNPKG

1.09 kBTypeScriptView Raw
1import * as React from 'react';
2import type { PresetColorType, PresetStatusColorType } from '../_util/colors';
3import type { LiteralUnion } from '../_util/type';
4import CheckableTag from './CheckableTag';
5export type { CheckableTagProps } from './CheckableTag';
6export interface TagProps extends React.HTMLAttributes<HTMLSpanElement> {
7 prefixCls?: string;
8 className?: string;
9 rootClassName?: string;
10 color?: LiteralUnion<PresetColorType | PresetStatusColorType>;
11 closable?: boolean | ({
12 closeIcon?: React.ReactNode;
13 } & React.AriaAttributes);
14 /** Advised to use closeIcon instead. */
15 closeIcon?: React.ReactNode;
16 /** @deprecated `visible` will be removed in next major version. */
17 visible?: boolean;
18 onClose?: (e: React.MouseEvent<HTMLElement>) => void;
19 style?: React.CSSProperties;
20 icon?: React.ReactNode;
21 bordered?: boolean;
22}
23export interface TagType extends React.ForwardRefExoticComponent<TagProps & React.RefAttributes<HTMLElement>> {
24 CheckableTag: typeof CheckableTag;
25}
26declare const Tag: TagType;
27export default Tag;