FleetbaseFleetbase

Attach::Tooltip

<Attach::Tooltip> renders a tooltip attached to its parent element. Wraps <Attach::Popover> with tooltip-friendly defaults — hover/focus triggers, top placement, fade animation.

<Attach::Tooltip>

<Attach::Tooltip> renders a tooltip floating layer attached to its parent element. It is a thin wrapper around <Attach::Popover> with sensible tooltip defaults — shows on mouseenter focus, hides on mouseleave blur escapekey, with top placement.

This is the canonical tooltip primitive used throughout @fleetbase/ember-ui. Most other components (<Button>, <ContentPanel>, <Toggle>, etc.) have built-in tooltip behavior driven by their @helpText arg — under the hood they're rendering <Attach::Tooltip>.

Basic Usage

Place <Attach::Tooltip> inside the element you want to attach to:

<button class="btn">
  <FaIcon @icon="info" />
  <Attach::Tooltip>
    Click here to learn more
  </Attach::Tooltip>
</button>

The tooltip auto-hides until the user hovers or focuses the parent button.

With Rich Content

<span class="cursor-help underline decoration-dotted">
  Tax inclusive
  <Attach::Tooltip @placement="bottom">
    <div class="text-xs">
      Prices include tax at the rate configured for your store.
    </div>
  </Attach::Tooltip>
</span>

Common Pattern with <InputInfo>

Most ember-ui components combine <Attach::Tooltip> with the <InputInfo> content component:

<button class="btn btn-default">
  <FaIcon @icon="info-circle" />
  <Attach::Tooltip @class="clean" @animation="scale" @placement="top">
    <InputInfo @text="Configures the order auto-acceptance window" @exampleText="Recommended: 5 minutes" />
  </Attach::Tooltip>
</button>

Use this when you want the matching styling that @helpText produces on <Button>, <ContentPanel>, etc.

Arguments

ArgumentTypeDefaultDescription
@placementstringtopPlacement — top, bottom, left, right, plus -start / -end variants
@classstringClass on the tooltip — pass clean for the unstyled-tooltip variant used with <InputInfo>
@arrowbooleanfalseRender an arrow pointing at the parent
@offsetnumberDistance from the parent in px
@shiftOptionsobjectFloating-UI shift middleware options
@animationstringfillAnimation — fill, scale, slide, none
@hideOnstringmouseleave blur escapekeySpace-separated event names to hide on
@showOnstringmouseenter focusSpace-separated event names to show on
@interactivebooleanfalseAllow the user to mouse into the tooltip without it closing
@isShownbooleanfalseImperative show/hide
@lazyRenderbooleanfalseDon't render until the first show
@showDelaynumber0Show delay in ms
@showDurationnumber300Show animation duration
@transitionDurationnumber0Transition duration
@renderInPlacebooleanfalseRender in DOM order instead of via a portal

Real-World Examples

{{!-- Standard help tooltip --}}
<button>
  <FaIcon @icon="info-circle" />
  <Attach::Tooltip>This explains what the field does</Attach::Tooltip>
</button>

{{!-- Tooltip on a status icon --}}
<span class="text-yellow-500">
  <FaIcon @icon="exclamation-triangle" />
  <Attach::Tooltip @placement="right">
    Driver hasn't been seen in over 30 minutes
  </Attach::Tooltip>
</span>

{{!-- Used by ember-ui internally for @helpText support --}}
<Button @text="Save" @helpText="Persists your changes" />
{{!-- expands to: <button> ... <Attach::Tooltip>...<InputInfo @text=...></InputInfo></Attach::Tooltip></button> --}}

See Also

  • <Attach::Popover> — for click-triggered or persistent popovers
  • <Floating> — the lower-level positioning primitive both Attach components use
  • The @helpText arg on <Button>, <ContentPanel>, <Toggle>, <Checkbox> — built-in tooltip support that uses this internally

Source

FileDescription
addon/components/attach/tooltip.hbsTooltip template — wraps <Attach::Popover>
addon/components/attach/tooltip.jsTooltip class
Attach::Tooltip | Fleetbase