lynx-family/lynx-ui/lynx-ui-popover
Claude Code and agent skill by lynx-family/lynx-ui
- community
- ext:[{"type":"context","description":"Custom context provider definitions"}]
Checking that the SKILL.md file is still in the repository.
Install
npx vskill@latest install lynx-family/lynx-ui/lynx-ui-popoverSemi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard
SKILL.md
The same SKILL.md was published earlier as lynx-family/lynx-ui/lynx-ui-popover.
Lynx UI Popover SKILL
lynx-ui-popover is a headless primitive for building accessible, positioned floating elements. It handles the complex logic of positioning, stacking context, and enter/exit animations via usePresence.
1. Core Capabilities
- Headless & Composable: Provides raw functional components (
Root,Trigger,Positioner,Content) that you compose to build custom UIs. - Auto Positioning: The
PopoverPositionerautomatically calculates coordinates to anchor the popover to the trigger. - Presence Animations: Integrated with
usePresencelifecycle. Components mount/unmount withentering/leavingstates, allowing for CSS animations. - Robust Visibility Modes: Supports Controlled (external state) and Uncontrolled (internal state) modes with predictable behavior.
2. Behavior Contract
Visibility Modes
- Controlled: Parent passes
showprop and handlesonVisibleChangecallback. - Uncontrolled: Parent passes
defaultShow; component manages internal state.
Presence Lifecycle
- States: Transitions through
Entering->DelayedEntering->Entered->Leaving->Left. - Animation Safety: Handles animation/transition start, end, and cancel events to ensure state never stalls.
- Debugging: Enable
debugLog={true}onPopoverRootto trace lifecycle state changes in the console.
Interactions
- Trigger: Toggles visibility on click/tap.
- Backdrop: Closes popover (sets visibility to
false) on tap. Without
motion content, it is disabled during busy lifecycle states.
3. AI Coding Guide
Minimal Usable Example
Crucial: Wrap Content and Arrow inside PopoverPositioner. Apply layout/animation styles to Positioner, and visual styles (background, border) to Content.
Recommended Prompt Formula
Goal: Build a lynx-ui Popover using [controlled|uncontrolled] mode.Components: Include [Trigger], [Positioner], [Content], and optional [Backdrop/Anchor/Arrow].Behavior: Define transition [name] and set [debugLog on/off].Styling Requirements:1. DO setopacity: 0/scale(0)on.ui-closedclass (prevents flashing after exit animation).2. Use CSS keyframes or transitions for enter/exit.
4. Use Cases & Best Practices
Scenario 1: Animation Best Practices (Prevent Flashing)
Problem (Exit Flash): When the exit animation finishes, the ui-leaving class is removed immediately, but the element might remain visible for one frame before visibility: hidden is applied. Solution: Explicitly hide the element in the ui-closed state.
Scenario 2: Synchronized Arrow Animation
Problem: If you animate PopoverContent but PopoverArrow is outside or has its own animation, they might detach or look disconnected during scale/fade. Solution: Apply the animation class to their common parent, PopoverPositioner.
5. FAQ
Q: Why doesn't the Arrow animate with the Content? A: Ensure you are animating the PopoverPositioner (which contains both), not just the PopoverContent.
Q: Can I use CSS Transitions instead of Animations? A: Yes, and it is often smoother for simple fades because transitions interpolate from the _current_ value when interrupted, whereas animations reset.
6. Sub Components
- PopoverRoot: Context provider, manages visibility state.
- PopoverTrigger: The element that toggles the popover.
- PopoverPositioner: The floating container that positions itself relative to the trigger. Apply animations here.
- PopoverContent: The visual box for your content.
- PopoverArrow: The triangle pointing to the trigger.
- PopoverBackdrop: An overlay behind the popover (often used for dimming or click-outside).
Custom Rectangular Arrows
Use a downward-pointing custom child and describe its original dimensions:
Set .arrow-artwork to 32px wide and 11px high. The positioning box is 32 × 11 for top/bottom and 11 × 32 for left/right; protrusion stays 11px. Do not swap the input dimensions or rotate the child for horizontal placement. The caller's placementOffset is additional to this protrusion.
Keep the arrow a direct child of PopoverContent. Its coordinates are relative to the bubble, so a centered inner wrapper can introduce an offset. For an accurately sized arrow, set offset to the larger adjacent corner radius in pixels. Padding is an edge constraint, not a fixed shift from the anchor. Small bubbles may clamp it; the design system must choose a fallback when the arrow cannot fit between the corners. The primitive preserves the bubble's radius.
Numeric size retains its square box and protrusion. Without children, object sizes still use the larger dimension for the default border triangle. With children, object sizes now use the actual rectangle instead of the former maximum-dimension square. Custom children do not receive triangle borders.
See the arrow alignment example for native comparisons and design-system integration guidance.
Motion-driven Content
Use PopoverMotionContent in place of PopoverContent when motion should control entry and exit. Keep the positioner and content mounted and toggle PopoverRoot visibility so the exit can finish. Bundlers that support tree shaking can omit the motion engine when the motion content is unused, although the popover package still installs it as a dependency.
Motion owns opacity when an opacity target is supplied, and transform when any transform target is supplied. Do not animate an owned property with CSS on the same node. Other style properties remain available to the consumer. The default transform origin is the arrow tip, or the corresponding content edge when no arrow is present. Use one motion content per root. Omitted target values retain their current values. Set a shared transition in motion, or override it on each target; tween duration is in seconds. See the Motion example for a complete composition. Motion content allows the trigger and backdrop to respond while entry or exit is running so the animation can reverse.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingpackages/lynx-ui-popover/SKILL.md
Popularity
- Repository stars
- 108
- Repository forks
- 10
- 7-day trend score
- 23
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Extension points
contextCustom context provider definitions
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/lynx-family/lynx-ui/lynx-ui-popover)