Documentation
Start with the Guides to build an application in Rust, check the Platform guides when configuring or packaging a specific OS, and use Reference when looking up exact DSL syntax, component properties, or platform capability coverage.
Quick directory by task
| Task | Where to read |
|---|---|
| Build your first Bern app from scratch | Quick start |
| Define state, commands, queries, and errors in Rust | Protocol and engine |
| Build responsive layouts, navigation, modals, and TV/Watch views | Layouts and navigation |
Add translations (tr!), themes, and custom styles (style!) |
Localization and styling |
| Manage multi-window apps, icons, tray items, files, and media | Windows, resources, and files |
| Automate, screenshot, and drive your app via CLI & AI Skills | App CLI and Skills |
| Eject to standalone native IDE projects with zero Bern lock-in | Ejecting to standalone native projects |
| Set up toolchains, debug, sign, and package for a target OS | Platform guides |
| Look up exact component properties or platform feature flags | Reference |
| Understand the compiler pipeline and framework invariants | Architecture overview |
Overview
- Architecture overview — Core compiler pipeline (
#[bern::protocol]/ui!→ IR → native targets), engine boundary, and framework invariants.
Guides
- Quick start — Install
bern, scaffold a project withbern new, understand the 3-crate layout, and run thecheck/run/packageloop. - Protocol and engine —
#[bern::protocol],#[bern::session],#[bern::value],Query, background tasks, storage, and secrets. - Layouts and navigation —
Adaptivesize classes (compact,medium,expanded,tv,watch),SplitView,TabView,Modal,Dialog,Shortcut, anddefault_focus. - Localization and styling —
tr!,strings/*.toml, plural/date formatting, semantic colors,style!, and runtime light/dark or palette switching. - Windows, resources, and files — Multi-window scenes,
MenuBar,StatusItem,[app.icon],[[app.opens]], file picking, andMediaSource/Video. - App CLI and Skills — Using the generated app CLI, IPC targeting,
window screenshot,ui.*commands, and auto-generatedSKILL.mdfiles.
Platforms
Operational manuals covering prerequisites, Bern.toml configuration, building/debugging, platform adaptations, and signing/packaging:
- macOS — SwiftUI + AppKit (
.app,.dmg, notarization) - iOS & iPadOS — SwiftUI + UIKit, dual frontends (
swiftui+swiftui-16), simulator &.ipa - watchOS — Watch-Only SwiftUI,
Layout(size: watch)(B401),.ipa - tvOS — Apple TV SwiftUI, Siri Remote focus, Top Shelf icons,
.ipa - Windows — C++/WinRT dual frontends (WinUI 3 + XAML Islands), Direct2D installer &
.zip - Linux — GTK 4 + libadwaita, StatusNotifierItem,
.deb&.tar.gz - Android & Wear OS — Jetpack Compose Material 3 & Wear Compose, SAF,
.apk&.aab - GPUI — Optional unified GPU-rendered desktop backend (
ui = "gpui") - Web — Standalone WASM App (
web_mode = "app"), native-backed WebUI (web_mode = "ui"), and embeddedweb_ui
Topics
- Ejecting to standalone native projects —
bern ejectemits standalone.xcodeproj, Gradle, Visual Studio.sln/.vcxproj, Cargo, and zero-bundler ES module projects (--engine sourceor--engine prebuilt). - Native views — Co-located per-platform native views (
NativeView) with typed props,tr!checks, CLI entries, andFallback. - JavaScript and
bern.cli— Opt-in in-process JavaScript (bern::script),bern.cli(...), and host-sideCliPolicyrules. - Animated SVG — Build-time
BSVGbytecode compilation and pure-Rust animation playback across all targets. - Module builds — Splitting features into independent modules (
bern new --module,--exclude-module). - Web extensions — Integrating custom JS/WASM browser extensions with
web_extension.
Reference
- UI declaration reference —
ui!syntax, expressions, navigation, formatting, motion, and automatic skeleton screens. - Component property table — Exhaustive property, child, and action reference for every built-in component.
- Platform capabilities and verification scope — Feature-flag support matrix across targets and current verification notes.
- Performance tracing —
BERN_TRACE,bern run --trace,trace.*CLI commands, and timeline output format.
Update rules
- Whenever a component, property, target option, or
Bern.tomlkey changes, update the matching guide, platform manual, and Reference page in the same change. - Keep
Docs/andDocs/zh-CN/synchronized 1-to-1 in structure (headings, code blocks, and tables) and verify withcargo test -p bern --test docs. - Keep operational guides grounded in current framework behavior rather than historical design plans or private app names.