Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion packages/core/src/components/icon/icon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ export interface IIconProps extends IIntentProps, IProps {
*/
color?: string;

/**
* String for the `title` attribute on the rendered element, which will appear
* on hover as a native browser tooltip.
*/
htmlTitle?: string;

/**
* Name of a Blueprint UI icon, or an icon element, to render. This prop is
* required because it determines the content of the component, but it can
Expand Down Expand Up @@ -84,6 +90,7 @@ export class Icon extends React.PureComponent<IIconProps & React.DOMAttributes<H
const {
className,
color,
htmlTitle,
iconSize = Icon.SIZE_STANDARD,
intent,
title = icon,
Expand All @@ -100,7 +107,7 @@ export class Icon extends React.PureComponent<IIconProps & React.DOMAttributes<H
const viewBox = `0 0 ${pixelGridSize} ${pixelGridSize}`;

return (
<TagName {...htmlprops} className={classes}>
<TagName {...htmlprops} className={classes} title={htmlTitle}>
<svg fill={color} data-icon={icon} width={iconSize} height={iconSize} viewBox={viewBox}>
{title && <desc>{title}</desc>}
{paths}
Expand Down