Skip to main content

Tooltip
New

Tooltips are floating labels that briefly explain the function of a user interface element. They can be triggered when user clicks or navigates to it via keyboard.

Please keep in mind that when the screen width is under 768px this component should always be positioned on the right side of the screen as it’s going to open towards left.

Examples

Open in new window
<div style="padding-top:170px;margin:0 auto;max-width:100px;">
<duet-tooltip active>
Hello, I’m a tooltip! To close me you can hit ESC key,
click the close button, or click the info icon again.
</duet-tooltip>
</div>
Open in new window
<div style="margin:260px 0 0 20px;width:100%;min-height:100px;">
<duet-tooltip active label="Click me to open a tooltip">
Hello, I’m a tooltip! To close me you can hit ESC key,
click the close button, or click the info icon again.
</duet-tooltip>
</div>
Open in new window
<div style="margin:40px auto 0;width:60%;min-height:400px;">
<duet-input label="Katuosoite" placeholder="Kadunnimi 1 A 2" tooltip="Hello, I’m a tooltip! To close me, you can click outside of the tooltip, hit ESC key or click the icon again." required expand></duet-input>
</div>

Properties #

Property Attribute Description Type Default
accessibleCloseLabel accessible-close-label Adds accessible label for the close icon that is only shown for screen readers. This property is always required to create an accessibly interface! string "Sulje lisätiedot"
accessibleLabel accessible-label Adds accessible label for the info icon that is only shown for screen readers. This property is always required to create an accessibly interface! string "Näytä lisätietoja"
active active Toggle whether the tooltip is initially visible or not. This property should not be used in production in most cases. boolean false
label label Label of the tooltip. If used, replaces the accessibleLabel option. string ""
positionHorizontal position-horizontal Adjust the horizontal positioning of the tooltip toggle in pixels. Can be a negative value as well. E.g. "-13px". string "0"
positionVertical position-vertical Adjust the vertical positioning of the tooltip toggle in pixels. Can be a negative value as well. E.g. "-13px". string "0"
theme theme Theme of the tooltip. Can be one of: "default", "turva". "" or "default" or "turva" ""

Dependencies #

Used by #

Depends on #

Graph #

graph TD;
duet-tooltip --> duet-visually-hidden
duet-choice-group --> duet-tooltip
duet-input --> duet-tooltip
duet-radio-group --> duet-tooltip
duet-select --> duet-tooltip
duet-textarea --> duet-tooltip
style duet-tooltip fill:#f9f,stroke:#333,stroke-width:4px

Integration

For integration, event and theming guidelines, please see Using Components. This documentation explains how to implement and use Duet’s components across different technologies like Angular, React or Vanilla JavaScript.



Tutorials

Follow these practical tutorials to learn how to build simple page layouts using Duet’s CSS Framework, Web Components and other features:

Tutorials

Building Layouts

Tutorials

Using CLI Tools

Tutorials

Creating Custom Patterns

Tutorials

Server Side Rendering

Tutorials

Sharing Prototypes


Troubleshooting

If you experience any issues while using a component, please head over to the Support page for more guidelines and help.