floating-ui-vue-skilld — скилл для Claude Code: обзор и установка
Скилл floating-ui-vue-skilld помогает писать позиционирование всплывающих окон, тултипов и меню через @floating-ui/vue 2.0.1 во Vue 3.3+.
MIT 119 установок ★ 186 обновлён 2026-10-10
npx skills add skilld-dev/vue-ecosystem-skills --skill floating-ui-vue-skilld -a claude-codeЧто делает floating-ui-vue-skilld
Скилл инструктирует ИИ-агента по работе с библиотекой @floating-ui/vue версии 2.0.1. Он подсказывает корректное использование композабла useFloating, реактивных стилей floatingStyles, автоматического слежения autoUpdate и мидлваров offset, flip или shift.
В релизе 2.0.0 удалили прослойку vue-demi, поэтому код работает строго с Vue >=3.3.0. Если в проекте используется Vue 2 или старая ветка Vue 3, переходить на вторую версию нельзя — нужно оставаться на первой.
Для всплывающего блока скилл требует использовать директиву v-if при связке с whileElementsMounted: autoUpdate. Директива v-show приведёт к утечке слушателей скролла на скрытых элементах, если не очищать их вручную.
Какие задачи решает
- позиционировать тултипы и поповеры через
useFloatingво Vue 3 - настроить мидлвары
flip,shiftиoffsetдля всплывающего меню - предотвратить утечки памяти от слушателей
autoUpdateпри скрытии элементов - перевести вызовы
@floating-ui/vueс версии 1.x на 2.0.1
Примеры запросов агенту
- Сделай тултип на
@floating-ui/vueс привязкой к кнопке и автоматическим сдвигом при скролле - Настрой композабл
useFloatingс мидлварамиoffsetиarrowдля Vue 3.4 - Обнови компонент поповера с первой версии
@floating-ui/vueна 2.0.1
Как установить floating-ui-vue-skilld
1Через Skills CLI (Vercel)
npx skills add skilld-dev/vue-ecosystem-skills --skill floating-ui-vue-skilld -a claude-code2Вручную: положить файлы
~/.claude/skills/floating-ui-vue-skilld/SKILL.mdПапка скилла целиком; для одного проекта — .claude/skills/floating-ui-vue-skilld/
1Через Skills CLI (Vercel)
npx skills add skilld-dev/vue-ecosystem-skills --skill floating-ui-vue-skilld -a codex2Вручную: положить файлы
.agents/skills/floating-ui-vue-skilld/SKILL.mdДля всех проектов — ~/.agents/skills/
1Через Skills CLI (Vercel)
npx skills add skilld-dev/vue-ecosystem-skills --skill floating-ui-vue-skilld -a cursor2Вручную: положить файлы
.cursor/skills/floating-ui-vue-skilld/SKILL.mdCursor читает и .agents/skills/, и .claude/skills/
1GitHub CLI
gh skill install skilld-dev/vue-ecosystem-skills skills/floating-ui-vue-skilld2Вручную: положить файлы
.github/skills/floating-ui-vue-skilld/SKILL.md1Через Skills CLI (Vercel)
npx skills add skilld-dev/vue-ecosystem-skills --skill floating-ui-vue-skilld -a gemini-cli2Командой платформы
gemini skills install https://github.com/skilld-dev/vue-ecosystem-skills --path skills/floating-ui-vue-skilldВручную: положить файлы
.devin/skills/floating-ui-vue-skilld/SKILL.mdСтарый путь .windsurf/skills/ тоже читается
Через Skills CLI (Vercel)
npx skills add skilld-dev/vue-ecosystem-skills --skill floating-ui-vue-skilld -a opencodeClaude.ai
Упакуйте папку в zip и загрузите в Settings → Capabilities → Skills
По шагам, с командами для каждой платформы: Как установить скилл в Claude Code: пять способов
Вопросы о floating-ui-vue-skilld
Как установить floating-ui-vue-skilld в Claude Code?
Выполните команду npx skills add skilld-dev/vue-ecosystem-skills --skill floating-ui-vue-skilld -a claude-code. Файл навыка запишется по пути ~/.claude/skills/floating-ui-vue-skilld/SKILL.md.
Для каких версий Vue подходит этот скилл?
Скилл ориентирован на @floating-ui/vue 2.0.1 и требует Vue версии не ниже 3.3.0. Для проектов на Vue 2 или старых сборках Vue 3 разработчики рекомендуют зафиксировать первую версию библиотеки.
Почему для всплывающих элементов советуют использовать v-if вместо v-show?
При связке с whileElementsMounted: autoUpdate директива v-show оставляет скрытые элементы в DOM и не сбрасывает слушатели событий. С v-if элемент размонтируется, поэтому слушатели корректно очищаются.
Исходный текст
SKILL.md · MIT
--- name: floating-ui-vue-skilld description: "Floating UI for Vue (@floating-ui/[email protected]). ALWAYS use when writing code importing \"@floating-ui/vue\" or using useFloating, arrow, floatingStyles, or autoUpdate. Consult for middleware setup, anchoring, virtual elements, and v1 to v2 migration. Vue 3.3+ only." license: MIT --- # @floating-ui/vue 2.0.1 Vue 3 composable for anchor positioning. `useFloating()` computes `x`/`y` coordinates that place a floating element (tooltip, popover, menu) next to a reference element. ## Version limits - Vue `>=3.3.0` only (peer dependency, `package.json:58`). v2.0.0 dropped the `vue-demi` layer, ending Vue 2 and Vue <3.3 support. - Vue 2 or Vue <3.3 projects must stay on `npm install @floating-ui/vue@1` (https://floating-ui.com/docs/vue). - Runtime dependencies: `@floating-ui/dom@^1.8.0`, `@floating-ui/utils@^0.2.12` (`package.json:46-49`). - TypeScript with `exactOptionalPropertyTypes`: supported since v2.0.1 (optional properties are typed `T | undefined`, `dist/floating-ui.vue.d.ts:198-224`). ## Quick start ```vue <script setup> import {ref} from 'vue'; import {useFloating, offset, flip, shift, autoUpdate} from '@floating-ui/vue'; const reference = ref(null); const floating = ref(null); const open = ref(false); const {floatingStyles, isPositioned} = useFloating(reference, floating, { open, middleware: [offset(10), flip(), shift()], whileElementsMounted: autoUpdate, }); </script> <template> <button ref="reference" @click="open = !open">Button</button> <div v-if="open" ref="floating" :style="floatingStyles">Tooltip</div> </template> ``` Default placement is `bottom`; positioning uses `transform` by default (https://floating-ui.com/docs/vue). ## API changes since 1.x - BREAKING (2.0.0): `vue-demi` removed. Vue 2 and Vue <3.3 no longer supported. No other breaking API changes; `useFloating`, `arrow`, and all re-exports keep their 1.1.x signatures (https://github.com/floating-ui/floating-ui/releases/tag/@floating-ui/[email protected]). - FIX (2.0.1): optional `useFloating` options accept explicit `undefined` under `exactOptionalPropertyTypes` (https://github.com/floating-ui/floating-ui/releases/tag/@floating-ui/[email protected]). - Unchanged behaviors carried from 1.x: `x`/`y` default to `0` (not `null`); `floatingStyles` returns ready-to-bind positioning styles; options accept refs and getters (`MaybeReadonlyRefOrGetter`) since 1.1.0 (verified in `dist/floating-ui.vue.d.ts:193-225`, `dist/floating-ui.vue.mjs:83-84`). ## Best practices - Pass `whileElementsMounted: autoUpdate` so the floating element stays anchored during scroll, resize, and layout changes (`dist/floating-ui.vue.mjs:146-156`; https://floating-ui.com/docs/vue). - When wrapping `autoUpdate` to pass options, always return the cleanup function (`dist/floating-ui.vue.mjs:140-145`): ```ts useFloating(reference, floating, { whileElementsMounted(...args) { return autoUpdate(...args, {animationFrame: true}); }, }); ``` - Use `v-if` for the floating element when using `whileElementsMounted`. With `v-show`, skip `whileElementsMounted` and manage `autoUpdate` manually, or listeners leak on hidden elements (https://floating-ui.com/docs/vue). - Pass an `open` ref and gate side effects on `isPositioned`; positioning resolves in a microtask, so the element sits at (0, 0) until then. `isPositioned` stays `false` while `open` is `false` (`dist/floating-ui.vue.mjs:137`, `dist/floating-ui.vue.mjs:157-161`): ```ts const {isPositioned} = useFloating(reference, floating, {open}); watch(isPositioned, (positioned) => { if (positioned) inputRef.value?.focus(); }); ``` - Pass refs or getters (`() => props.placement`) to `open`, `placement`, `strategy`, `middleware`, `transform` options for reactivity; they are watched with `flush: 'sync'` (`dist/floating-ui.vue.mjs:162-164`). - Pass component template refs directly. Components are unwrapped via `$el`; a component that renders a comment node resolves to `null` and positioning safely no-ops (`dist/floating-ui.vue.mjs:6-15`). - Keep the default `transform: true` and animate an inner wrapper element if you need CSS transform animations; the outer positioned node keeps `translate()` positioning (https://floating-ui.com/docs/vue). - Use `arrow({element: arrowRef})` with a template ref. It no-ops (returns `{}`) until the arrow element mounts; read `middlewareData.arrow?.x/.y` for placement (`dist/floating-ui.vue.mjs:27-34`). ## Common tasks - Arrow positioning example and full option defaults: [API reference](./references/api.md). - Upgrading from 1.x or pinning for Vue 2: [Migration guide](./references/migration.md). ## Package exports `useFloating`, `arrow`, plus re-exports from `@floating-ui/dom`: `autoPlacement`, `autoUpdate`, `computePosition`, `detectOverflow`, `flip`, `getOverflowAncestors`, `hide`, `inline`, `limitShift`, `offset`, `platform`, `shift`, `size` (`dist/floating-ui.vue.mjs:2`). Import middleware from `@floating-ui/vue`, not `@floating-ui/dom`, to keep the Vue-aware `arrow` behavior.
© skilld-dev · MIT · skilld-dev/vue-ecosystem-skills