# Tooltip · 补充提示

触发控件应已有清楚的文字或可访问名称。可以在提示里补充快捷键或操作说明。必读的信息请直接写在页面上；需要放置链接、输入框等交互内容时使用 Popover。

```tsx
'use client'

import { Button, Tooltip } from '@ancrel/ui'
import '@ancrel/tokens/css'
import '@ancrel/ui/styles.css'

export default function App() {
  return <Tooltip content="Keyboard shortcut: Ctrl + P" placement="bottom">
    <Button>Print</Button>
  </Tooltip>
}
```

Expected:

### Expected behavior

Focus **Print** to read its keyboard shortcut immediately, or hover briefly. The button keeps its name. Escape removes the hint without moving focus.

## 鼠标与键盘

悬停默认等待 350 毫秒，`delayMs` 可调整等待时间。提前移开会取消显示。键盘聚焦时立即显示，并通过 `aria-describedby` 在已有描述后追加提示。鼠标可以移到提示内容上阅读。

按 Escape 隐藏提示，焦点仍在原控件。Tab 继续页面原有的导航。提示同时由悬停和焦点保持时，两者都离开后才会自动隐藏。

| `Prop` | `Type` | `Required` | `Default` |
| - | - | - | - |
| `children` | `ReactElement` | `true` | `—` |
| `content` | `ReactNode` | `true` | `—` |
| `delayMs` | `number` | `false` | `—` |
| `key` | `React.Key \| null \| undefined` | `false` | `—` |
| `placement` | `'top' \| 'bottom' \| 'left' \| 'right'` | `false` | `—` |
| `ref` | `React.Ref<HTMLDivElement> \| undefined` | `false` | `—` |

```ts
import * as React from 'react';
import type { TooltipProps } from './types.js';
export declare const Tooltip: React.ForwardRefExoticComponent<TooltipProps & React.RefAttributes<HTMLDivElement>>;
```

* default — dark/compact, dark/comfortable, light/compact, light/comfortable
