Skip to main content
NetScriptdocs Search docs ⌘K v0.0.9
Browse documentation

DesktopDialog

Side-effect-free alert, confirm, and prompt intents for a desktop controller.

All components · Theme builder · Implementation source

Live preview

Open live desktop-dialog preview

Native actions require a desktop host. This browser preview shows the shipped surface with host actions disabled.

Install

Shell
netscript ui:add desktop-dialog

Usage and examples

The preview runs this JSX with the installed components. Import any composed primitives from your UI directory.

TypeScript
import { useState } from 'preact/hooks';
import { DesktopDialog } from '@app/components/ui/desktop-dialog.tsx';

export function Example() {
  const [value, setValue] = useState('standard');
  const [open, setOpen] = useState(false);
  const [notice, report] = useState('');
  return (<><div><DesktopDialog disabled message="Delete this order?" /></div><p role="status">{notice}</p></>);
}

Props

Generated from native deno doc --json --private over the shipped implementation. Compound component props retain their owning interface; native attributes pass through where declared.

OwnerPropTypeOptionalDescription
DesktopDialogPropsmessagestringNoDialog message passed to the native controller.
DesktopDialogPropsdefaultValuestringYesInitial prompt value when the prompt action is chosen.
DesktopDialogPropsonRequest(request: DesktopDialogRequest) => voidYesReceives a request; rendering never invokes a native dialog itself.
DesktopDialogPropsdisabledbooleanYesDisable requests when no desktop controller is active.
DesktopDialogPropsclassstringYesAdditional root class name.
TypeScript
type DesktopDialogKind = "alert" | "confirm" | "prompt"

Keyboard

KeyAction
Tab/Shift+TabCycle focus within modal
EscapeDismiss and restore trigger focus

Tokens

Semantic contract roles: accent/default, accent/fg.

CSS custom properties referenced directly: --ns-accent, --ns-accent-fg, --ns-border, --ns-border-width, --ns-card, --ns-card-padding, --ns-control-height-sm, --ns-control-padding-x-sm, --ns-ease-fast, --ns-fg, --ns-focus-ring-offset, --ns-focus-ring-width, --ns-font-sans, --ns-leading-body, --ns-leading-small, --ns-leading-strong, --ns-muted-fg, --ns-primary, --ns-primary-fg, --ns-primary-hover, --ns-primary-stroke, --ns-radius-card, --ns-radius-control, --ns-radius-lg, --ns-radius-md, --ns-ring, --ns-space-1, --ns-space-2, --ns-space-3, --ns-space-4, --ns-stack-gap, --ns-state-disabled-opacity, --ns-state-pressed-opacity, --ns-surface, --ns-text-body, --ns-text-sm, --ns-text-small, --ns-text-strong, --ns-tracking-body, --ns-tracking-small, --ns-tracking-strong, --ns-weight-body, --ns-weight-small, --ns-weight-strong.

Contract and compatibility

Accessibility pattern: WAI-ARIA guidance

  • Native DOM attributes pass through where the implementation accepts them.
  • Compatibility values describe already-shipped headless or Utility state hooks. They are separate from the settled canonical design vocabulary and must be retained by styles serving these public APIs.

Design contract values marked planned are not implementation props. The props above describe what ships today.

Search all documentation

Type a term to search the documentation.