UNPKG

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