05Arrow tail
A small triangular tail under the bubble makes it obvious which element it points to.
Best forHints next to form fields, labels on chart data points
clip-path 삼각형4px 간격opacity

<main class="stage">
<div class="tip-wrap">
<span class="field-icon" aria-describedby="tip05">?</span>
<span class="tooltip is-demo" role="tooltip" id="tip05">Use at least 8 characters</span>
</div>
</main>@use "../../../../site/static/demo-tokens" as *;
$duration: $dur-loop; // 숨김→표시→숨김 한 주기
$easing: $ease-out;
$color: $subject-cream; // 아이콘·말풍선 색
@include stage($stage-ink);
.tip-wrap { position: relative; }
.field-icon {
display: grid;
place-items: center;
width: 34px;
height: 34px;
border-radius: 50%;
background: $color;
color: $stage-ink;
font-weight: 700;
font-size: 15px;
line-height: 1;
font-family: inherit;
}
.tooltip {
position: absolute;
bottom: calc(100% + 14px); // 화살표 8px + 여유 6px
left: 50%;
transform-origin: bottom center; // 규칙8: 화살표(아래변 중심) 축 — 흔들림의 회전 중심
transform: translate(-50%, 4px);
opacity: 0;
background: $color;
color: $stage-ink;
padding: 8px 14px;
border-radius: $r-control;
font-size: clamp(12px, 3.4vw, 14px);
white-space: nowrap;
pointer-events: none;
&::after { // 꼬리: clip-path 로 삼각형만 남긴다
content: "";
position: absolute;
top: 100%;
left: 50%;
transform: translateX(-50%);
width: 14px;
height: 8px;
background: $color;
clip-path: polygon(50% 100%, 0 0, 100% 0);
}
}
.tooltip.is-demo {
animation: tip-loop $duration $easing infinite;
}
// 등장 스프링 한 겹 — 스케일 .85 → 1.12 오버슛 → 감쇠 반동, 회전은 화살표 축으로 2.6° → -1.5° → .6° 감쇠
@keyframes tip-loop {
0% { opacity: 0; transform: translate(-50%, 4px) scale(.85) rotate(0deg); }
12% { opacity: 1; transform: translate(-50%, 0) scale(1.12) rotate(2.6deg); }
22% { opacity: 1; transform: translate(-50%, 0) scale(.95) rotate(-1.5deg); }
30% { opacity: 1; transform: translate(-50%, 0) scale(1.03) rotate(.6deg); }
36%, 55% { opacity: 1; transform: translate(-50%, 0) scale(1) rotate(0deg); }
80% { opacity: 0; transform: translate(-50%, 4px) scale(.85) rotate(0deg); }
100% { opacity: 0; transform: translate(-50%, 4px) scale(.85) rotate(0deg); }
}
@media (prefers-reduced-motion: reduce) {
.tooltip.is-demo { animation: none; opacity: 1; transform: translate(-50%, 0) scale(1) rotate(0deg); }
}html, body {
margin: 0;
overflow: hidden;
}
.stage {
box-sizing: border-box;
min-height: 100vh;
display: grid;
place-items: center;
margin: 0;
background: #17141a;
font-family: -apple-system, "Segoe UI", "Noto Sans KR", sans-serif;
padding: clamp(8px, 4vw, 24px);
}
.tip-wrap {
position: relative;
}
.field-icon {
display: grid;
place-items: center;
width: 34px;
height: 34px;
border-radius: 50%;
background: #fff7e6;
color: #17141a;
font-weight: 700;
font-size: 15px;
line-height: 1;
font-family: inherit;
}
.tooltip {
position: absolute;
bottom: calc(100% + 14px);
left: 50%;
transform-origin: bottom center;
transform: translate(-50%, 4px);
opacity: 0;
background: #fff7e6;
color: #17141a;
padding: 8px 14px;
border-radius: 12px;
font-size: clamp(12px, 3.4vw, 14px);
white-space: nowrap;
pointer-events: none;
}
.tooltip::after {
content: "";
position: absolute;
top: 100%;
left: 50%;
transform: translateX(-50%);
width: 14px;
height: 8px;
background: #fff7e6;
clip-path: polygon(50% 100%, 0 0, 100% 0);
}
.tooltip.is-demo {
animation: tip-loop 2s ease-out infinite;
}
@keyframes tip-loop {
0% {
opacity: 0;
transform: translate(-50%, 4px) scale(0.85) rotate(0deg);
}
12% {
opacity: 1;
transform: translate(-50%, 0) scale(1.12) rotate(2.6deg);
}
22% {
opacity: 1;
transform: translate(-50%, 0) scale(0.95) rotate(-1.5deg);
}
30% {
opacity: 1;
transform: translate(-50%, 0) scale(1.03) rotate(0.6deg);
}
36%, 55% {
opacity: 1;
transform: translate(-50%, 0) scale(1) rotate(0deg);
}
80% {
opacity: 0;
transform: translate(-50%, 4px) scale(0.85) rotate(0deg);
}
100% {
opacity: 0;
transform: translate(-50%, 4px) scale(0.85) rotate(0deg);
}
}
@media (prefers-reduced-motion: reduce) {
.tooltip.is-demo {
animation: none;
opacity: 1;
transform: translate(-50%, 0) scale(1) rotate(0deg);
}
}import { useState } from "react";
import type { CSSProperties } from "react";
import styles from "./ArrowTooltip.module.scss";
export type ArrowTooltipProps = {
text: string;
duration?: number;
easing?: string;
color?: string;
};
type Vars = CSSProperties & { "--duration"?: string; "--easing"?: string; "--color"?: string };
export default function ArrowTooltip({
text,
duration = 200,
easing = "ease-out",
color = "#fff7e6",
}: ArrowTooltipProps) {
const [open, setOpen] = useState(false);
const vars: Vars = { "--duration": `${duration}ms`, "--easing": easing, "--color": color };
return (
<span className={styles.wrap} style={vars}>
<span
className={styles.icon}
tabIndex={0}
aria-describedby="arrow-tooltip"
onMouseEnter={() => setOpen(true)}
onMouseLeave={() => setOpen(false)}
onFocus={() => setOpen(true)}
onBlur={() => setOpen(false)}
>
?
</span>
<span id="arrow-tooltip" role="tooltip" className={styles.tooltip} data-open={open}>
{text}
</span>
</span>
);
}05 Arrow tail — Measured area 4.799% · moving frames 15/23Original by GODRICH · SCSS and React ship in the zip · 9 CSS Tooltip Bubbles — one line, copy-paste
The post this demo lives in
9 CSS Tooltip Bubbles — one line, copy-pasteA css tooltip bubble is a small floating label that shows extra text next to a button, link, or icon and disappears agai See all demos in this post


