agentleFS
haxsdhaxsd/haxsd-byok/.agents/skills/floating-ui/SKILL.md

floating-ui

Skill33 starsChanged 34 days agoMITView on GitHub

Implement or review floating desktop UI such as dropdowns, popovers, tooltips, menus, comboboxes, and nested overlays under apps/desktop.

2 other projects use a version of this.

Adopted by

Most recently taken up by

  • Other versions2 projects use a version of this.

    Word for word · 1

    1. leookun/cursor-byok★ 3.2k100% same

    Edited · 0

    None found.

    Wrote their own version · 1

    1. Marvellbrazil/my-agentic-skills★ 4same name

    How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.

  • In this repository7 other files it gives its agents.

The file

We split this skill into the rules it gives an agent

5 rules. About 0 are common, 2 are distinctive, and 3 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 3

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use @floating-ui/dom for every interactive element positioned relative to a trigger.

    line 8
  2. Very specific:

    Start from the closest existing control in apps/desktop/src/components/ui.

    line 14
  3. Very specific:

    Use size when reference width or viewport height constrains the overlay.

    line 16
  4. Distinctive:

    Keep the trigger's open/focus border visible while focus is inside a portaled overlay.

    line 20
  5. Distinctive:

    Verify placement near all viewport edges, nested-overlay clicks, keyboard dismissal, virtual scrolling, and fixed footer behavior.

    line 24

≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

Floating UI

Use @floating-ui/dom for every interactive element positioned relative to a trigger. Do not calculate coordinates manually or rely on CSS absolute offsets for dropdowns, popovers, menus, combobox lists, or tooltips.

Required structure

  • Render overlays through createPortal(..., document.body) so layout and stacking contexts do not clip them.
  • Position with computePosition inside autoUpdate; clean up the function returned by autoUpdate when the overlay closes or unmounts.
  • Start from the closest existing control in apps/desktop/src/components/ui. Match its placement, offset, flip, shift, and size middleware unless the interaction requires a deliberate difference.
  • Store computed left, top, width, and available height in React state. Apply the state to the portal root; do not mutate element styles directly.
  • Use size when reference width or viewport height constrains the overlay. Lists that can grow must use components/virtual/VirtualList.tsx; keep fixed headers and footers outside the virtual viewport.

Interaction invariants

  • Keep the trigger's open/focus border visible while focus is inside a portaled overlay.
  • Close on outside pointer interaction and Escape, then return focus to the trigger.
  • Outside-click checks must include both trigger and overlay. A nested portaled overlay must stop its pointer event from reaching the parent's outside-click listener, so interacting with a child menu never closes its parent.
  • Expose trigger state with aria-expanded, aria-controls, and the appropriate aria-haspopup; give the overlay the matching menu, listbox, dialog, or tooltip semantics.
  • Verify placement near all viewport edges, nested-overlay clicks, keyboard dismissal, virtual scrolling, and fixed footer behavior.

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.