Tooltip
Tooltips should be used to provide quickly understandable information to the users in a non-distracting way. Make sure that the tooltips you add are specific and help the user accomplish their goals faster and with more confidence.
| Last update: | () |
| Message | fix(stylelint): deprecated rules, fix empty lines |
| Committer: | gydavid |
| Version history | |
Default
Copy Jade
Copy HTML
Show code
Hide code
e-tooltip
In tempor exercitation ut
<e-tooltip content="This is the tooltip of the text <strong>qweqweqweqwe</strong>">
<b>
tooltip
</b>
</e-tooltip>
Ut in occaecat excepteur
<e-tooltip content="This is the tooltip of the text <strong>qweqweqweqwe</strong>"><b>tooltip</b></e-tooltip>
Directions
Top (default)
Copy Jade
Copy HTML
Show code
Hide code
placement="top"
Velit laborum tempor ut
<e-tooltip content="tooltip content" placement="top">
<b>
tooltip
</b>
</e-tooltip>
Officia cupidatat sunt ut
<e-tooltip content="tooltip content" placement="top"><b>tooltip</b></e-tooltip>
Bottom
Copy Jade
Copy HTML
Show code
Hide code
placement="bottom"
Ea cillum dolore officia
<e-tooltip content="tooltip content" placement="bottom">
<b>
tooltip
</b>
</e-tooltip>
Qui proident elit non
<e-tooltip content="tooltip content" placement="bottom"><b>tooltip</b></e-tooltip>
Left
Copy Jade
Copy HTML
Show code
Hide code
placement="left"
Minim fugiat duis qui
<e-tooltip content="tooltip content" placement="left">
<b>
tooltip
</b>
</e-tooltip>
Id in voluptate in
<e-tooltip content="tooltip content" placement="left"><b>tooltip</b></e-tooltip>
Right
Copy Jade
Copy HTML
Show code
Hide code
placement="right"
Adipiscing ea esse dolor
<e-tooltip content="tooltip content" placement="right">
<b>
tooltip
</b>
</e-tooltip>
Excepteur duis voluptate ad
<e-tooltip content="tooltip content" placement="right"><b>tooltip</b></e-tooltip>
Advanced Directions
Top-Start
Copy Jade
Copy HTML
Show code
Hide code
placement="top-start"
Consectetur ut dolore deserunt
<e-tooltip content="tooltip content" placement="top-start">
<b>
tooltip
</b>
</e-tooltip>
Deserunt occaecat amet tempor
<e-tooltip content="tooltip content" placement="top-start"><b>tooltip</b></e-tooltip>
Top-End
Copy Jade
Copy HTML
Show code
Hide code
placement="top-end"
Nostrud lorem dolor labore
<e-tooltip content="tooltip content" placement="top-end">
<b>
tooltip
</b>
</e-tooltip>
Sed sed quis magna
<e-tooltip content="tooltip content" placement="top-end"><b>tooltip</b></e-tooltip>
Bottom-Start
Copy Jade
Copy HTML
Show code
Hide code
placement="bottom-start"
Sunt nisi duis velit
<e-tooltip content="tooltip content" placement="bottom-start">
<b>
tooltip
</b>
</e-tooltip>
Et magna ut cupidatat
<e-tooltip content="tooltip content" placement="bottom-start"><b>tooltip</b></e-tooltip>
Bottom-End
Copy Jade
Copy HTML
Show code
Hide code
placement="bottom-end"
Sint ullamco veniam magna
<e-tooltip content="tooltip content" placement="bottom-end">
<b>
tooltip
</b>
</e-tooltip>
Eiusmod est ad fugiat
<e-tooltip content="tooltip content" placement="bottom-end"><b>tooltip</b></e-tooltip>
Left-Start
Copy Jade
Copy HTML
Show code
Hide code
placement="left-start"
Enim aliquip dolor ad
<e-tooltip content="tooltip content" placement="left-start">
<b>
tooltip
</b>
</e-tooltip>
Aliqua qui officia eiusmod
<e-tooltip content="tooltip content" placement="left-start"><b>tooltip</b></e-tooltip>
Left-End
Copy Jade
Copy HTML
Show code
Hide code
placement="left-end"
Occaecat culpa nisi exercitation
<e-tooltip content="tooltip content" placement="left-end">
<b>
tooltip
</b>
</e-tooltip>
Adipiscing nisi velit officia
<e-tooltip content="tooltip content" placement="left-end"><b>tooltip</b></e-tooltip>
Right-Start
Copy Jade
Copy HTML
Show code
Hide code
placement="right-start"
Pariatur consequat amet labore
<e-tooltip content="tooltip content" placement="right-start">
<b>
tooltip
</b>
</e-tooltip>
Velit ipsum cillum elit
<e-tooltip content="tooltip content" placement="right-start"><b>tooltip</b></e-tooltip>
Right-End
Copy Jade
Copy HTML
Show code
Hide code
placement="right-end"
Velit occaecat veniam incididunt
<e-tooltip content="tooltip content" placement="right-end">
<b>
tooltip
</b>
</e-tooltip>
Ex dolor sunt aute
<e-tooltip content="tooltip content" placement="right-end"><b>tooltip</b></e-tooltip>
Variations
Fix width
Copy Jade
Copy HTML
Show code
Hide code
width="200"
Id culpa culpa cupidatat
<e-tooltip content="long tooltip content with <strong>html</strong>, long tooltip content with <strong>html</strong>" width="200">
<b>
tooltip
</b>
</e-tooltip>
Deserunt proident exercitation mollit
<e-tooltip content="long tooltip content with <strong>html</strong>, long tooltip content with <strong>html</strong>" width="200"><b>tooltip</b></e-tooltip>
Block instead of inline
Copy Jade
Copy HTML
Show code
Hide code
[block]
<e-tooltip content="tooltip content" block>
<input placeholder="Placeholder" class="e-input">
</e-tooltip>
<e-tooltip content="tooltip content" block>
<input placeholder="Placeholder" class="e-input">
</e-tooltip>
Helper tooltip
Copy Jade
Copy HTML
Show code
Hide code
type="helper"
Eu sunt ut voluptate
<e-tooltip content="tooltip content" type="helper"></e-tooltip>
Et in reprehenderit in
<e-tooltip content="tooltip content" type="helper"></e-tooltip>
Hoverable tooltip
Copy Jade
Copy HTML
Show code
Hide code
has-action
In culpa esse eiusmod
<e-tooltip content="tooltip content" type="helper" has-action></e-tooltip>
Reprehenderit dolor nulla sunt
<e-tooltip content="tooltip content" type="helper" has-action></e-tooltip>
Inverse tooltip
Copy Jade
Copy HTML
Show code
Hide code
inverse
Ad id ut ullamco
<e-tooltip content="tooltip content" type="helper" inverse></e-tooltip>
Magna et consequat sit
<e-tooltip content="tooltip content" type="helper" inverse></e-tooltip>
Disabled tooltip
Copy Jade
Copy HTML
Show code
Hide code
disabled
Veniam velit aute nostrud
<e-tooltip content="tooltip content" type="helper" disabled></e-tooltip>
Culpa laborum dolore velit
<e-tooltip content="tooltip content" type="helper" disabled></e-tooltip>
Table row tooltip
Copy Jade
Copy HTML
Show code
Hide code
is="e-tooltip-tr"
<div class="e-row">
<div class="e-col-3">
</div>
<div class="e-col-5">
<table class="e-table">
<thead>
<tr>
<th>
Veniam aliquip
</th>
<th>
Commodo reprehenderit
</th>
</tr>
</thead>
<tbody>
<tr is="e-tooltip-tr" content="tooltip content" placement="left">
<td>
Magna fugiat ut magna aute
</td>
<td>
Adipiscing id exercitation nisi aliqua
</td>
</tr>
<tr is="e-tooltip-tr" content="tooltip content" placement="right">
<td>
Occaecat adipiscing cillum veniam anim
</td>
<td>
Ut aute proident aliquip mollit
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="e-row">
<div class="e-col-3"> </div>
<div class="e-col-5">
<table class="e-table">
<thead>
<tr>
<th>Proident do
</th>
<th>Labore officia
</th>
</tr>
</thead>
<tbody>
<tr is="e-tooltip-tr" content="tooltip content" placement="left">
<td>Labore ad non tempor est
</td>
<td>Sed consectetur est aliquip aute
</td>
</tr>
<tr is="e-tooltip-tr" content="tooltip content" placement="right">
<td>Et duis labore mollit velit
</td>
<td>Sed eiusmod id amet ut
</td>
</tr>
</tbody>
</table>
</div>
</div>
| Anim eu | Duis exercitation |
|---|---|
| Excepteur tempor sunt excepteur ut | Elit magna ut tempor minim |
| Proident dolor officia ea dolore | Dolor esse dolor ullamco sit |
API Reference
Properties
| Name | Description | Type | Required | Default value |
|---|---|---|---|---|
| content | The text of the tooltip, it can be HTML content too. | string |
|
- |
| placement | Position of the tooltip relative to the trigger element. | string | top | |
| width | Set this to an integer value (px) to get fix width. | integer | - | |
| type | Right now the only type is "helper" which creates a simple box with a question mark. | string | - | |
| has-action | If you want put link in the content, use this attribute | boolean | false | |
| disabled | If you want temporally disable the tooltip, use this attribute | boolean | false | |
| inverse | If you want show the tooltip with dark background color, use this attribute | boolean | false |
| Parameter | Value |
|---|---|
| placement | top | bottom | left | right | top-start | top-end | bottom-start | bottom-end | left-start | left-end | right-start | right-end |
| type | helper |
| attribute | has-action | disabled | inverse |
Related components
Old tooltip (deprecated)Tooltip guidelines
- Every element without labels should have a tooltip telling the name of that element. Users should never have to guess what an element means. This includes icons, images, numbers, charts.
- There should be only a minimum number of "?" tooltips on the UI, and there should be a strong reason for every added one. Instructions and general feature information should go the documentation. Instead of adding a tooltip improve the microcopy or the design.
- "?" tooltips should be always attached to a specific label or element. Free standing "?" are bound to be general and won't help users in their specific task.
- When creating tooltips, limit the length to about 2 sentences (100-150 characters). This makes it easier for the users to quickly understand what is important, and doesn't force them to interrupt their task by reading long chunks of text. Long tooltips may also cover important UI elements. Add further information to the documentation and provide a link.
- Make the length shorter by not mentioning the technical name of the UI element, eg. use “Email clients” instead of “Email client list”.
- Make it shorter by not repeating that is obvious because of the context of the tooltip. Eg. use “Previous” instead of “Previous email client”
- But also make it not general (eg. "Edit email" instead "Edit").
- Use the user’s terms instead of technical terms. Eg. instead of “Email client screen” use “Email preview”