# DesktopTrayMenu

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

[All components](https://rickylabs.github.io/netscript/design-system/components/) · [Theme builder](https://rickylabs.github.io/netscript/create/) · [Implementation source](https://github.com/rickylabs/netscript/blob/main/packages/fresh-ui/registry/components/ui/desktop-tray-menu.tsx)

## Live preview

[Open live desktop-tray-menu preview](https://rickylabs.github.io/netscript/assets/fresh-ui/preview/?component=desktop-tray-menu&theme=studio-utility)

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

## Install

```bash
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.

```tsx
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.

| Owner | Prop | Type | Optional | Description |
| --- | --- | --- | --- | --- |
| `DesktopTrayMenuProps` | `source` | `DesktopTrayMenuSource` | No | Whether these declarations target the tray or application menu. |
| `DesktopTrayMenuProps` | `items` | `[object Object]` | No | Menu declarations accepted by `createDesktopChrome`. |
| `DesktopTrayMenuProps` | `onAction` | `(actionId: string) => void` | Yes | Receives the stable ID of an action declaration. |
| `DesktopTrayMenuProps` | `disabled` | `boolean` | Yes | Disable action declarations while the desktop host is unavailable. |
| `DesktopTrayMenuProps` | `class` | `string` | Yes | Additional 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.
