packages/lynx-ui-popover/SKILL.md
# 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 `PopoverPositioner` automatically calculates coordinates to anchor th
npx skillsauth add lynx-family/lynx-ui packages/lynx-ui-popoverInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
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.
Root, Trigger, Positioner, Content) that you compose to build custom UIs.PopoverPositioner automatically calculates coordinates to anchor the popover to the trigger.usePresence lifecycle. Components mount/unmount with entering/leaving states, allowing for CSS animations.show prop and handles onVisibleChange callback.defaultShow; component manages internal state.Entering -> DelayedEntering -> Entered -> Leaving -> Left.debugLog={true} on PopoverRoot to trace lifecycle state changes in the console.false) on tap. Respects "busy" lifecycle states (e.g., won't close if already animating out).Crucial: Wrap Content and Arrow inside PopoverPositioner. Apply layout/animation styles to Positioner, and visual styles (background, border) to Content.
import {
PopoverRoot,
PopoverTrigger,
PopoverPositioner,
PopoverContent,
PopoverArrow,
PopoverBackdrop,
} from '@lynx-js/lynx-ui'
import './style.css'
export default function App() {
return (
<PopoverRoot>
<PopoverTrigger className='trigger'>
<text>Open Popover</text>
</PopoverTrigger>
{/* Positioner handles layout and animation */}
<PopoverPositioner className='popover-positioner' placement='bottom'>
<PopoverBackdrop className='popover-backdrop' />
{/* Content handles visual appearance */}
<PopoverContent className='popover-content'>
<text>My Popover</text>
<PopoverArrow className='popover-arrow' />
</PopoverContent>
</PopoverPositioner>
</PopoverRoot>
)
}
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:
- DO set
opacity: 0/scale(0)on.ui-closedclass (prevents flashing after exit animation).- Use CSS keyframes or transitions for enter/exit.
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.
/* style.css */
.popover-positioner {
display: flex;
}
/* Entering State: Mounted -> Visible */
.popover-positioner.ui-entering {
animation: fade-in 0.2s ease-out forwards;
}
/* Leaving State: Visible -> Unmounted */
.popover-positioner.ui-leaving {
animation: fade-out 0.2s ease-in forwards;
}
/* Closed State: Hidden */
/* Crucial: Prevents a flash of unstyled content after exit animation ends but before unmount */
.popover-positioner.ui-closed {
opacity: 0;
transform: scale(0);
}
@keyframes fade-in {
from {
opacity: 0;
transform: scale(0.9);
}
to {
opacity: 1;
transform: scale(1);
}
}
@keyframes fade-out {
from {
opacity: 1;
transform: scale(1);
}
to {
opacity: 0;
transform: scale(0.9);
}
}
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.
<PopoverPositioner className='popover-anim-container'>
<PopoverContent className='popover-visual-box'>
<text>Content</text>
</PopoverContent>
<PopoverArrow />
</PopoverPositioner>
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.
development
# lynx-ui-sortable SKILL `Sortable` is a headless drag-to-reorder list primitive for ReactLynx. It performs reordering on the main thread for smooth, gesture-driven animations and exposes a composable `SortableRoot` / `SortableItem` / `SortableItemArea` API. For massive datasets, prefer `List` or `FeedList`; `Sortable` targets small to medium reorder-able lists. ## 1. Core Capabilities - **Headless Composition**: Three building blocks — `SortableRoot`, `SortableItem`, and (optional) `Sortable
development
# lynx-ui-sheet SKILL ## What It Is `lynx-ui-sheet` is a headless Sheet primitive for ReactLynx. It supports bottom-sheet semantics and side-drawer semantics through the same composition model, state model, drag handling, backdrop, and snap-point APIs. Use it when a UI needs a dismissible panel that slides from an edge of the viewport and may be controlled by refs, external state, snap points, or drag gestures. ## Building Blocks - **`SheetRoot`**: Owns visibility state, side, snap points,
development
# lynx-ui-dialog SKILL `Dialog` is a dialog component, used to display important information or require user interaction, interrupting the current workflow. `lynx-ui-dialog` is a composite component built on `primitives`, offering high flexibility and customizability. ## 1. Core Capabilities - **Composite Component Structure**: Composed of `DialogRoot`, `DialogView`, `DialogBackdrop`, `DialogContent`, `DialogTrigger`, and `DialogClose`, allowing for free assembly of the dialog's structure. -
data-ai
# lynx-ui-list SKILL ## 1. Core Capabilities - **Virtual Scrolling**: **List** and **FeedList** is the **only two** scroll container that can only renders visible items, ensuring smooth scrolling performance even with **massive** amounts of data. If the count of children has more than 10 items, you **MUST** use **List** or **FeedList**. - **Multiple Layouts**: Supports three layout modes: `single` (single-column list), `flow` (multi-column grid layout), and `waterfall` (multi-column waterfall