• Settings
    • Locale
    • Change the locale of the datepicker, schedule and client side validation messages.

      Language
      English
      English
      English
      French
      German
      German
      German
      Italian
      Korean
      Spanish
      Catalan
      Dutch
      Portuguese
      Portuguese
      Arabic
      Arabic
      Bulgarian
      Bangla
      Bosnian
      Czech
      Greek
      Estonian
      Persian
      Finnish
      Danish
      Hindi
      Indonesian
      Icelandic
      Croatian
      Japanese
      Hungarian
      Hebrew
      Georgian
      Central Kurdish
      Khmer
      Kyrgyz
      Kazakh
      Lithuanian
      Latvian
      Malay
      Norwegian
      Polish
      Romanian
      Russian
      Slovak
      Slovenian
      Serbian
      Serbian
      Swedish
      Thai
      Turkish
      Ukrainian
      Uzbek
      Vietnamese
      Chinese
      Chinese
  • Resources

Tooltip Tooltip Options

Tooltip has various customization options such as effects, positioning, events and custom content support.

Tooltip Tag Documentation

Tooltip goes beyond the legacy html title attribute by providing custom effects, events, html content and advance theme support.

NameTypeRequiredDefaultDescription
id String false generated Unique identifier of the component in a namingContainer.
rendered boolean false true Boolean value to specify the rendering of the component, when set to false component will not be rendered.
binding UIComponent false generated An EL expression referring to a server side UIComponent instance in a backing bean.
widgetVar String false generated ('widget_' + componentClientId) Name of the client side widget.
at String false Defines which position on the target element to align the positioned element against: "horizontal vertical" alignment. See the my option for full details on possible values. Percentage offsets are relative to the target element. If set overrides the 'position' attribute. Example "right center".
autoHide boolean false true Whether to hide tooltip when hovering over tooltip content.
beforeShow String false Client side callback to execute before tooltip is shown. Returning false will prevent display.
converter Converter false EL expression resolves to a converter instance or literal converter ID defining a component converter.
delegate boolean false false When enabled, event delegation is used for better performance.
escape boolean false true Defines whether html would be escaped or not.]
for String false Id of the component to attach the tooltip.
globalSelector String false a,:input,:button jquery selector for global tooltip.
hideDelay int false 0 Delay time to hide tooltip in milliseconds.
hideEffect String false fade Effect to be used for hiding
hideEvent String false mouseout Event hiding the tooltip.
my String false Defines which position on the element being positioned to align with the target element: "horizontal vertical" alignment. A single value such as "right" will be normalized to "right center", "top" will be normalized to "center top" (following CSS convention). Acceptable horizontal values: "left", "center", "right". Acceptable vertical values: "top", "center", "bottom". Example: "left top" or "center center". Each dimension can also contain offsets, in pixels or percent, e.g., "right+10 top-25%". Percentage offsets are relative to the element being positioned. If set overrides the 'position' attribute. Example "left center".
onHide String false Client side callback to execute after tooltip is hidden.
onShow String false Client side callback to execute after tooltip is shown.
position String false right Position of the tooltip, valid values are right, left, top and bottom.
showDelay int false 150 Delay time to show tooltip in milliseconds.
showEffect String false fade Effect to be used for displaying.
showEvent String false mouseover Event displaying the tooltip.
style String false Inline style of the component.
styleClass String false Style class of the component.
trackMouse boolean false false Tooltip position follows pointer on mousemover.
value Object false Value of the component.
Loading...
Tag DocumentationNew DocumentationNew Documentation JSDoc Options Global
Positions
Custom Position
Focus and Blur
Multiple Events
Track Mouse
Auto Hide
Animation
Content

Usage


<div class="card">
    <h5>Positions</h5>
    <div class="grid ui-fluid">
        <div class="col-12 md:col-3">
            <p:inputText id="right" type="text" placeholder="Right" />
            <p:tooltip for="right" value="Enter your username" position="right"/>
        </div>
        <div class="col-12 md:col-3">
            <p:inputText id="top" type="text" placeholder="Top" />
            <p:tooltip for="top" value="Enter your username" position="top"/>
        </div>
        <div class="col-12 md:col-3">
            <p:inputText id="bottom" type="text" placeholder="Bottom" />
            <p:tooltip for="bottom" value="Enter your username" position="bottom"/>
        </div>
        <div class="col-12 md:col-3">
            <p:inputText id="left" type="text" placeholder="Left" />
            <p:tooltip for="left" value="Enter your username" position="left"/>
        </div>
    </div>

    <h5>Custom Position</h5>
    <p:inputText id="custom" type="text" placeholder="Custom" />
    <p:tooltip for="custom" value="Enter your username" my="right center" at="left center"/>

    <h5>Focus and Blur</h5>
    <p:inputText id="focus" title="Enter your username"/>
    <p:tooltip for="focus" showEvent="focus" hideEvent="blur"/>

    <h5>Multiple Events</h5>
    <p:inputText id="multiple" title="Enter your username"/>
    <p:tooltip for="multiple" showEvent="mouseover focus touchstart" hideEvent="mouseout blur touchend"/>

    <h5>Track Mouse</h5>
    <p:graphicImage id="track" name="/images/primefaces-logo.svg" library="showcase"/>
    <p:tooltip for="track" value="Enter your username" trackMouse="true"/>

    <h5>Auto Hide</h5>
    <p:commandButton type="button" id="autoHideTrue" value="Auto Hide (true)" class="mr-2" />
    <p:tooltip for="autoHideTrue" autoHide="true">
        <p:graphicImage name="/images/primefaces-logo.svg" library="showcase"/>
    </p:tooltip>
    <p:commandButton type="button" id="autoHideFalse" value="Auto Hide (false)" />
    <p:tooltip for="autoHideFalse" autoHide="false">
        <p:graphicImage name="/images/primefaces-logo.svg" library="showcase"/>
    </p:tooltip>

    <h5>Animation</h5>
    <p:commandButton type="button" id="animate" icon="pi pi-cog"/>
    <p:tooltip for="animate" value="Customization options" showEffect="clip" hideEffect="fold" />
    
    <h5>Content</h5>
    <p:commandButton type="button" id="content" icon="pi pi-external-link"/>
    <p:tooltip for="content">
        <p:graphicImage name="/images/primefaces-logo.svg" library="showcase"/>
    </p:tooltip>
</div>