Introducing The Sweep: OX’s New Live Security Research Series
Register Now
Breaking: The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?
Read the Report
Are you exposed? Connect your apps in minutes.
Scan your apps free

@x-dialog/react

Latest version: v0.2.0

Overview

Last scanned
28 Nov 2026
Published
28 Nov 2026
npm package Publisher: abdenourtadjer33
0 Stars
0 Forks
1 Versions
209 Downloads
TypeScript Repo language

Scan summary

@x-dialog/react was last scanned on 28 Nov 2026 at version 0.2.0. Risk score 0 of 100. No malicious behavior was detected.

  • Releases: First and only release on 28 Nov 2026.
  • Findings: No rules fired in version 0.2.0.
  • Downloads: 209 downloads.

Versions

1 version published
Versions and the rules that fired in each
VersionPublishedStatus
0.2.0 LATEST 28 Nov 2026 No rules fired

No rules fired in 0.2.0

Findings

Findings for v0.2.0. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.

The score describes 0.2.0; other versions have their own rules, not their own score.

README

The publisher’s own README, as collected from the registry.

x-dialog

Dialogs you can await. Declare a dialog once, open it from anywhere, get a typed result back. Drag, maximize, stack and guard them. Rendered with the shadcn primitives you already use — Radix or Base UI.

npm CI bundle size license

Live demo · Docs · Recipes · For AI agents

const { open } = useDialogs()

const name = await open(renameDialog, { name: file.name })
//    ^? string | null
if (name === null) return // dismissed

await rename(file, name)

No isOpen state. No onConfirm callbacks threaded through three components. No dialog registry to keep in sync. The call site reads top to bottom, and the compiler checks the payload and types the result.

Contents

  • Why
  • Install
  • Quick start
  • What you get
  • How it works
  • API at a glance
  • For AI agents
  • FAQ

Why

The usual dialog lives in the component that renders it: a useState for open, another for the draft value, an onConfirm prop, and a useEffect to reset it. Asking the user one question costs you a component's worth of plumbing, and the answer arrives in a callback far from the code that asked.

x-dialog turns the question into a function call:

const [open, setOpen] = useState(false)
const [target, setTarget] = useState<File>()

<Button onClick={() => {
  setTarget(file)
  setOpen(true)
}} />

<RenameDialog
  open={open}
  onOpenChange={setOpen}
  file={target}
  onConfirm={(name) => {
    rename(target!, name)
    setOpen(false)
  }}
/>
const { open } = useDialogs()

<Button onClick={async () => {
  const name = await open(renameDialog, {
    name: file.name,
  })
  if (name) rename(file, name)
}} />

It has been used in production across several apps before being extracted into this package.

Install

x-dialog has two halves, installed together with one command:

  • @x-dialog/react from npm: the engine (stack, promises, guards, geometry, types). You update it like any dependency.
  • components/ui/x-dialog.tsx from the shadcn registry: the frame (markup and Tailwind classes). It's your file to restyle.
npx shadcn@latest add @x-dialog/x-dialog

The CLI reads your components.json and installs the frame for your primitive (Radix or Base UI), along with @x-dialog/react, the primitive and lucide-react.

The @x-dialog namespace is being added to the shadcn registry directory. Until your CLI knows it, register it once per project, then run the command above:

npx shadcn@latest registry add "@x-dialog=https://abdenourtadjer33.github.io/x-dialog/r/{style}/{name}.json"

Or pick the frame explicitly, with no setup at all:

npx shadcn@latest add AbdenourTadjer33/x-dialog/x-dialog-radix   # Radix
npx shadcn@latest add AbdenourTadjer33/x-dialog/x-dialog-base    # Base UI

Requirements: React 18 or 19, Tailwind CSS v4, and a shadcn project (components.json) on Radix or Base UI. React Aria isn't supported yet.

Quick start

1. Mount the provider once, near the root and inside your other providers, so dialogs can use them:

import { DialogProvider } from "@/components/ui/x-dialog"

export function Providers({ children }: { children: React.ReactNode }) {
  return <DialogProvider>{children}</DialogProvider>
}

2. Declare a dialog. A surface is a plain component. The definition is the handle:

import {
  Dialog,
  defineDialog,
  type DialogProps,
} from "@/components/ui/x-dialog"

function RenameSurface({
  payload,
  resolve,
  dismiss,
}: DialogProps<{ name: string }, string>) {
  const [name, setName] = useState(payload.name)

  return (
    <form
      className="contents"
      onSubmit={(e) => {
        e.preventDefault()
        resolve(name)
      }}
    >
      <Dialog.Body>
        <Input
          data-autofocus
          value={name}
          onChange={(e) => setName(e.target.value)}
        />
      </Dialog.Body>
      <Dialog.Footer>
        <Button type="button" variant="outline" onClick={dismiss}>
          Cancel
        </Button>
        <Button type="submit">Rename</Button>
      </Dialog.Footer>
    </form>
  )
}

export const renameDialog = defineDialog<{ name: string }, string>({
  kind: "rename",
  title: (payload) => `Rename ${payload.name}`,
  width: "sm",
  component: RenameSurface,
})

3. Await it anywhere under the provider:

const { open } = useDialogs()
const name = await open(renameDialog, { name: "roadmap.md" }) // string | null

What you get

  • Typed end to end. The payload is checked at the call site, the result is inferred, and dismissal is always null.
  • Stacking. Await a dialog from inside a dialog. The stack is last-in-first-out, and Escape and outside clicks only reach the top one.
  • Close guards. useDialogCloseGuard runs on Escape, outside click and the close button, so there's no way to close around it. Guards can be async and can open another dialog to ask. Repeated close requests while a guard is deciding run it only once.
  • Window chrome. Drag by the titlebar (or with the arrow keys), double-click to maximize, and get restored to exactly where you left it. Dragging writes a CSS transform directly and never re-renders React.
  • Working surfaces. Dialog.Toolbar, a scrolling Dialog.Body, a pinned Dialog.Footer, and Dialog.TitlebarActions for your own titlebar buttons. Width and height presets.
  • Accessible. Real Radix or Base UI dialogs: focus trap, aria-modal, title and description wired, focus returned to whatever opened the dialog. Initial focus goes to [data-autofocus] or the first field.
  • Exit animations that don't delay the result: the promise settles immediately, and the frame stays mounted until its animation finishes.
  • Never stranded. Unmounting the provider settles every pending promise with null. A guard that throws keeps the dialog open and reports the error. React StrictMode is safe.
  • Toasts don't close dialogs. Clicking a sonner toast, or anything marked data-dialog-ignore-outside, doesn't count as an outside click.
  • Small. The engine has no dependencies beyond React and ships ESM, CJS, types and a "use client" directive for Next.js.

How it works

The split follows the shadcn model for libraries with real logic, such as cmdk with command.tsx or vaul with drawer.tsx:

@x-dialog/react components/ui/x-dialog.tsx
Ships as npm package, versioned shadcn registry item, copied into your project
Contains Stack, promise settling, close guards, drag/maximize geometry, types Overlay, titlebar, slots, size classes, icons, labels
You Update it Own it, restyle it
Depends on React The engine + Radix or Base UI + lucide-react

The frame is about 300 lines that call one hook, useDialogFrame(). To render dialogs some other way, such as a different primitive or a sheet on mobile, write your own frame. See Custom frames.

API at a glance

Export What it does
defineDialog<Payload, Result>(definition) Declares a dialog. Returns the handle you pass to open.
<DialogProvider> Mount once. Props: defaults, labels, exitDuration, baseZIndex, onCloseGuardError.
useDialogs() { open, dismissAll, resolve, dismiss, requestClose, … }. Never changes identity.
useDialog() Inside a surface: { id, kind, maximized, isTopmost, requestClose, toggleMaximize }.
useDialogCloseGuard(guard) Inside a surface: return false to stay open.
useDialogStack() The open stack, for things like "is any dialog open".
Dialog.Body / .Footer / .Toolbar / .TitlebarActions Layout slots for a surface.
DialogProps<Payload, Result> Props of a surface: { payload, resolve, dismiss }.
DialogResult<typeof d> / DialogPayload<typeof d> Extract a definition's types.

Definition options: kind, title, description, icon, width (sm…5xl, full), height (auto, tall, full), closeOnEscape, closeOnOutsideClick, maximizable, draggable, component. Set app-wide values for the layout and close options once with <DialogProvider defaults={{ maximizable: false, draggable: false }}>; a definition that sets an option still wins.

→ Full reference: docs/api.md · Patterns: docs/recipes.md

For AI agents

x-dialog is designed to be easy for coding agents to get right. A dialog is one definition plus one surface, everything comes from one import path, and a wrong payload is a compile error that names the field.

  • Agent Skill: npx shadcn@latest add @x-dialog/x-dialog-skill installs .claude/skills/x-dialog/SKILL.md. It teaches Claude Code (and any agent that reads skills) the patterns and the ten rules that keep dialogs typed and accessible.
  • llms.txt: the whole API on one page, written for models. It's also served by the demo site.
  • AGENTS.md: for agents working on this repository.

FAQ

Use it when the dialog is a fixed part of a screen with a trigger right next to it. x-dialog is for dialogs that are questions: confirmations, prompts, pickers and editors opened from code, from anywhere, that return an answer. Both can live in the same app. x-dialog's slots are namespaced (Dialog.Footer) so they never clash with shadcn's DialogFooter.

Not yet, on purpose. open() comes from useDialogs(), so every dialog renders inside your providers (router, query client, theme, i18n). A module-level entry point is a design decision, and an issue is the place to argue for one.

null, like every other dismissal. No caller ever waits forever.

Yes. The engine and the frame are client components ("use client"). Mount <DialogProvider> in a client providers file, and open dialogs from client components.

<DialogProvider labels={{ maximize: "…", restore: "…", close: "…" }}>. Titles and descriptions are yours already.

Render them inside <DialogProvider exitDuration={0}> and query frames with [data-dialog] / [data-kind="…"]. See Testing.

Contributing

Issues and pull requests are welcome. CONTRIBUTING.md covers the setup (one pnpm install) and the checks a change has to pass.

License

MIT © Abdenour Tadjer

OX Radar and Response Center

Find threats in your stack.

OX Radar can check high-priority threats, like critical package CVEs, against your context.

Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.

Where it’s listed

The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).

  • npm @x-dialog/react

References

The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.

Powered by Read the latest findings

Scan your whole stack

Group 1261154050 1
Group 1261154050
 

From OX Research Newsroom

Critical Apache HTTP Server Flaw Exposes Web Servers to RCE (1)
CVE

CVE-2026-119618: Critical Apache HTTP Server Flaw Exposes Web Servers to Remote Code Execution

CVE

Java4Shell (CVE-2026-114938): Easy to Crash, Hard to Exploit — Less Than 0.12% of JVMs Estimated at Risk of RCE

Copy of Template Design OX Blog (3)
Research

Ruby2Shell: Ruby Memory Corruption Flaws Expose Applications to Remote Code Execution, But is it an Actual Risk?

Frame 2085668439 (1)
Group 1261154229