Current component usage
Updated: 2026-11-21. This document describes the interfaces that can be declared today; for the complete properties, required items, child nodes and action rules see the component property table, and for what each backend accepts see the platform capability table. Complete buildable projects are in examples/hello, examples/showcase, examples/planner, examples/gallery, examples/native-controls, examples/wearos and examples/svg-animation; the snippets below omit the enclosing component, protocol and state definitions.
Declarations and data sources
Declare the tree with ui! inside a #[component] function. Static user-visible text uses tr!, engine state is read-only, draft session fields can be updated by standard controls, and business changes run through typed commands bound with =>. id is the stable identity for control entry points, and label also serves as the accessible name. label_hidden: true hides the visible text, but a label must still be given; the controls that currently support it are TextInput, Switch, Slider and Picker.
Lengths usually use logical units; Length accepts a number or a restricted numeric expression. Number accepts only static numbers, and Flag accepts only build-time booleans. Conditions, lists and state references are still checked by the compiler; component features a target does not support are rejected by the capability check, and platform coverage cannot be judged from the component name alone.
Text, content and formatting
Every piece of text in the interface is either text declared with tr! or data declared as content, and the two are told apart at compile time:
- Text fields of protocol and UI types and text parameters of components are marked
#[content], meaning they are data (titles, file names, notes the user wrote). Only such text can be shown directly (Text(content: app.title)) or embedded in a sentence as atr!argument ({title}). Showing unmarked text, or writing a literal as atr!argument, reports B105: fixed words go into the translation. Session fields are entered by the user and count as content. - The engine does not assemble sentences. It gives numbers,
CalendarDatevalues and enums, and the interface writes them in the reader's language withtr!or labeled enums.
#[value]
pub enum Notice {
#[label(tr! { "zh-Hans" => "已收藏 {name}", "en" => "{name} is a favorite" })]
Favorite {
#[content]
name: String,
},
#[label(tr! { "zh-Hans" => "{n} 个文件", "en" => "{n, plural, one {# file} other {# files}}" })]
Files { n: i64 },
}
#[component]
pub fn heading(#[content] title: String) -> impl View {
ui! { Text(content: title, style: headline) }
}tr! and enum labels use the same message format (a subset of ICU MessageFormat), which every backend writes out with the same semantics in the session's current language:
| Syntax | Writes out | Arguments |
|---|---|---|
{name} |
Text as is, numbers in Bern's notation, enums as their label | #[content] text, integers, decimals, labeled enums |
{n, plural, =0 {…} one {# 项} other {# 项}} |
Picks the branch by the number's plural category in that language, with exact =N matches taking precedence; # in a branch is the number |
Integers, decimals |
{d, date, EEE, MMM d} |
Date: y/yy year, M/MM month, MMM/MMMM month name, d/dd day, EEE/EEEE weekday; other characters as is |
CalendarDate |
{t, duration, m:ss} |
Seconds: h, m, s, doubled letters pad with zeros; the largest unit written holds the larger parts (under m:ss, 125 seconds is 2:05 and 3725 seconds is 62:05) |
Integers, decimals |
{{and}}are literal braces; inside a plural branch}always ends the branch.- Each language must write out the plural categories it uses: Chinese, Japanese, Korean and the like have only
other, while English and others needoneandother; a missing branch reports B104. A mismatched argument type (text for a plural, a number for a date, a date written directly as{d}) also reports B104. - The placeholders of an enum label are that variant's fields; do not write
; name: value. Text fields must be#[content]; the type of an enum field must have a label on every variant. - Month and weekday names are framework text, built in for Simplified Chinese, Traditional Chinese, English and Japanese; other languages use English.
CalendarDate { year, month, day }is inbern::preludeand represents only a date, without time of day or time zone.Text(content: date)is rejected; the format must be written out withtr!.- These formats and the labels of displayed fields are implemented by SwiftUI, the Web, GTK, Compose and WinUI 3 (target feature
text_formats): each backend's runtime parses translated text by the same format, and plural branches, dates and durations are written out in the current language.
Description text in data (a plugin's introduction, a changelog) often carries inline Markdown. Text(markdown: true) shows **bold**, *italic*, `code`, ~~strikethrough~~ and [link](url) in the platform's style, and a backslash makes the next marker show literally; it recognizes only inline markup, and headings, lists, quotes, code blocks and tables are split into blocks by the app, each shown with a suitable component. Code blocks use style: code, the platform's monospaced font:
Column(gap: 10) {
Text(content: plugin.summary, markdown: true)
Text(content: plugin.install_command, style: code)
}Windows currently strips the markup and shows only the text; for the other targets' implementations see the property table.
Coordinate scenes and scrolling content
ScaleBox(width:, height:) defines a fixed logical canvas that is scaled proportionally and centered within the available area the parent container gives, keeping the whole canvas visible. The parent container must provide an available width and height. Positioned(x:, y:, width:, height:) positions a layer from the top-left corner of the scene, and coordinates may be negative; position and size can be bound to state and change smoothly together with animate. Content outside the ScaleBox is clipped.
When the area and the canvas have different aspect ratios, blank space is left on both sides of the canvas (or above and below it). A Positioned(bleed: true) layer keeps extending past every canvas edge it reaches, filling out to the edges of the ScaleBox: write backgrounds and window-filling pictures as layers that reach the canvas edges and carry bleed, and wide windows get no black bars; when the canvas is shown at its design size there is no blank space, exactly the same as without bleed. bleed can be bound to a boolean expression (for example extending only while the picture fills the window); the extended edges move in and out with the layer's animate motion and follow window size changes immediately. It only takes effect on layers in a ScaleBox scene; a Positioned inside a layer uses its own coordinates and does not extend further. Implemented by: Web, SwiftUI (macOS, iOS, tvOS), Compose, GTK and WinUI 3.
WindowButtons takes up the space that the window's own buttons occupy at edge (default leading) of content that extends under the title bar: at leading, macOS traffic lights and the spacing after them take 84 points in total; at trailing, Windows reserves the native caption-button width (RightInset); on platforms or edges without buttons there, it takes no space and produces no spacing in its row.
ScaleBox(width: 1280, height: 720) {
Positioned(x: 0, y: 0, width: 1280, height: 720) {
Image(source: app.poster, width: 1280, height: 720, fit: cover)
}
Positioned(x: 48, y: 40, width: 1184, height: 32) {
Marquee(duration: 12, phase: 0.25, paused: app.paused, opacity: 0.8) {
Text(content: app.message, font_size: 24)
}
}
}The duration of Marquee is the number of seconds one pass takes to cross the content area from right to left, and the current runtime uses at least 1 second; phase is the starting fraction of the cycle, recommended 0–1, default 0. paused defaults to false, and opacity defaults to 1 and is clamped to 0–1. The clock is managed by the presentation layer and can resume after pausing; under Reduce Motion the content is presented statically. It only expresses looping scrolling content and provides no per-frame callbacks, video clock synchronization or danmaku scheduling engine.
These three components are provided by the scaled_scene capability, declared across SwiftUI, Web, Compose, GTK, WinUI 3 and GPUI (see Platform capabilities for verification scope). SwiftUI applies one overall scale; the Web updates the scale through a ResizeObserver and stops observing on unmount.
Control containers and sizes
ControlGroup(height: 40) puts controls with related functions into one shared capsule, keeping each child control's own clicks, menus and popovers. The height defaults to 40; label is optional, the Web uses it as the group's accessible name, and SwiftUI currently keeps the child controls' accessible names. SwiftUI uses interactive Liquid Glass from macOS / iOS 26 on and a system material capsule on older systems; the Web uses its own capsule style.
ControlGroup(height: 40) {
IconButton(id: subtitles, icon: "captions.bubble",
label: tr! { "zh-Hans" => "字幕", "en" => "Subtitles" }) => app.toggle_subtitles()
IconButton(id: fullscreen, icon: "arrow.up.left.and.arrow.down.right",
label: tr! { "zh-Hans" => "全屏", "en" => "Fullscreen" }) => app.toggle_fullscreen()
}Standalone controls can declare a container and its height with shape: capsule and height on Button, Menu, Picker, Switch and SplitButton. The web has no capsule-shaped buttons: on the web they are standard controls with the standard height and an 8-point corner radius. Button and Switch(style: button) also have shape: chip, which makes them a chip: on the web an outlined pill (30 high, inverted when selected or with prominence: prominent), on other platforms a 30-point-high capsule, or the written height when height is given. Adjacent menus use a consistent shape / height, and related actions can share a ControlGroup; the shape itself does not change the command's semantics. IconButton(prominence: plain) is for standalone buttons that need a plain icon, and font_size adjusts the icon size; it does not replace the container height. prominence: prominent expresses an emphasized button.
A back entry with an icon and text uses one Button(icon:, label:), which lays out and hit-tests the two as one control. Container size belongs to the declaration; content overflow cannot be avoided by removing the container. The default appearance of ordinary controls is still decided by the target platform.
Engine-controlled controls
| Control | Session draft source | Engine snapshot source | Value the command receives |
|---|---|---|---|
| Switch | value: draft.enabled |
checked: app.enabled |
The boolean the user just chose |
| Picker | value: draft.appearance |
selected: app.appearance |
The enum value the user just chose |
| Slider | value: draft.volume |
current: app.volume |
The number the user committed |
| ColorPicker | value: draft.color |
current: app.color |
The 24-bit sRGB color (0xRRGGBB) the user chose |
| TextInput | value: draft.name |
current: app.name |
The whole text the user just changed it to |
Each control can choose only one column as its source; it cannot write both or neither. An engine source must provide an action; in the action's arguments, an expression identical to checked / selected / current is replaced with the user's new value, while its subexpressions and other arguments are not replaced. The enum variants of a Picker must have labels.
Slider(id: volume,
label: tr! { "zh-Hans" => "音量", "en" => "Volume" },
label_hidden: true, current: app.volume, min: 0, max: 1, step: 0.01
) => app.set_volume(app.volume)A controlled TextInput runs its action on every edit, without waiting for Enter: use it for fields that save as you type, such as renaming and filter conditions. While the field has focus, the user's text stays in the box, and the engine's response does not move the cursor away or swallow what was just typed; once focus leaves, the engine's text is shown. With value:, the action runs on submit.
TextInput(id: rename, label: tr! { "zh-Hans" => "名称", "en" => "Name" }, current: app.opened_name) => app.rename(app.opened, app.opened_name)A controlled Slider shows a local preview while dragging by default and commits when the drag ends; current: together with continuous: true commits during the drag (for immediate settings such as volume, opacity and font size), coalesced to at most 30 times per second on Apple platforms, with the last value committed immediately on release; engine snapshots do not take back the slider position during an edit. PickerOption(value:, label:) declares options explicitly and can insert live counts into the label. Controlled values are supported by SwiftUI and the Web through controlled_values, and explicit options are additionally checked under modal_flow_timer.
Picker(style: chips) has one chip per option, with the selected one emphasized: on Apple platforms they are system glass capsule buttons (the design's 30-point chip, the selected one in the theme color, a material capsule before 26), on Compose Material FilterChip, on WinUI 3 ToggleButton, on GTK GtkToggleButtons in one group, and on the Web outlined pill buttons (the selected one inverted). When it has no visible label (label_hidden: true) and sits directly in a Flow, each chip is a child of that Flow and they wrap one by one when it is narrow; elsewhere they wrap within their own row. Below is a toolbar: the segmented control on the left, the chips on the right, and chips that do not fit wrap to the next line.
Flow(gap: 10) {
Picker(id: tab, label: tr! { "zh-Hans" => "插件", "en" => "Plugins" }, selected: app.tab, style: segmented, label_hidden: true) => app.set_tab(app.tab)
Spacer
Picker(id: category, label: tr! { "zh-Hans" => "分类", "en" => "Category" }, selected: app.category, style: chips, label_hidden: true) => app.set_category(app.category)
}Images, typography and shared elements
| Declaration | Purpose and limits |
|---|---|
Image(aspect: 0.6666666667, fit: cover) |
Keeps 2:3 as the container width changes, so the frame does not jump before and after loading; the ratio must be positive |
Image(corner:) |
Clips the image to rounded corners and can be bound to a length; a named corner radius from style! also works, for example corner: poster |
Image(rendering: template) |
Renders a template image in the current foreground color; original color images use original |
Image(...) { placeholder } |
Optional single placeholder child shown while an image is loading, with a smooth fade-in once the picture is ready; wrap multiple placeholder views in Stack, Column or Row |
Grid(row_gap:) |
Sets the row spacing separately; when omitted, gap is used |
Grid(min_width: 300, gap: 12, masonry: true) |
Masonry layout: cards of different heights each keep their own height and go into the currently shortest column; GTK and Windows lay them out row by row as an ordinary grid |
Row { Text(…) Spacer Switch(…) } |
The leading text takes the place of the Spacer and wraps within the remaining width, while the switch keeps its own width, like a row in the system settings; SwiftUI and Compose lay it out this way |
Text(font_size:, lines:) |
The font size can be bound to a length, and lines sets the maximum number of lines; a dynamic font size requires scaled_scene |
Row(align: baseline) |
Aligns by the baseline of the first line of text |
padding_x / padding_y |
Set horizontal and vertical padding separately on the layout containers that support them; see the property table |
Shared elements use hero: poster, hero_key: item.id: the static hero name distinguishes the purpose, and the dynamic key distinguishes the specific item. Both ends must be in the same window with matching keys; do not keep several visible elements with the same key at once. hero_key does not replace the stable key of ForEach.
On macOS, Image uses a pixel overlay above the window, and the Web uses a copy of the image in viewport coordinates, handling coordinate changes across the sidebar and ScaleBox; the temporary picture accepts no clicks, does not enter the accessibility tree, and does not fly under Reduce Motion. macOS / Web have passed acceptance for an image expanding from the stage, shrinking into the sidebar and restoring. Other views on iOS and macOS still use matched geometry; passing Video's continuous picture across split-view columns was outside the scope of this image acceptance.
Same-window onboarding, sidebar and search
SwiftUI targets can set the split-view background colors in style! with Sidebar { background: color(light: "#FAFAFA", dark: "#171717") } and Detail { background: color(light: "#F2F2F2", dark: "#1E1E1E") }, adding #[target(macos, ios, tvos)] to the rules. The background is drawn directly on the native split view and extends behind the window bar, while the content still respects the title bar's safe area, with no need for an extra Stack wrapper. The system background of the sidebar list is hidden, and the top and bottom bars use the same background.
| Interface | Current semantics |
|---|---|
WebPage(url:, cookies_file:, cookie_domain:, user_agent:, content_mode:, close_on:, label:) => action |
A page of the web filling its place, in a session of its own that goes with it. A press on what the CSS selector close_on finds runs the action, before the page's own handlers: a page made for another app's web view can close with its own button. Schemes other than the web's are not followed. cookies_file names a file holding name=value; name=value, read when it appears and set on cookie_domain: sign-in cookies stay out of the state, where the command line could read them. A browser cannot set them on another site's frame. Not available on tvOS, which has no web engine. content_mode: auto (the default) keeps the engine’s recommended browsing environment; mobile and desktop request the corresponding mode. iOS uses WebKit’s native mode, which changes the web-visible platform and layout behavior as well as the UA; an explicit user_agent is preserved. Other targets currently warn at build time and keep their engine’s default mode, rather than emulate it with a UA or script. |
Modal(width:, height:) |
A centered in-window panel whose size is constrained by the available window area, with a background scrim; the body can scroll and the footer can be placed separately. Without height it is as tall as its content: the body's ScrollView takes the height of the content it scrolls, and when that exceeds the window the panel stops at the window edge and the body scrolls. The background subtree is disabled with Stack(enabled: false) |
Flow(gap:) |
Wraps from left to right by the content's intrinsic size; the children in each row are centered vertically, and a Spacer takes no width when wrapping and, once laid out, fills the rest of its row |
Timer(interval:, enabled:) => command() |
Submits the command periodically while mounted and enabled; cancelled when unmounted or disabled; the interval is in seconds. It cannot be used to drive per-frame drawing |
Watch(value:) => command() |
Runs the action once when mounted, then once each time the value changes; an equal new value does not count as a change. Use it to tell the engine about drafts that live only in the interface: the selected rows of a table, the page selected in the sidebar, the text of a search box. The value is a boolean, number, text or enum, or an optional or list of them. Written inside an if, it runs once at the moment the condition becomes true |
Text(color:) |
Draws text in the accent color or a status color: accent, status.success, status.warning, status.error, each platform using its own text colors; mutually exclusive with emphasis. mark is shading under the text and does not change the text color |
Accordion(count:, selected:, collapsed_width:, height:, gap:, corner:) |
One column is expanded and the others keep a fixed collapsed width; selected starts at 0, and animate drives the column widths and positions; height can be omitted, in which case it fills the remaining height of the parent layout and should be placed in a container with a height constraint (such as a Column in a window) |
Sidebar(width:) |
Fixed column width. SidebarHeader is pinned above the list and SidebarFooter below it. SidebarHeader(role: title) means the header only names the window with the app's icon and name: platforms whose title bar already shows the app name (both Windows frontends and Linux GTK) do not show it, and other platforms show it as usual. On iOS and tvOS a title header replaces the automatic sidebar navigation title; content headers keep that title |
DetailFooter |
Directly inside Detail, at most one; pins content (such as a status or playback bar) to the bottom of the detail column while Navigation pushes destinations above it. Put conditions inside DetailFooter when the bar is shown only in some states |
SidebarItem(badge:) |
Shows a positive count; the badge in a module's page list can be bound to a module state field |
Search(style: palette) |
Opens a command palette from a toolbar entry; panel_prompt, width and height set the prompt and the panel size |
SearchItem(id:, label:) => command() |
A panel result, which can carry an icon, detail, hint or custom child content; navigation: false excludes it from arrow-key selection, while it can still be clicked and focused with Tab |
The search panel supports arrow keys, Enter, Esc, outside clicks and focus restoration after closing, and is currently available only on macOS and the Web. The other extensions in the table are provided by SwiftUI and the Web; the app's layout and platform choices must still pass the target capability check.
Motion and the idle state
appear/disappearcontrol structural changes;animatecontrols supported length changes, andreflowmakes neighboring elements give way. Motion names come fromstyle!.corner { card: 22 }instyle!gives a corner radius a name, and#[target(windows)] corner { card: 8 }gives that platform its own value; style rules, thecornerofImage/Video/Shape/Accordionand theifexpressions in it can all use the name, which is replaced with the target platform's value at build time.grow(edge: bottom, bouncy)expands with one edge fixed;appear_delaymust go with appear, the delay is non-negative and can be added to stagger. Ordinary state updates do not replay the entrance, and unmounting cancels the wait.nudgeresponds to a boolean trigger;nudge_keylets different event values trigger the hint,nudge_scalesets the amplitude, andnudge_motionsets how it returns. A container'sreduce_motionis combined with the system Reduce Motion preference.- While
spinholds, the element rotates around its center at a constant speed, one turn everyspin_periodseconds (default 1, negative for counterclockwise); when it does not hold, the element stops at its current angle, and it does not turn under Reduce Motion. GPUI only rotates anImagefrom resources. glow: multiplelights up a white glow where the pointer is on the element, with a radius of this multiple of the element's shorter side and a center opacity ofglow_opacity(default 0.4); it lights up while the mouse hovers, and on touch screens while a finger is held down. It looks at whether the pointer is within the element's bounds, so a title laid over a cover does not block the glow.blur: radiusblurs the element's picture without going beyond its bounds and corner radius. Neither affects layout or taps; GPUI does not support them, and the check warns.Window(idle_after:, idle_enabled:, immersive:)controls the idle state and immersive mode. idle_after is in seconds, andwindow.idleis read-only session state. idle_enabled defaults to true; turning it off clears the idle state and stops detection, and turning it on restarts the timer. SwiftUI and the Web consume this switch (capabilityidle_control); other targets do not consume the property yet,bern checkwarns for them, and idle detection is always on there.
macOS keeps the control layer while text is being edited or a menu or child window is in use; the Web restarts the timer only when the enabled state changes, and playback progress snapshot updates do not prevent idle hiding. UIKit shares the start/stop logic; player device interaction has not passed acceptance yet.
Persistence and local preview
bern::storage::Store::host() uses a small data store installed by the host and isolated by the app's bundle ID. macOS / iOS use Application Support, Windows uses APPDATA, and Linux uses XDG_CONFIG_HOME / ~/.config; a Web app uses same-origin localStorage, and WebUI uses the native engine host. Keys are limited to simple file names; a missing value is different from an empty value, and read and write failures return errors. Store::directory is for native tests with a given directory; pure engine tests without a host do not persist anything.
bern run --target web_app --port 4173Target names are defined by the project's Bern.toml. --port is only for browser apps, in the range 1–65535; when omitted, a free port is used. A fixed port keeps the same origin, so that a port change during development does not read a different localStorage. Browser permissions, storage quotas and clearing site data affect persistence.
TV, keyboard shortcuts and initial focus
Layout(size: tv)is the layout on TVs, at most one perAdaptive, and does not affect the required and fallback rules of the other sizes; expressions can readwindow.tv. tvOS keeps only what the TV shows at build time, so capabilities in the phone and desktop layouts that TVs lack (such aspick:) do not make the tvOS build fail.Layout(size: watch)is the layout on Apple Watch (watchos) and Wear OS (wearos) watches, at most one perAdaptive; expressions can readwindow.watch. When an application declares awatchosorwearostarget, every reachableAdaptivemust include aLayout(size: watch)(no silent fallback to phonecompact) and#[bern::features]proveswatchcoverage as well; other backends discardwatchbranches and components before checking.platform = "watchos"builds a standalone watchOS SwiftUI app (MinimumOSVersion = 11.0,WKWatchOnly, packaged as a Watch-Only-watchos.ipa);platform = "wearos"builds a separate Wear Material 3 APK (minSdk = 26by default, configurable viaandroid.min_sdk, e.g.,30for Google Play;android.hardware.type.watch,android.standalone = trueby default, and release packaging defaults to botharm64-v8aandarmeabi-v7a).Shortcut(key:, enabled:, quiet:, hold:, hold_after:) => actionis a keyboard shortcut without a control; keys are written the same way as a control'sshortcut. On TVs,escape,spaceand the arrow keys are the remote's back, play/pause and touch surface directions (directions only arrive when focus has nowhere to move). On Android phones and tablets the system Back, its button or gesture, runs theescapeshortcut active last before it leaves the app: a page or layer that closes on Escape closes on Back too. Withquiet: truethe key is no input forwindow.idle: it neither wakes a window at rest nor starts the count again, as a player's seek keys that leave its bars hidden. Withhold: draft.fasta press shorter thanhold_afterseconds (0.3 unless given) runs the action as the key is let go, and a longer one sets the session field true until the key is let go, without the action: a player's forward key that seeks when tapped and speeds up while held. Supported across macOS, iOS, Web, Android, Linux, Windows and GPUI (targets withouthold_shortcuts, such as tvOS, warn and run the action on key press).default_focus: trueonButton/IconButtonmakes focus start from it when the interface appears; on TVs every page should give one.window.keyboardis whether a physical keyboard is connected: always true on computers, and on phones and tablets it follows the keyboard being connected and disconnected. Content that is only useful with a keyboard (such as keyboard shortcut settings) is written insideif window.keyboard { … }, so it does not appear on phones without a keyboard.window.app_versionisversionof[app]inBern.toml, the one every package carries:Text(content: tr! { "en" => "Version {version}"; version: window.app_version }). It is decided when the app is built, so it is the same on every target. A component library belongs to no application and takes it as a parameter.- macOS windows hide the system focus ring throughout, including on buttons, text fields, sliders, toolbars and popover panels; keyboard focus, text editing and keyboard shortcuts still work normally.
- The
textblock ofstyle!can give TVs their own font size:body: font(size: 13, tv: 16). - Lengths that an element writes itself can also be left to styles to give per platform, with the element choosing a style through
variant:gap,padding,padding_x,padding_y,width,heightofRowandColumn;width,heightofStack;gap,padding_x,padding_y,row_heightofForm; andfont_size,heightofIconButton.width: fitandheight: fitremove the written size, and the element takes the size of its content. When building for a platform, the rules that apply to it (those without#[target]first, those with it after) replace the values the element writes, so where the design has different sizes on different platforms, the interface does not need to check the platform:
style! {
Row.brand { gap: 5, padding_x: 12 }
#[target(browser)]
Row.brand { gap: 10, padding_x: 0 }
Row.menu_box { width: 92 }
#[target(browser)]
Row.menu_box { width: fit }
}An element that does not have that length reports an error, for example Button.x { gap: 4 }; lengths are not less than 0, and font_size is greater than 0.
- Keys such as those of an on-screen keyboard use text session actions:
=> draft.query.push_str("A"),=> draft.query.pop(); a search page that wants to list results before anything is typed writesSearch(suggest: true). Pages(slot:, all: true)inTabsalso shows the pages declaredtab = false, for a TV that has no room-saving button for them.Tab(display: icon)makes a tab show only its icon, for example a search page that is just a magnifying glass in a TV tab bar;iconis required, andlabelis still the name the screen reader reads (and the hover tooltip on desktops). The keywords are the same as forLabel(display:), defaulting totitle_and_icon. It is not limited to TVs; all six targets generate it.
Adaptive(id: shell) {
Layout(size: compact) { phone_home(app: app) }
Layout(size: expanded) { desktop_home(app: app) }
Layout(size: tv) { tv_home(app: app) }
}
Stack {
Button(id: resume, label: tr! { "zh-Hans" => "继续播放", "en" => "Resume" }, default_focus: true) => app.resume()
if app.details_open {
Shortcut(key: "escape") => app.close_details()
}
}
Tabs(id: tv_tabs, selection: draft.page) {
Tab(value: Page::Search, label: tr! { "zh-Hans" => "搜索", "en" => "Search" }, icon: "magnifyingglass", display: icon) { search(app: app) }
Tab(value: Page::Home, label: tr! { "zh-Hans" => "首页", "en" => "Home" }) { tv_home(app: app) }
}For the scope of each target see the platform capability table; for tvOS focus, remote control and scaled scenes see the tvOS platform guide.
Menu bar and rebindable keyboard shortcuts
shortcut:andShortcut(key:)can be bound to text, and the keyboard shortcut follows it:shortcut: app.keys.open. The text is read in keyboard shortcut notation (cmd+shift+o); empty text, or text that cannot be read as a shortcut, means there is no shortcut. The engine normalizes the keys the user chose withbern::shortcut::parse_shortcut, and usesbern::shortcut::same_keysto tell whether two key strings are the same set of keys.ShortcutInput(id:, label:, current: app.keys.x) => app.set_key(app.keys.x)is a button for rebinding: it shows the current shortcut (emptywhen there is none), and after it is pressed it waits for a new key combination (showingprompt); Esc leaves it unchanged and Delete pressed on its own clears it; while it is waiting, key presses do not trigger other shortcuts. Conflicts, saving and restoring defaults are handled by the app's engine.MenuBarin aWindowSetis the app's menus:CommandMenu(label:)is a menu of the app's own,CommandMenu(role: file)and the like add items to the system menu of the same name, a nestedCommandMenuis a submenu, andDividergroups items; aCommandItemhas an action,shortcut,enabled(grayed out),checked(check mark) andpick. The drafts that menu items read and write belong to the main window and are declared with a#[session]parameter on the root component.- macOS, iPadOS (native SwiftUI
.commandsmenu bar and keyboard shortcut HUD), Windows (native WinUI 3 / XAML IslandsMenuBar), and Linux (native GTK 4PopoverMenuBarbacked bygio::Menu) show the menu bar natively; iPhone, tvOS, watchOS, Android, and Web accept the declaration without showing it (capabilitymenu_barnot applicable, no warning).window.menu_barfolds totrueat build time on macOS, Windows, and Linux, folds tofalseon tvOS, watchOS, Android, and Web, and evaluates at runtime on iOS (trueon iPad,falseon iPhone).
WindowSet(handle: AppWindows, primary: main) {
Window(id: main, title: tr! { "zh-Hans" => "主窗口", "en" => "Main" }, initial: open) { page(app: app) }
MenuBar {
CommandMenu(role: file) {
CommandItem(id: open, label: tr! { "zh-Hans" => "打开…", "en" => "Open…" }, shortcut: app.keys.open, pick: draft.file, files: "video") => app.open(draft.file)
}
CommandMenu(label: tr! { "zh-Hans" => "播放", "en" => "Playback" }) {
CommandItem(id: play, label: tr! { "zh-Hans" => "播放 / 暂停", "en" => "Play / Pause" }, shortcut: app.keys.play, enabled: app.has_video) => app.toggle_pause()
Divider
CommandMenu(label: tr! { "zh-Hans" => "倍速", "en" => "Speed" }) {
CommandItem(id: double, label: tr! { "zh-Hans" => "2×", "en" => "2×" }, checked: app.speed == Speed::Double) => app.set_speed(Speed::Double)
}
}
}
}For the scope of each target see the platform capability table; for usage see Layouts and navigation and Windows, resources, and files.
Status bar items (tray)
A StatusItem in a WindowSet is the app's item in the system status area: the notification area of the Windows taskbar, the status area of Linux desktops and the right side of the macOS menu bar. When it is declared, closing the last window does not quit the app; the app stays there.
-
shownmakes that a choice: while it is false the item is not there and closing the last window quits the app, on macOS too, and while it is true the app stays as above. It reads engine state and follows it while the app runs, for a setting such as what closing the window does. -
labelis the tooltip and the accessible name. The icon is one of two:iconis a Bern icon name, for macOS only, where the menu bar draws this symbol in the system color, while Windows and Linux show the app icon;imageis a monochrome SVG in[resources](only its shape counts, not its color, and cut-outs are the hollowed-out parts), shown on all three desktop platforms, white on a dark bar and black on a light bar, following the system as it switches. -
The first menu item opens the main window and the last one quits, with the declared
CommandItem,CommandMenuandDividerin between, which can be written insideif,if let,matchandForEach. On Windows and Linux, clicking the icon opens the main window and right-clicking shows the menu; on macOS, clicking shows the menu. -
The menu belongs to no window: it only reads engine state and runs commands and window actions, does not read or write drafts or read window fields, and its items carry no
pickorshortcut. -
login_item: trueadds "Open at Login" before "Quit": once the user checks it, the system starts the app at login, and it appears only in the status area without opening a window. -
The same switch in a settings window is written
Switch(id:, label:, login_item: true): it shows and changes the system login item and is the same item as "Open at Login" in the menu, with novalue,checkedor action. Platforms without login items (iOS, tvOS, Android, the web) do not show it (capabilitylogin_switchnot applicable). -
Phones, TVs and the web have no such place; they accept the declaration without showing it (capability
status_itemnot applicable).
StatusItem(icon: "sun.max.fill", label: tr! { "zh-Hans" => "显示器调节", "en" => "Monitor Dial" }, login_item: true) {
CommandItem(id: dim, label: tr! { "zh-Hans" => "调暗", "en" => "Dim" }, enabled: app.brightness > 10) => app.set_brightness(10)
Divider
CommandMenu(label: tr! { "zh-Hans" => "预设", "en" => "Presets" }) {
ForEach(items: app.presets, key: id) |preset| {
CommandItem(id: preset, label: preset.name, checked: preset.id == app.preset) => app.apply(preset.id)
}
}
}For usage and per-platform behavior see Windows, resources, and files.
Tables
Table lays out a list of records in columns, one row per item, and key is the row's identity: as rows are added, removed and reordered with state, each keeps its own controls. Each TableColumn has a header title, and its children are this column's cell in each row, written with the table's row variable.
selection: draft.chosenis aVec<String>orVec<i64>draft that stores the keys of the selected rows in row order. On desktops a click selects one row, and Shift and the platform's toggle key (Command on macOS, Ctrl on other platforms) select several; on Android every row has a checkbox in front, and the checkbox in the header selects all or none.- The table's action is the primary action for the selected rows: double-click or Enter; on Android, tapping a row selects only that row and runs the action.
- A
TableColumn's action runs when its header is clicked, so the engine can change the sort order;sortedanddescendingonly show the sort indicator on the header, and the order of the rows is the order ofitems. TableMenuis the row menu, opened by right-clicking (the keyboard's Menu key or Shift+F10) or long-pressing a row; when that row is not among the selected rows, it first becomes the only selected row, so menu items that readselectionget exactly the rows to act on.
Table(id: servers, label: tr! { "zh-Hans" => "服务器", "en" => "Servers" }, items: app.servers, key: id, selection: draft.selected) |server| {
TableColumn(title: tr! { "zh-Hans" => "别名", "en" => "Name" }, width: 260, sorted: app.sort == SortKey::Name, descending: app.descending) {
Text(content: server.name, lines: 1)
} => app.sort_by(SortKey::Name)
TableColumn(title: tr! { "zh-Hans" => "延迟", "en" => "Delay" }) {
Text(content: tr! { "zh-Hans" => "{n} ms", "en" => "{n} ms"; n: server.delay })
}
TableMenu {
MenuItem(id: copy_links, label: tr! { "zh-Hans" => "复制分享链接", "en" => "Copy Share Links" }) => app.copy_links(draft.selected)
Divider
MenuItem(id: remove, label: tr! { "zh-Hans" => "删除", "en" => "Delete" }, role: destructive) => app.remove(draft.selected)
}
} => app.use_chosen(draft.selected)On macOS and iOS it is SwiftUI's Table, on GTK a GtkColumnView, on WinUI 3 a header plus a ListView (Windows has no system table), on the web a <table>, and on Android it looks like a Material data table; tvOS has no tables and shows a column of row buttons.
Clipboard
paste: draft.textonButton,IconButton,MenuItemandCommandItemfirst puts the text from the clipboard into that draft and then runs the action; when the clipboard holds no text, it does neither. Mutually exclusive withpick.- The engine puts text on the clipboard with
bern::platform::copy_text(text), writes PNG image bytes withbern::platform::copy_image(png_bytes), and reads clipboard images as PNG bytes withbern::platform::read_clipboard_image()(returningOk(None)when the clipboard holds no image); all three can be called from any engine thread.
Button(id: import, label: tr! { "zh-Hans" => "从剪贴板导入", "en" => "Import from the Clipboard" }, paste: draft.pasted) => app.import_links(draft.pasted)Photos
[app].photos = true lets the engine save a picture where the system keeps the user's photos with bern::platform::save_image(path), a PNG or a JPEG, for other apps to pick from. iOS asks the user the first time, with the reason in each supported language; Android 10 and later need no permission. The call waits for the system's answer, so the engine makes it on a worker thread; refused means the user did not allow it, and other platforms answer platform_unavailable.
System fonts and file reveal
bern::platform::system_fonts()returns installed system font families asVec<SystemFont>(family: String,path: Option<String>), sorted and deduplicated by family name (via CoreText on macOS/iOS, DirectWrite on Windows, Fontconfig/system font directories on Linux, andSystemFontson Android; browsers returnplatform_unavailable).bern::platform::reveal_path(path)(andbern::platform::reveal_in_file_manager(path)) highlights a local file or folder in the desktop file manager (Finder on macOS, File Explorer on Windows,org.freedesktop.FileManager1/ desktop file manager on Linux; mobile and browser targets returnplatform_unavailable).
Progress rings
Progress(style: ring) draws how far value is of total as an arc in the accent from the top, clockwise, with round ends, width across (24 unless given) and stroke_width thick (3 unless given); at nothing yet it is a dot at the top. It takes no input, so it can lie over a button in a Stack, ringing the button's own symbol:
Stack {
IconButton(id: download, icon: "arrow.down.circle", font_size: 18, prominence: plain, label: tr! { "zh-Hans" => "下载", "en" => "Download" }) => app.download()
if app.downloading {
Progress(value: app.download_progress, label: tr! { "zh-Hans" => "下载进度", "en" => "Download Progress" }, style: ring, width: 19.3, stroke_width: 3)
}
}Pointer events and player state
Double clicks, right clicks and the scroll wheel are written inside the element they act on. A wheel runs its action once per notch; a trackpad's smooth scrolling is added up and runs it once for each notch's worth. While an element has a WheelUp or WheelDown, it takes the scrolling over it, and a scroll view around it does not move. Below, the wheel over the video changes the volume, a double click toggles full screen, and a right click opens a menu:
Video(id: screen, player: players.main, controls: none, label: tr! { "zh-Hans" => "画面", "en" => "Picture" }) {
DoubleTap => app.toggle_full_screen()
WheelUp => app.volume_up()
WheelDown => app.volume_down()
ContextMenu {
MenuItem(id: replay, label: tr! { "zh-Hans" => "从头播放", "en" => "Play from the Start" }) => players.main.seek(0)
}
}On a Button, a pointer press waits to see whether a second one follows, and runs either the button's action or the DoubleTap action. On other elements single clicks still go to the controls inside.
Hover
Hover runs an action when the pointer rests over its owning element (any pointer event owner, including containers, Image, Button and NavLink). Without delay:, it fires as soon as the pointer enters; with delay: seconds (a finite number >= 0), it fires after the pointer stays inside for that duration and cancels if the pointer leaves earlier. Targets without pointer hovering (such as watches or TVs) emit a non-blocking warning and never block the build:
Image(source: item.cover, aspect: 1.0, fit: cover, corner: 10) {
Skeleton(shape: rect, corner: 10, tone: media)
Hover(delay: 0.35) => app.prefetch_details(item.id)
}Slider(hover: draft.at) writes where the pointer is along the track while it is over the slider, from 0 at min to 1 at max, and None once it leaves; it does not change the value. Together with the player's state it can show the time under the pointer on a seek bar.
A declaration reads the state of an app player as players.<id>.<field>, without going through the engine:
| Field | Type | Meaning |
|---|---|---|
position, duration |
f64 |
Seconds; duration is 0 while unknown |
progress |
f64 |
position over duration, from 0 to 1; 0 while the duration is unknown |
position_ms, duration_ms |
i64, Option<i64> |
Milliseconds; duration_ms is None while unknown |
playing, paused, buffering, ended, failed |
bool |
The phase; buffering covers loading and waiting for data |
seekable, volume, muted |
bool, f64, bool |
Whether the position can be changed, the volume from 0 to 1, muting |
Seconds can be written out with {t, duration, m:ss}. In the seek bar below, the action gets the fraction the user chose in place of players.main.progress:
Slider(id: seek, label: tr! { "zh-Hans" => "进度", "en" => "Position" }, label_hidden: true,
current: players.main.progress, hover: draft.at, min: 0, max: 1
) => app.seek_fraction(players.main.progress)
Text(content: tr! { "zh-Hans" => "{at, duration, m:ss} / {length, duration, m:ss}", "en" => "{at, duration, m:ss} / {length, duration, m:ss}"; at: players.main.position, length: players.main.duration })Co-located native views
When an app needs a platform-specific control not covered by Bern's standard components (for example AppKit NSLevelIndicator / NSDatePicker, WinUI 3 NumberBox / CalendarView, GTK LevelBar / Calendar, or Android AndroidView), NativeView embeds co-located native implementation files placed directly beside the .rs UI file that declares it:
NativeView(
id: meter,
label: tr! { "zh-Hans" => "原生电平仪表", "en" => "Native Level Meter" },
swiftui: "meter.swiftui.swift",
winui3: "meter.winui3.cpp",
compose: "meter.compose.kt",
gtk: "meter.gtk.rs",
gpui: "meter.gpui.rs",
web: "meter.web.js",
) {
NativeText(name: heading, content: tr! { "zh-Hans" => "原生电平与步进器", "en" => "Native Meter & Stepper" })
NativeDraft(name: hover, value: draft.hover_level)
NativeNumber(id: level, label: tr! { "zh-Hans" => "电平", "en" => "Level" }, current: app.level, min: 0, max: 10, step: 1) => app.set_level(app.level)
NativeBool(id: boosted, label: tr! { "zh-Hans" => "增强模式", "en" => "Boost Mode" }, checked: app.boosted) => app.set_boosted(app.boosted)
NativeAction(id: reset, label: tr! { "zh-Hans" => "重置", "en" => "Reset" }) => app.reset()
Fallback {
Slider(id: level_fallback, label: tr! { "zh-Hans" => "电平", "en" => "Level" }, current: app.level, min: 0, max: 10) => app.set_level(app.level)
}
}- Co-located files: Backend paths (
swiftui,winui3,compose,gtk,gpui,web) resolve relative to the declaring.rsfile. Directory scanning (sources = "my-ui/src") automatically ignores*.gtk.rs,*.gpui.rsand*.native.rs. - Default sizing: Without an explicit
width:, aNativeViewfills the container's available width across all six backends so native panels and controls align cleanly insideColumnlayouts; inside aStack, an unsizedNativeViewfills both width and height. Passwidth:orheight:when fixed dimensions are desired. - Mandatory CLI entries: Every
NativeViewmust declare at least oneNativeAction,NativeNumber,NativeBoolorNativeInputentry. Each backend registers them automatically under<component>.<view>.<entry>soui inspect,ui activate,ui set-number,ui set-bool,ui editandui submitwork without piercing native widget trees. - Localization: Pass all user-visible strings through
NativeText(name:, content: tr! { ... })or entrylabel:s. The compiler warns on obvious hardcoded display strings in native files (suppressible per line with// bern-ignore-l10n). - Per-backend entry points:
| Backend | File suffix | Expected entry point |
|---|---|---|
| SwiftUI | .swift |
struct <IdPascal>NativeView: View { let props: <IdPascal>NativeProps; let actions: <IdPascal>NativeActions; let theme: BernNativeTheme } |
| WinUI 3 | .cpp / .inl |
inline xaml::UIElement build(Props const& props, Actions const& actions, Theme const& theme) |
| Compose | .kt |
@Composable fun NativeContent(props: Props, actions: Actions, theme: Theme) |
| GTK 4 | .gtk.rs |
pub fn build(props: Props, actions: Actions, theme: Theme) -> impl IsA<gtk::Widget> |
| GPUI | .gpui.rs |
pub fn render(props: Props, actions: Actions, theme: Theme) -> impl IntoElement |
| Web | .js |
export function mount({ host, props, actions, theme, effect, onCleanup }) |
See examples/native-controls/ for a complete six-backend demonstration.
Other interfaces
Animated SVG is a standalone component used on demand; for its interface, resource declarations, platform dependencies and lifecycle see Animated SVG. For full workflows on the video player, queries, modules, themes and the command protocol, see the Guides and Architecture overview.
Hiding unavailable menu items
Menu(hide_disabled: true) hides unavailable items according to each MenuItem's enabled condition and shows them again when the condition is restored. When this option is omitted, disabled items are still shown grayed out. SwiftUI, the Web, Compose, GTK and WinUI 3 all support it.
Input region
FocusRegion wraps a content view (usually a Row holding a text field and a send button). While a text field inside it is being edited, the first pointer action that lands outside the region only cancels the editing focus, consuming that press and the following release, keeping the draft and not submitting it. Buttons inside the region work as usual, and the next outside click works as usual. Keyboard Tab navigation is not affected. Each platform backend handles the events, so the app does not need to intercept them by control ID or by platform.
FocusRegion {
Row {
TextInput(id: message, label: tr! { "en" => "Message" }, value: draft.text)
Button(id: send, label: tr! { "en" => "Send" }) => app.send(draft.text)
}
}Runtime semantic palette
WindowSet(palette: app.palette) binds a text field whose content is a JSON object mapping semantic roles to light and dark #RRGGBB values, for example {"accent":{"light":"#006A60","dark":"#4FDAC8"},"surface.canvas":{"light":"#F4FBF8","dark":"#101815"}}. The palette can be replaced at runtime, and roles that are not written keep the platform default. Both appearances must be given, and foreground and background must be readable as pairs. The accent pair also tints native controls. SwiftUI (macOS, iOS, tvOS), GTK and WinUI 3 support runtime_palette; on other targets, using this property fails the build. Without a palette, the existing accent: and appearance: work as before.
Automatic skeleton screens
Bern projects skeleton screens directly from the real UI tree at compile time across all six backends, so apps do not hand-write duplicate placeholder layouts that drift out of sync with real pages:
- Default on
Query: aQuerywithout an explicitloading:text automatically projects its body into a matching skeleton while the first answer is pending. Passingloading:keeps the traditional spinner + text;loading_style: skeletonorloading_style: spinneroverrides the default explicitly. - State-driven
skeleton: <bool>: any layout or content container can bindskeleton: app.loading(and optionalskeleton_count: 8for repeated collections) to switch between its projected skeleton and real content:
Grid(min_width: 160, gap: 16, skeleton: app.loading, skeleton_count: 6) {
ForEach(items: app.albums, key: id) |album| {
Column(gap: 6) {
Image(source: album.cover, aspect: 1.0, fit: cover, corner: 12)
Text(content: album.title, style: headline)
Text(content: album.artist, style: caption, emphasis: secondary)
}
}
}- Explicit
Skeletonprimitive: for pure loading-only placeholders with no corresponding real layout (for example buffering lines), useSkeleton(width:, height:, fraction:, max_width:, aspect:, corner:, shape:, tone:, opacity:, pulse:). - Anti-flicker, motion and accessibility: skeletons wait 120 ms before appearing so fast loads never flash, reveal projected lists with a gentle staggered rise (
stagger: 0.04,appear: slide), breathe softly intext.primaryat low opacity (0.06–0.09), freeze pulsing under reduced motion, fade real content in over 150 ms when ready, ignore pointer/focus input, and expose one localized loading announcement to assistive technologies. AsyncImageURLs also display a subtle pulsing media placeholder until loaded.
Feedback, disclosure, numeric entry and dynamic pickers
Tooltip(content:)attaches contextual hover/focus help to a single child control without changing layout.keys: app.keys.playwrites that shortcut after the text, one key cap per key (it does not register the shortcut), andplacement: above/belowputs the tip above or under the child;Menu(placement:)andPopoverButton(placement:)open their menu or popover the same way, as the bar at the foot of a player wants. Supported across all six backends (SwiftUI keeps native.help(...)with formatted key text appended, usesarrowEdgeonPopoverButton, and lets the system placeMenu).- The application's own icons:
icon:names a declared.svgresource, such asicon: "icons/play.svg", in place of a name from the Bern icon set. At build time its fills, strokes and text become one filled outline, drawn in the control's foreground colour like the system icons. Supported across all six backends (app_icons). Slider(axis: vertical)stands the slider upright,minat the bottom, filling the height its container gives it, as a volume slider in a popover. Supported across all six backends (vertical_sliders).Banner(severity:, title:, content:, icon:, dismiss_label:) { … } => dismissrenders an inline status bar (info,success,warning,error) using native containers (InfoBaron WinUI 3, semantic status banners on SwiftUI, GTK, Compose, Web and GPUI), with optional trailing action buttons and a close button when an action is bound.Disclosure(id:, label:, icon:, expanded:, open:) { … }provides a collapsible section backed by nativeDisclosureGroup(SwiftUI),Expander(WinUI 3 / GTK), animated Material disclosure (Compose) and<details>(Web). It supports draft binding (expanded:), controlled binding (open:+=> action), or uncontrolled local toggle state.NumberInput(id:, label:, value:/current:, min:, max:, step:, precision:, enabled:)offers typed numeric input with native increment/decrement steppers (NumberBoxon WinUI 3,SpinButtonon GTK,TextField+Stepperon SwiftUI,<input type="number">on Web).Alert(title:, message:) { AlertAction(id:, label:, role:) => … }presents a native modal confirmation dialog (alerton SwiftUI,ContentDialogon WinUI 3,AdwAlertDialogon GTK, Material 3AlertDialogon Compose,<dialog>on Web) whenever mounted inside anifbranch.- Dynamic
Pickerandstyle: combobox:Picker(items: app.items, key: id, item_label: name, value: draft.selected, style: combobox, prompt: …)populates options directly from a dynamic record list (matchingi64,Stringor labeled enum keys) and enables live search filtering incomboboxstyle.
Dates, times, file dialogs, selectable text and identity
DatePicker(id:, label:, value:/current:, min:, max:, enabled:)edits aCalendarDateusing each platform's native calendar control (DatePickeron SwiftUI,CalendarDatePickeron WinUI 3,gtk::Calendarpopover on GTK, Material 3DatePickerDialogon Compose,<input type="date">on Web).TimePicker(id:, label:, value:/current:, min:, max:, step:, enabled:)edits a time of day as minutes since midnight (0..=1439) with native pickers (DatePicker(.hourAndMinute)on SwiftUI,TimePickeron WinUI 3, paired hour/minuteSpinButtons on GTK, Material 3TimePickeron Compose,<input type="time">on Web).- Save-file dialog (
save:+suggested_name:) and multi-filepick:: bindingpick:onButton,IconButton,MenuItemorCommandItemto aVec<MediaSource>draft automatically enables multi-file selection; bindingsave:to aMediaSource,Option<MediaSource>orStringdraft opens a native save panel (prefilled withsuggested_name:when given) before running the action. Text(selectable: true)enables native text selection and copying on read-only text (textSelection(.enabled)on SwiftUI,IsTextSelectionEnabledon WinUI 3,Label::set_selectableon GTK,SelectionContaineron Compose,user-select: texton Web).EmptyState(title:, message:, icon:) { … }renders a centered placeholder with native empty-view styling (ContentUnavailableViewon Apple platforms,adw::StatusPageon GTK, centered icon/title/message/actions elsewhere).Badge(content:, tone:, icon:)renders a compact inline status pill (neutral,accent,success,warning,error).Avatar(source:, label:, size:, shape:)renders acircleorroundedavatar showing a bundled or runtime image with automatic initials fallback (adw::Avataron GTK, clipped native image + initials elsewhere).
Trees, resizable panes, reordering, bottom sheets and pull-to-refresh
TreeView(id:, label:, items:, key:, parent:, selection:, expanded:) |item| { … } => actiondisplays a flat parent-linked record list as a collapsible hierarchy with native disclosure chevrons, keyboard navigation, and optional selection/expansion state synced to session fields.SplitPane(id:, axis:, ratio:, min_first:, min_second:) { first second }arranges two panes side-by-side (horizontal) or stacked (vertical) with a draggable splitter (gtk::Panedon GTK, draggable native divider on SwiftUI, WinUI 3, Compose, Web and GPUI) bound to a0..1ratio draft.Reorderable(id:, label:, items:, key:, move_from:, move_to:) |item| { … } => actionrenders a list whose items can be reordered by dragging or via accessible move-up/move-down buttons, writing the zero-basedmove_fromandmove_toindices before invoking the bound engine command.BottomSheet(detents:, drag_indicator:) { … } => dismisspresents a native bottom-anchored modal sheet (sheet+.presentationDetentson SwiftUI,adw::Dialogbottom sheet on GTK, Material 3ModalBottomSheeton Compose, bottom Fluent overlay on WinUI 3,<dialog>on Web, deferred bottom overlay on GPUI) whenever mounted inside anifbranch.Refreshable(id:, refreshing:) { child } => refreshwraps scrollable content with native pull-to-refresh (.refreshableon SwiftUI, Material 3PullToRefreshBoxon Compose, touch pull + busy indicator on Web, and top refresh indicator + CLIactivateacross desktop targets).