Tooltip
Podpowiedź wyświetlana po najechaniu i przy fokusie, dla kontrolek z samą ikoną, z dowolnej strony, z opcjonalną strzałką.
Dostępny w
Angular: dostępny Vue: dostępny React: dostępny React Native: dostępny
Użycie
<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";Dokumentacja API
SoneTooltipDirectiveDyrektywa
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.
| Nazwa | Typ | Domyślnie |
|---|---|---|
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 |