Tooltip
アイコンのみのコントロール向けに、ホバーとフォーカスで表示されるツールチップ。任意の方向に表示でき、矢印も付けられます。
対応フレームワーク
Angular: 対応 Vue: 対応 React: 対応 React Native: 対応
使い方
<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 {
SoneTooltipDirective,
} from "@surface-one/angular/tooltip";API リファレンス
SoneTooltipDirectiveディレクティブ
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.
| 名前 | 型 | デフォルト |
|---|---|---|
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 |