# Examples

Each example is a full app under `examples/` that CI builds for every target. The Web tab runs
the example in this page when it builds for the browser; the macOS, Linux and Windows tabs show
what the test harness captured on that OS for the current version of the example.

### Hello

The smallest app: a toolbar button, a count and window controls placed by coordinates.

> **Example: Hello.** Source in [examples/hello](https://github.com/FormalSnake/NativeDesktop/blob/main/examples/hello). Live on the web and captured on macOS, Linux and Windows in the docs app.

### Notes

A multi-file app: source list sidebar, toolbar, a virtual list of notes, an editor, the command palette, gestures and settings.

> **Example: Notes.** Source in [examples/notes](https://github.com/FormalSnake/NativeDesktop/blob/main/examples/notes). Live on the web and captured on macOS, Linux and Windows in the docs app.

### Gallery

One page per built-in component: palette, source list, toasts, banner, forms, tabs, split view, status page, dialogs and media.

> **Example: Gallery.** Source in [examples/gallery](https://github.com/FormalSnake/NativeDesktop/blob/main/examples/gallery). Live on the web and captured on macOS, Linux and Windows in the docs app.

### Overrides

Every override layer in one window: element style, per platform, native mapping, theme (app, window, subtree) and patterns.

> **Example: Overrides.** Source in [examples/overrides](https://github.com/FormalSnake/NativeDesktop/blob/main/examples/overrides). Live on the web and captured on macOS, Linux and Windows in the docs app.

### Chrome

The window structure a Mail-style app declares: scaffold, source list, toolbar, inspector, menu bar, alert, file picker and a settings window.

> **Example: Chrome.** Source in [examples/chrome](https://github.com/FormalSnake/NativeDesktop/blob/main/examples/chrome). Live on the web and captured on macOS, Linux and Windows in the docs app.

### Places

App-defined native widgets: an objc2 MapKit view and a Swift-hosted SwiftUI gauge, each with a drawn fallback.

> **Example: Places.** Source in [examples/native-widget](https://github.com/FormalSnake/NativeDesktop/blob/main/examples/native-widget). Live on the web and captured on macOS, Linux and Windows in the docs app.

### Scroll

A virtualized list of 100 000 rows with heights from 28 to 124 points, the list `nd diag scroll` measures.

> **Example: Scroll.** Source in [examples/scroll](https://github.com/FormalSnake/NativeDesktop/blob/main/examples/scroll). Live on the web and captured on macOS, Linux and Windows in the docs app.

### Overlays

A popover, a modal panel and a context menu over a native button and a live web page, none of them leaking input.

> **Example: Overlays.** Source in [examples/overlays](https://github.com/FormalSnake/NativeDesktop/blob/main/examples/overlays). Live on the web and captured on macOS, Linux and Windows in the docs app.

### Tabs

Browser-style window tabs: every tab is a window of one tab group, with the system tab bar on macOS.

> **Example: Tabs.** Source in [examples/tabs](https://github.com/FormalSnake/NativeDesktop/blob/main/examples/tabs). Live on the web and captured on macOS, Linux and Windows in the docs app.

### Browser

A small browser: tabs in the sidebar, an address field in the toolbar, devtools and downloads, on WKWebView or CEF.

> **Example: Browser.** Source in [examples/browser](https://github.com/FormalSnake/NativeDesktop/blob/main/examples/browser). Live on the web and captured on macOS, Linux and Windows in the docs app.

### Terminal

A terminal with tabs over libghostty-vt: one shell per tab, titled by what the shell reports.

> **Example: Terminal.** Source in [examples/terminal](https://github.com/FormalSnake/NativeDesktop/blob/main/examples/terminal). Live on the web and captured on macOS, Linux and Windows in the docs app.

### System

Every nd::system service behind a button: dialogs, clipboard, notifications, keychain, tray, media keys and audio with a spectrum.

> **Example: System.** Source in [examples/system](https://github.com/FormalSnake/NativeDesktop/blob/main/examples/system). Live on the web and captured on macOS, Linux and Windows in the docs app.

### Pacing

Two windows animating every frame, each at the refresh rate of the display it is on.

> **Example: Pacing.** Source in [examples/pacing](https://github.com/FormalSnake/NativeDesktop/blob/main/examples/pacing). Live on the web and captured on macOS, Linux and Windows in the docs app.

### Discord presence

Discord Rich Presence as a plugin, written against nd-plugin and nd-ipc the way an outside crate would be.

> **Example: Discord presence.** Source in [examples/discord-rpc](https://github.com/FormalSnake/NativeDesktop/blob/main/examples/discord-rpc). Live on the web and captured on macOS, Linux and Windows in the docs app.

