Tooltips are used to expose additional information not readily available in the UI. You can use them to explain what a UI element is, explain the purpose of an action, or provide a definition of a word or phrase.
Usage
import { Tooltip } from 'nr1'
Examples
Basic
<Tooltip text="Search across all your accounts"> <Button>Search</Button></Tooltip>
With placementType
<Tooltip text="Explore your metrics, events and logs" placementType={Tooltip.PLACEMENT_TYPE.BOTTOM}> <Button>Query your data</Button></Tooltip>
With additional info link
function render() { const additionalInfoLink = { label: 'See the docs', to: 'https://docs.newrelic.com', };
return ( <p> Welcome to <Tooltip text="Go to docs for more information" placementType={Tooltip.PLACEMENT_TYPE.BOTTOM} additionalInfoLink={additionalInfoLink} > New Relic One </Tooltip> </p> );}
Props
shape | The information shown in the text can be complemented/extended with a link to documentation. This link should only be used to provide contextual information. shape
REQUIREDstring
functionCallback fired any time the user clicks on the button. function (
shape|stringLocation object or url string to link to. shapepathname REQUIREDstring
string
string |
REQUIREDnode | Element to attach the tooltip to, hovering or focusing on this element will show the tooltip.We recommend passing a focusable element so screen readers can announce the tooltip content. |
enum | Tooltips appear next to the element, action, word, or phrase they are explaining. Default display is from the top, but you can also choose to display it from the right, bottom, or left. <One of |
string | Adds a Note: You might not see |
REQUIREDstring | Tooltips should answer a question for the user. Tips should be crisp, clear, and helpful. Provide just enough information to answer questions without overloading the user.
|