macOS Magnify Dock
A floating icon dock whose items swell under the pointer, the neighbours lifting less than the one you are on.
6 个框架高级
A speed-dial FAB that fans out secondary actions above it on demand.
<!--
A speed-dial FAB. Shown OPEN; the React/TypeScript variants own the toggle.
The main button owns aria-expanded. Collapsed, the secondary actions are
aria-hidden and tabindex=-1 so they leave the tab order entirely - being
invisible is not the same as being unreachable. The fan-out is dropped under
reduced motion.
-->
<div class="fixed bottom-6 right-6 flex flex-col items-end gap-3">
<ul class="flex flex-col items-end gap-2">
<li class="flex items-center gap-2 transition duration-200 ease-out motion-reduce:transition-none">
<span class="rounded-md bg-gray-900 px-2 py-1 text-xs font-medium text-white shadow-sm dark:bg-gray-100 dark:text-gray-900">New note</span>
<button type="button" aria-label="New note" class="flex h-11 w-11 items-center justify-center rounded-full bg-white text-gray-700 shadow-md hover:bg-gray-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-600 focus-visible:ring-offset-2 focus-visible:ring-offset-white dark:bg-gray-800 dark:text-gray-100 dark:hover:bg-gray-700 dark:focus-visible:ring-blue-400 dark:focus-visible:ring-offset-gray-900">
<svg class="h-5 w-5" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M6 3h9l4 4v14a1 1 0 0 1-1 1H6a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1ZM8 11h8M8 15h5" /></svg>
</button>
</li>
<li class="flex items-center gap-2 transition duration-200 ease-out motion-reduce:transition-none">
<span class="rounded-md bg-gray-900 px-2 py-1 text-xs font-medium text-white shadow-sm dark:bg-gray-100 dark:text-gray-900">Upload photo</span>
<button type="button" aria-label="Upload photo" class="flex h-11 w-11 items-center justify-center rounded-full bg-white text-gray-700 shadow-md hover:bg-gray-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-600 focus-visible:ring-offset-2 focus-visible:ring-offset-white dark:bg-gray-800 dark:text-gray-100 dark:hover:bg-gray-700 dark:focus-visible:ring-blue-400 dark:focus-visible:ring-offset-gray-900">
<svg class="h-5 w-5" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M5 4h14a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2Zm-1 13 5-5 4 4 3-2 4 4" /></svg>
</button>
</li>
<li class="flex items-center gap-2 transition duration-200 ease-out motion-reduce:transition-none">
<span class="rounded-md bg-gray-900 px-2 py-1 text-xs font-medium text-white shadow-sm dark:bg-gray-100 dark:text-gray-900">New event</span>
<button type="button" aria-label="New event" class="flex h-11 w-11 items-center justify-center rounded-full bg-white text-gray-700 shadow-md hover:bg-gray-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-600 focus-visible:ring-offset-2 focus-visible:ring-offset-white dark:bg-gray-800 dark:text-gray-100 dark:hover:bg-gray-700 dark:focus-visible:ring-blue-400 dark:focus-visible:ring-offset-gray-900">
<svg class="h-5 w-5" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.75" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M5 5h14a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V7a2 2 0 0 1 2-2ZM3 10h18M8 3v4M16 3v4" /></svg>
</button>
</li>
</ul>
<button type="button" aria-label="Close actions" aria-expanded="true" class="flex h-14 w-14 items-center justify-center rounded-full bg-blue-600 text-white shadow-lg hover:bg-blue-700 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-600 focus-visible:ring-offset-2 focus-visible:ring-offset-white dark:focus-visible:ring-blue-400 dark:focus-visible:ring-offset-gray-900">
<svg class="h-6 w-6 rotate-45 transition-transform duration-200 motion-reduce:transition-none" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M12 5v14M5 12h14" /></svg>
</button>
</div>| Prop | 类型 | 默认值 | 说明 |
|---|---|---|---|
actions | readonly FloatingAction[] | DEFAULT_ACTIONS | 要渲染的项目数组。 |
onSelect | (id: string) => void | - | 用户选择菜单项时触发,参数为所选项。 |
defaultOpen | boolean | false | Active |
className | string | - | 合并到根元素上的额外类名。 |
The main button owns `aria-expanded`. While collapsed the secondary actions are `aria-hidden` and `tabIndex={-1}`, so they leave the tab order entirely - invisible is not the same as unreachable. The staggered fan-out is dropped under reduced motion, landing on the resting state.