packages/lynx-ui-dialog/SKILL.md
# 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. -
npx skillsauth add lynx-family/lynx-ui packages/lynx-ui-dialogInstall 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.
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.
DialogRoot, DialogView, DialogBackdrop, DialogContent, DialogTrigger, and DialogClose, allowing for free assembly of the dialog's structure.show + onShowChange) or managing its own state (defaultShow).DialogView can render content into a high-performance native overlay layer via the container prop, preventing the main document from being affected.transition property and CSS classes (ui-entering, ui-leaving).import {
DialogRoot,
DialogView,
DialogBackdrop,
DialogContent,
DialogTrigger,
DialogClose,
} from '@lynx-js/lynx-ui'
function UncontrolledDialog() {
return (
<DialogRoot>
<DialogTrigger>
<button>Open Dialog</button>
</DialogTrigger>
<DialogView>
<DialogBackdrop />
<DialogContent>
<text>This is a dialog.</text>
<DialogClose>
<button>Close</button>
</DialogClose>
</DialogContent>
</DialogView>
</DialogRoot>
)
}
Mode (Controlled/Uncontrolled) + Content and Structure + Interaction Logic (e.g., closing, confirmation)
Example Prompt:
Dialog. Clicking a trigger button opens it, and clicking a close button inside the dialog or the backdrop closes it."Dialog for a confirmation box. It contains a title, content, and two buttons, ‘Cancel’ and ‘Confirm’. The dialog is controlled by a useState variable."Dialog to be a fade-in/fade-out effect."Simple to use, with the component managing its own state.
import { DialogRoot, ... } from '@lynx-js/lynx-ui';
function UncontrolledDialogExample() {
return (
<DialogRoot>
<DialogTrigger>Open</DialogTrigger>
<DialogView>
<DialogBackdrop clickToClose />
<DialogContent>
{/* ... Dialog Content ... */}
<DialogClose>Close</DialogClose>
</DialogContent>
</DialogView>
</DialogRoot>
);
}
Example Path: apps/examples/src/Dialog/Uncontrolled/index.tsx
Suitable for scenarios that require interaction with external business logic, such as confirmation boxes.
import { useState } from '@lynx-js/react';
import { DialogRoot, ... } from '@lynx-js/lynx-ui';
function ControlledConfirmDialog() {
const [isOpen, setIsOpen] = useState(false);
const handleConfirm = () => {
// business logic
setIsOpen(false);
};
return (
<view>
<button onClick={() => setIsOpen(true)}>Delete</button>
<DialogRoot show={isOpen} onShowChange={setIsOpen}>
<DialogView>
<DialogBackdrop />
<DialogContent>
<text>Are you sure?</text>
<DialogClose>Cancel</DialogClose>
<button onClick={handleConfirm}>Confirm</button>
</DialogContent>
</DialogView>
</DialogRoot>
</view>
);
}
Example Path: apps/examples/src/Dialog/Controlled/index.tsx
Q: Why doesn’t the dialog open/close when I set show?
A: In controlled mode, DialogRoot does not mutate state internally. Provide onShowChange and update the external show state in that callback.
Q: The dialog appears but is covered by other elements. How do I make it visible?
A: Use container and overlayLevel on DialogView to render into a higher native overlay layer, for example container="window" overlayLevel={2}.
Q: Can I use show and defaultShow at the same time?
A: No. Choose one mode only. Mixing controlled and uncontrolled props will cause incorrect behavior.
Q: How should I set z-index for the Dialog to avoid stacking issues?
A: Due to DialogView defaulting to position: fixed, and because of stacking context limitations, if you need to set z-index for the Dialog, you should set it on the DialogView layer, at the same level as position: fixed. Otherwise, layer stacking issues may occur.
<DialogView container='window' style={{ zIndex: 2000 }}>
{/* ... */}
</DialogView>
DialogRoot: The root component, manages the open/close state.DialogTrigger: A clickable element to open the Dialog.DialogView: The rendering container for the dialog, can be placed in a native overlay layer.DialogContent: The container for the main content of the Dialog.DialogBackdrop: The background mask layer.DialogClose: A clickable element to close the Dialog.development
Use when the user is building with lynx-ui and needs help selecting components, checking supported props or exports, adapting repo examples, or solving usage problems with curated component references from this workspace.
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
development
# lynx-ui-feed-list SKILL `FeedList` is a high-performance feed stream list component, built upon `List`. It encapsulates common feed scenarios such as **pull-to-refresh** and **load more**, allowing developers to quickly build feed list pages. Note: Use `FeedList` only when you need pull-to-refresh and load-more behaviors. For regular virtual lists without these features, prefer using `List` directly. ## 1. Core Capabilities - **High-Performance Virtual List**: Inherits all the performance
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,