# DesktopOnly

Hydration-safe content gate that no-ops without the NetScript Deno Desktop RPC binding.

[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/islands/DesktopOnly.tsx)

## Live preview

[Open live desktop-only preview](https://rickylabs.github.io/netscript/assets/fresh-ui/preview/?component=desktop-only&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-only
```

## 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 DesktopOnly from '@app/islands/ui/DesktopOnly.tsx';

export function Example() {
  const [value, setValue] = useState('standard');
  const [open, setOpen] = useState(false);
  const [notice, report] = useState('');
  return (<><div><DesktopOnly fallback={<p>Desktop binding unavailable in this browser.</p>}>Desktop content</DesktopOnly></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 |
| --- | --- | --- | --- | --- |
| `DesktopOnlyProps` | `children` | `ComponentChildren` | Yes | Content mounted only after a desktop binding is detected in the webview. |
| `DesktopOnlyProps` | `fallback` | `ComponentChildren` | Yes | Optional browser/Aspire content. Defaults to no rendered output. |
| `DesktopOnlyProps` | `bindingName` | `string` | Yes | Binding name to detect. Defaults to the merged NetScript desktop RPC binding. |

## Keyboard

Presentation component; no component-specific keyboard interactions.

## Tokens

Semantic contract roles: `surface/card`, `text/fg`.

CSS custom properties referenced directly: Composed primitives supply their own tokens.

## Contract and compatibility

Accessibility pattern: noninteractive presentation

- Native DOM attributes pass through where the implementation accepts them.
- Nonvisual conditional wrapper.

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