UNPKG

2.4 kBTypeScriptView Raw
1import * as React from "react";
2import { IconName } from "@blueprintjs/icons";
3import { IntentProps, MaybeElement, Props } from "../../common";
4export interface TagProps extends Props, IntentProps, React.RefAttributes<HTMLSpanElement>, React.HTMLAttributes<HTMLSpanElement> {
5 /**
6 * Whether the tag should appear in an active state.
7 *
8 * @default false
9 */
10 active?: boolean;
11 children?: React.ReactNode;
12 /**
13 * Whether the tag should take up the full width of its container.
14 *
15 * @default false
16 */
17 fill?: boolean;
18 /** Name of a Blueprint UI icon (or an icon element) to render before the children. */
19 icon?: IconName | MaybeElement;
20 /**
21 * Whether the tag should visually respond to user interactions. If set
22 * to `true`, hovering over the tag will change its color and mouse cursor.
23 *
24 * Recommended when `onClick` is also defined.
25 *
26 * @default false
27 */
28 interactive?: boolean;
29 /**
30 * Whether this tag should use large styles.
31 *
32 * @default false
33 */
34 large?: boolean;
35 /**
36 * Whether this tag should use minimal styles.
37 *
38 * @default false
39 */
40 minimal?: boolean;
41 /**
42 * Whether tag content should be allowed to occupy multiple lines.
43 * If false, a single line of text will be truncated with an ellipsis if
44 * it overflows. Note that icons will be vertically centered relative to
45 * multiline text.
46 *
47 * @default false
48 */
49 multiline?: boolean;
50 /**
51 * Callback invoked when the tag is clicked.
52 * Recommended when `interactive` is `true`.
53 */
54 onClick?: (e: React.MouseEvent<HTMLDivElement>) => void;
55 /**
56 * Click handler for remove button.
57 * The remove button will only be rendered if this prop is defined.
58 */
59 onRemove?: (e: React.MouseEvent<HTMLButtonElement>, tagProps: TagProps) => void;
60 /** Name of a Blueprint UI icon (or an icon element) to render after the children. */
61 rightIcon?: IconName | MaybeElement;
62 /**
63 * Whether this tag should have rounded ends.
64 *
65 * @default false
66 */
67 round?: boolean;
68 /**
69 * HTML title to be passed to the <Text> component
70 */
71 htmlTitle?: string;
72}
73/**
74 * Tag component.
75 *
76 * @see https://blueprintjs.com/docs/#core/components/tag
77 */
78export declare const Tag: React.FC<TagProps>;