npm explorer

@invisionag/iris-react-tooltip

v6.7.2TypeScript

```js Tooltip from '@invisionag/iris-react-tooltip'; ```

0/weekUpdated 2 months agoMITUnpacked: 46.7 KB
Published by fruetel
npm install @invisionag/iris-react-tooltip
RepositoryHomepagenpm

``js
Tooltip from '@invisionag/iris-react-tooltip';
`

Tooltip

Tooltip Component for displaying context specific information.

Props

$3


Expects an object containing an
x and a y key with string values. Offset gets applied to the tooltip as positioning relative to its anchor from the bottom left.

Example:
`js

renderAsAnchor={() => Click me!}
renderTooltipContent={() =>

I am the Tooltip!
}
tooltipOffset={{x: '0', y: '-10px'}}
/>

`

as Anchor

$3

Usage:

`js

renderAsAnchor={() => Click me!}
renderTooltipContent={() =>

I am the Tooltip!
}
/>

`

$3

Usage:

`js

clickable
renderAsAnchor={() => Click me!}
renderTooltipContent={() =>

I am the Tooltip!
}
/>

`

You can pass a width prop to the tooltip, which will determine the width the tooltip will expand to before linebreaking:

`js
clickable
width="100px"
renderAsAnchor={() => Click me!}
renderTooltipContent={() =>

I am the Tooltip!
}
/>
`

with Ref

The Tooltip which is controlled with a react reference can be assigned additional props because it expects to be confirmed.

Usage:

`js
renderWithRef={({ setPositionByRef }) =>

Click me!}
renderTooltipContent={() =>
I am the Tooltip!
}
renderConfirm={() => 'Confirm'}
onClose={closeHandlerFunction}
/>
`

You can pass a width prop to the tooltip, which will determine the width the tooltip will expand to before linebreaking:

`js
width="100px"
renderWithRef={({ setPositionByRef }) =>

Click me!}
renderTooltipContent={() =>
I am the Tooltip!
}
renderConfirm={() => 'Confirm'}
onClose={closeHandlerFunction}
/>
``

Dist Tags

next6.4.3-alpha.4542
grid6.4.17-alpha.8
maintenance-2019-06-286.4.17-alpha.11
maintenance6.4.17-alpha.13
latest6.7.2
@invisionag/iris-react-tooltip - npm explorer