With styled component trigger
With class component trigger
Custom React Component
With an SVG element trigger
With element title and native html element
so strong
}
{...args}
>
With overflowing text
Activate showOnlyOnOverflow and drag the right side to make this text
overflow. Tooltip will appear on hover when text overflows.
With custom component with text
This text is in a custom react component. Activate showOnlyOnOverflow and
drag the right side to make this text overflow.
);
};
_Tooltip.args = {
title: 'Basic tooltip content',
disabled: false,
/** Container display mode */
displayMode: undefined,
position: 'top',
isHoverable: false,
showOnlyOnOverflow: false,
};
_Tooltip.argTypes = {
displayMode: {
control: {
type: 'select',
options: ['block', 'inline-block', 'inline'],
},
},
position: {
control: {
type: 'select',
options: [
'bottom',
'top',
'left',
'right',
'bottom-start',
'bottom-end',
'top-start',
'top-end',
'left-start',
'left-end',
'right-start',
'right-end',
'auto',
],
},
},
};
_Tooltip.parameters = {
docs: {
description: {
story: 'Adds a tooltip to any component',
},
},
};