# Examples

Each example is a full app under `examples/` that CI builds for every target. When an example
builds for the browser, the Web tab runs it in this page. 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/FormalStudio/NativeDesktop/blob/main/examples/hello). Its page on the docs site shows it captured on macOS, Linux and Windows.

### 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/FormalStudio/NativeDesktop/blob/main/examples/notes). Its page on the docs site shows it captured on macOS, Linux and Windows.

### 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/FormalStudio/NativeDesktop/blob/main/examples/gallery). Its page on the docs site shows it captured on macOS, Linux and Windows.

### 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/FormalStudio/NativeDesktop/blob/main/examples/overrides). Its page on the docs site shows it captured on macOS, Linux and Windows.

### 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/FormalStudio/NativeDesktop/blob/main/examples/chrome). Its page on the docs site shows it captured on macOS, Linux and Windows.

### 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/FormalStudio/NativeDesktop/blob/main/examples/native-widget). Its page on the docs site shows it captured on macOS, Linux and Windows.

### 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/FormalStudio/NativeDesktop/blob/main/examples/scroll). Its page on the docs site shows it captured on macOS, Linux and Windows.

### 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/FormalStudio/NativeDesktop/blob/main/examples/overlays). Its page on the docs site shows it captured on macOS, Linux and Windows.

### 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/FormalStudio/NativeDesktop/blob/main/examples/tabs). Its page on the docs site shows it captured on macOS, Linux and Windows.

### 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/FormalStudio/NativeDesktop/blob/main/examples/browser). Its page on the docs site shows it captured on macOS, Linux and Windows.

### 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/FormalStudio/NativeDesktop/blob/main/examples/terminal). Its page on the docs site shows it captured on macOS, Linux and Windows.

### 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/FormalStudio/NativeDesktop/blob/main/examples/system). Its page on the docs site shows it captured on macOS, Linux and Windows.

### 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/FormalStudio/NativeDesktop/blob/main/examples/pacing). Its page on the docs site shows it captured on macOS, Linux and Windows.

### 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/FormalStudio/NativeDesktop/blob/main/examples/discord-rpc). Its page on the docs site shows it captured on macOS, Linux and Windows.

