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

DesktopTrayMenu

Declarative tray and application-menu preview that emits stable action IDs.

All components · Theme builder · Implementation source

Live preview

Open live desktop-tray-menu preview

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

Install

Shell
netscript ui:add desktop-tray-menu

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 { DesktopTrayMenu } from '@app/components/ui/desktop-tray-menu.tsx';

export function Example() {
  const [value, setValue] = useState('standard');
  const [open, setOpen] = useState(false);
  const [notice, report] = useState('');
  return (<><div><DesktopTrayMenu source="tray" disabled items={[{type:"action",id:"open",label:"Open orders"}]} /></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
DesktopTrayMenuPropssourceDesktopTrayMenuSourceNoWhether these declarations target the tray or application menu.
DesktopTrayMenuPropsitems[object Object]NoMenu declarations accepted by `createDesktopChrome`.
DesktopTrayMenuPropsonAction(actionId: string) => voidYesReceives the stable ID of an action declaration.
DesktopTrayMenuPropsdisabledbooleanYesDisable action declarations while the desktop host is unavailable.
DesktopTrayMenuPropsclassstringYesAdditional root class name.
TypeScript
type DesktopTrayMenuItem = { type: "action"; id: string; label: string; accelerator?: string; enabled?: boolean } | { type: "submenu"; label: string; items: [object Object] } | { type: "separator" } | { type: "role"; role: string }
type DesktopTrayMenuSource = "tray" | "application-menu"

Keyboard

No S3 keyboard contract is registered for this item. Native controls retain browser keyboard behavior.

Tokens

No S3 token contract is registered for this item.

CSS custom properties referenced directly: --ns-accent, --ns-border, --ns-border-subtle, --ns-border-width, --ns-control-height-sm, --ns-control-padding-x-sm, --ns-ease-fast, --ns-fg, --ns-focus-ring-offset, --ns-focus-ring-width, --ns-font-eyebrow, --ns-font-mono, --ns-font-sans, --ns-inline-gap, --ns-leading-body, --ns-leading-caption, --ns-leading-label, --ns-muted, --ns-muted-fg, --ns-radius-card, --ns-radius-control, --ns-radius-lg, --ns-radius-md, --ns-ring, --ns-selected, --ns-shadow-md, --ns-space-1, --ns-space-2, --ns-space-3, --ns-space-4, --ns-state-disabled-opacity, --ns-surface, --ns-surface-raised, --ns-text-body, --ns-text-caption, --ns-text-label, --ns-text-sm, --ns-text-xs, --ns-tracking-body, --ns-tracking-caption, --ns-tracking-label, --ns-tracking-wide, --ns-weight-body, --ns-weight-caption, --ns-weight-label.

Contract and compatibility

This registry item ships without an S3 entry. Implementation prop documentation is authoritative.

Search all documentation

Type a term to search the documentation.