# 何时使用

- 长列表或对话流页面，需要快速**回顶**、**回底**
- 滚动容器是 `window` 或某个可滚动 `div`（`container` 传 ref 或选择器）
- 不适用：极短内容无需浮动导航时

---

# API

| 属性               | 类型 | 默认值 | 说明 |
| ------------------ | ---- | ------ | ---- |
| topIcon            | `keyof typeof Icons` \| `React.ReactElement` | `'ChevronUp'` | |
| bottomIcon         | `keyof typeof Icons` \| `React.ReactElement` | `'ChevronDown'` | |
| enableTop          | `boolean` | `true` | |
| enableBottom       | `boolean` | `true` | |
| onBackToTop        | `() => void` | - | |
| onBackToBottom     | `() => void` | - | |
| autoHideThreshold  | `number` \| `{ top: number; bottom: number }` \| `false` | `30` | 距顶/底多少 px 内隐藏按钮；`false` 常显 |
| loading            | `boolean` \| `{ top: boolean; bottom: boolean }` | `false` | 按钮加载态 |
| container          | `HTMLElement` \| `React.RefObject<HTMLElement>` \| `string` | - | 不传则监听窗口滚动 |
| position           | `'fixed' \| 'absolute'` | `'fixed'` | 局部滚动容器内常用 `absolute` |
| className          | `string` | - | |
| style              | `React.CSSProperties` | - | |

---

# FAQ

- `position="absolute"` 时父级需 `position: relative`，否则定位会相对更外层。
