Tooltip
Ein Tooltip bei Hover und Fokus für reine Icon-Steuerelemente, auf jeder Seite, mit optionalem Pfeil.
Verfügbar für
Angular: verfügbar Vue: verfügbar React: verfügbar React Native: verfügbar
Verwendung
<div class="demo-stack">
<div class="demo-row">
<button soneBtn variant="ghost" size="icon" type="button" aria-label="New note" soneTooltip="New note (⌘N)">
<sone-icon icon="note-add" />
</button>
<button soneBtn variant="ghost" size="icon" type="button" aria-label="Search" soneTooltip="Search">
<sone-icon icon="search" />
</button>
<button soneBtn variant="ghost" size="icon" type="button" aria-label="Move to trash" soneTooltip="Move to trash">
<sone-icon icon="trash" />
</button>
</div>
<div class="demo-row">
<button soneBtn variant="outline" size="sm" type="button" soneTooltip="Opens above" soneTooltipSide="top">Top</button>
<button soneBtn variant="outline" size="sm" type="button" soneTooltip="Opens to the right" soneTooltipSide="right">Right</button>
<button soneBtn variant="outline" size="sm" type="button" soneTooltip="Opens below (default)">Bottom</button>
<button soneBtn variant="outline" size="sm" type="button" soneTooltip="Opens to the left" soneTooltipSide="left">Left</button>
<button soneBtn variant="outline" size="sm" type="button" soneTooltip="Shown instantly, no arrow"
[soneTooltipShowDelay]="0" [soneTooltipArrow]="false">No delay</button>
</div>
</div>Import
import {
SoneTooltipDirective,
} from "@surface-one/angular/tooltip";API-Referenz
SoneTooltipDirectiveDirektive
Replaces the host's native `title` rather than sitting beside it — both at once would show two tooltips. The bubble is `aria-hidden`; the control keeps naming itself as it already did, or a screen reader would announce the name twice.
| Name | Typ | Standard |
|---|---|---|
soneTooltip | string | "" |
soneTooltipSide`null`: the side its container asks for (`SONE_TOOLTIP_SIDE`), else `bottom`. | TooltipSide | null | null |
soneTooltipAlign | TooltipAlign | "center" |
soneTooltipArrow | boolean | true |
soneTooltipDisabled | boolean | false |
soneTooltipShowDelay | — | SHOW_DELAY_MS |