GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Bern/Docs/Reference/Component-Properties.md at master · AimesSoft/Bern

Expand file tree

/

Component-Properties.md

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
304 lines (264 loc) · 54.1 KB
/

Component-Properties.md

Copy path

File metadata and controls

304 lines (264 loc) · 54.1 KB
Raw
Copy raw file
Download raw file
Outline
Edit and raw actions

English · 简体中文

Built-in component property table

Updated: 2026-11-20. This table is exported from the current public definitions in bern-ir::spec and covers 89 built-in components. Bold properties are required, the rest are optional; these are declaration rules. For what each target implements see the platform capability table, and for concrete usage see component usage.

Property types

Type Declaration meaning
Id Stable identifier or string
DisplayText tr! text or a displayable state expression
LocalizedText tr! static localized text
Icon Icon name string (SF Symbols naming). Apple targets can use any SF Symbol; other targets map the name to the platform's own icon, and all of them draw at least the names in the Bern icon set (bern_target_api::icon_set::NAMES); using a name the target does not have is reported as an error by the check
ImageResource Image resource; Image also supports engine image state
SvgResource Declared bundled SVG resource
Number Build-time number
Length Logical length number or constrained numeric expression
NumberValue Read-only numeric expression
TextValue Read-only text expression
Bool Boolean expression
Flag Build-time true / false
Shortcut Keyboard shortcut string literal, or a text binding that the shortcut follows
FileKinds File kind string
FileField Writable MediaSource, Option<MediaSource>, or Vec<MediaSource> (multi-file pick) session field
SaveFileField Writable MediaSource, Option<MediaSource>, or String session field filled by a save-file dialog
DateField Writable CalendarDate session field
DateValue Read-only CalendarDate expression
PositionField Writable scroll position session field
TextField Writable text session field
KeysField Writable Vec<String> or Vec<i64> session field that stores row keys
BoolField Writable boolean session field
IntField Writable integer (i64) session field
NumberField Writable floating-point session field
OptionalNumberField Writable Option<f64> session field the element writes, cleared to None when what it reports ends
PickerField Writable enum session field whose variants carry labels
SelectionField Writable navigation selection enum field
SelectionValue Enum value matching the navigation selection field
Items Record list binding
KeyField Name of the stable key field of list records
PathField Writable route list session field
Route Typed route value
WindowId Window kind identifier
TypeName Generated window handle type name
SlotName Module slot name
StyleVariant style! style variant name
Transition Transition declaration or name
MotionToken Motion token name
HeroName Static name of a shared element
KeyValue Read-only text, numeric or enum identity value
Watched Read-only boolean, number, text or enum, or optional values and lists of them: the value that Watch follows
ColorRole Semantic color role
NumberList Read-only number list
PatternName style! pattern name
MediaSource Media source binding, optional or non-optional
Player A player in the app's player catalog
Query Typed query call
Feature An entry point in the owning feature contract
NativeFile Relative path literal to a co-located native UI implementation file next to the declaring .rs file
NativeName Lowercase snake_case identifier naming a prop or draft slot exposed to a NativeView
NativeScalar Read-only expression passed into a NativeView (bool, i64, f64, String, optional i64/f64/String, or, on targets with native_lists, a Vec of bool/i64/f64/String)
NativeDraftField Writable session draft field exposed to a NativeView (bool, i64, f64, String, or Option<f64>)

Fixed enums list the allowed keywords directly. The table does not repeat every cross-property constraint: Switch / Picker / Slider / ColorPicker must specify either a draft source or a controlled source, and a controlled source must also provide an action; overlay on Window requires role: utility (and the primary window cannot have role: utility); appear_delay must be used together with appear; the specific errors are checked by the compiler. Resources, semantic colors, localization, feature coverage and types are validated further as well.

Components

Component Properties (bold = required) Children, action and placement
WindowSet handle: TypeName
primary: WindowId
accent: KeyValue
palette: KeyValue
appearance: KeyValue
icon: KeyValue
Contains only ["Window", "MenuBar", "StatusItem"]; no action; root node only
MenuBar None Contains only ["CommandMenu"]; no action; directly inside ["WindowSet"], at most one; shown natively on macOS, iPadOS, Windows (WinUI 3 / XAML Islands MenuBar), and Linux (GTK 4 PopoverMenuBar)
StatusItem label: LocalizedText
icon: Icon
image: SvgResource
login_item: Flag
shown: Bool
Contains only ["CommandItem", "CommandMenu", "Divider"], which can be inside if, match, ForEach; no action; directly inside ["WindowSet"], at most one; the menu does not read or write drafts or window fields, and menu items do not take pick or shortcut; either icon or image: icon is shown only on macOS, while Windows and Linux show the app icon; image is a monochrome SVG that all three desktop platforms show in white or black according to the appearance of the bar it sits in; not shown on iOS, tvOS, Android or the Web
CommandMenu label: LocalizedText
role: app / file / edit / view / window / help
Contains only ["CommandItem", "CommandMenu", "Divider"], which can be inside if, match, ForEach; no action; directly inside ["MenuBar", "CommandMenu", "StatusItem"]; either label or role, and role is used only for menus on the menu bar
CommandItem id: Id
label: DisplayText
shortcut: Shortcut
enabled: Bool
checked: Bool
pick: FileField
save: SaveFileField
suggested_name: DisplayText
files: FileKinds
paste: TextField
No children; must bind an action; directly inside ["CommandMenu", "StatusItem"]; the drafts of menu bar items belong to the primary window; at most one of pick, save or paste
Window id: WindowId
title: LocalizedText
initial: open / closed
presentation: auto / virtual / floating / native_required
role: standard / settings / dialog / utility
overlay: Id
width: Number
height: Number
min_width: Number
min_height: Number
confirm_close: Bool
close_message: LocalizedText
chrome: standard / unified
immersive: Bool
landscape: Bool
idle_after: Number
idle_enabled: Bool
Exactly one child; action optional; directly inside ["WindowSet"]; role: utility declares a compact floating tool window, and overlay places it beside a bern::overlay of the same id when opened, keeping its position afterward (auto-closing when that overlay hides, locks, or moves to the taskbar)
Column variant: StyleVariant
gap: Length
padding: Length
padding_x: Length
padding_y: Length
width: Length
height: Length
align: leading / center / trailing
May contain children; no action
FocusRegion None One content view; during text editing, the first pointer action outside the region only removes focus and consumes the whole click, keeping the draft; controls inside the region and the next click work normally
Row variant: StyleVariant
gap: Length
padding: Length
padding_x: Length
padding_y: Length
width: Length
height: Length
align: top / center / bottom / baseline
May contain children; no action
Accordion count: NumberValue
selected: NumberValue
collapsed_width: Length
height: Length
gap: Length
corner: Length
May contain children; no action; when height is omitted, it uses the remaining available height
Grid min_width: Length
gap: Length
row_gap: Length
padding: Length
padding_x: Length
padding_y: Length
cell_ratio: Number
cell_extra: Length
masonry: Flag
May contain children; no action
Stack variant: StyleVariant
enabled: Bool
align: top_leading / top / top_trailing / leading / center / trailing / bottom_leading / bottom / bottom_trailing
width: Length
height: Length
under_bars: Flag
May contain children; no action
Marquee duration: Length
phase: Number
paused: Bool
opacity: NumberValue
May contain children; no action
ScaleBox width: Length
height: Length
May contain children; no action
Positioned x: Length
y: Length
width: Length
height: Length
bleed: Bool
May contain children; no action; bleed lets a layer in a ScaleBox scene extend to the edge of the box on the canvas edges it reaches
Modal width: Length
height: Length
cover: compact
May contain children; optional action (runs when clicking outside or pressing Escape); without height it is as tall as its content (a ScrollView inside it is as tall as the content it scrolls), and it stops at the window edge when the window cannot fit it
Flow gap: Length May contain children; no action; the children in each line are vertically centered, and Spacer takes the rest of the width of its line
Timer interval: Number
enabled: Bool
No children; must bind an action
Watch value: Watched No children; must bind an action; runs on mount and when the value changes
Shortcut key: Shortcut
enabled: Bool
quiet: Flag
hold: BoolField
hold_after: Number
No children; must bind an action
PickerOption value: KeyValue
label: DisplayText
No children; no action; directly inside ["Picker"]
Rail axis: horizontal / vertical
anchor: start / center / end
overhang: Length
May contain children; no action
Spacer No own properties No children; no action
WindowButtons edge: leading / trailing No children; no action; reserves the traffic lights at leading on macOS and the caption buttons at trailing on Windows, and takes no space elsewhere
Divider No own properties No children; no action
ScrollView axis: vertical / horizontal
snap: start / center
position: PositionField
arrival: nudge
indicators: automatic / hidden / mouse
open_at: Number
open_center: NumberValue
anchor: Number
browsing: BoolField
May contain children; no action
SplitView No own properties Contains only ["Sidebar", "Detail"]; no action
Sidebar selection: SelectionField
collapsed: BoolField
width: Length
id: Id
fallback: SelectionValue
Contains only ["Search", "Section", "SidebarItem", "Pages", "SidebarHeader", "SidebarFooter"]; no action; directly inside ["SplitView"]; collapsed (false = expanded) syncs bidirectionally in wide windows and ignores automatic narrow-window folding
SidebarHeader role: content / title May contain children; no action; directly inside ["Sidebar"]
SidebarFooter No own properties May contain children; no action; directly inside ["Sidebar"]
Detail titled: Bool May contain children; no action; directly inside ["SplitView"]
DetailFooter No own properties May contain children; no action; directly inside ["Detail"], at most one, and not placed in if, match or ForEach. Content pinned to the bottom of the detail column, staying visible across navigation pushes within it
SidebarItem value: SelectionValue
label: DisplayText
icon: Icon
badge: NumberValue
variant: StyleVariant
No children; no action; directly inside ["Sidebar", "Section"]
Section title: DisplayText
footer: DisplayText
style: grouped / plain
padding_x: Length
padding_y: Length
May contain children; no action
Slot id: SlotName No children; no action
Pages slot: SlotName
all: Flag
No children; no action; directly inside ["Sidebar", "Section", "Tabs"]. Inside Tabs, each page expands into a Tab whose content is that page's component; all: true includes every contributed page
PageContent slot: SlotName
selected: SelectionField
No children; no action
Form title: DisplayText
variant: StyleVariant
gap: Length
row_height: Length
padding_x: Length
padding_y: Length
May contain children; no action
Navigation path: PathField
id: Id
reset: KeyValue
May contain children; no action; when reset changes, returns to the root
Destination No own properties May contain children; no action; directly inside ["Navigation"]
NavLink id: Id
route: Route
May contain children; no action
ControlGroup label: DisplayText
height: Length
May contain children; no action
Tabs selection: SelectionField
id: Id
fallback: SelectionValue
bar: standard / floating
Contains only ["Tab", "Pages", "TabAccessory"]; no action. The selected tab takes the app's accent color; bar: floating makes the tab bar on phones a capsule clear of the screen edges: iOS 26 and later already do this, Compose draws a floating capsule (with a capsule of its own behind the selected item), and TabAccessory is a capsule too; GTK, WinUI 3 and the Web keep their own tab bars On Android, a window shorter than the compact breakpoint (window.short, a phone in landscape) shows floating tabs as a rail of icons beside the pages, the accessory a capsule over their foot.
TabAccessory shown: Bool May contain children; no action; directly inside ["Tabs"], at most one, and not placed in if or ForEach. A persistent strip above all the pages, for example a mini player for what is playing; it collapses when shown is false
Tab value: SelectionValue
label: DisplayText
icon: Icon
display: title_and_icon / icon
May contain children; no action; directly inside ["Tabs"]. display: icon shows only the icon (icon must be written), and label is still the accessible name
SplitButton id: Id
label: DisplayText
value: BoolField
checked: Bool
icon: Icon
shape: capsule
height: Length
more_label: DisplayText
shortcut: Shortcut
May contain children; either value or checked; checked requires an action, which runs on toggle
PopoverButton panel_appearance: inherit / window / surface
id: Id
label: DisplayText
icon: Icon
font_size: Number
shape: capsule
height: Length
prominence: standard / plain
presented: BoolField
open: Bool
shortcut: Shortcut
placement: above / below
May contain children; open must bind an action and is mutually exclusive with presented; no action when open is not used
Inspector presented: BoolField
width: Number
May contain children; no action
Toast content: DisplayText
icon: Icon
key: KeyValue
duration: Number
No children; no action
Pinch id: Id
label: DisplayText
value: NumberField
min: Number
max: Number
feature: Feature
Exactly one child; action optional
Swipe id: Id
label: DisplayText
value: NumberField
min: Number
max: Number
axis: vertical / horizontal
distance: Number
continuous: Flag
active: BoolField
feature: Feature
Exactly one visual child plus an optional OnCommit; action optional
OnCommit None No children; must bind an action; directly inside ["Swipe"], at most one; runs once after its Swipe finishes, never on cancel
ScreenBrightness value: NumberField
available: BoolField
No children; no action; scoped host brightness override while mounted (0..1); available reports whether the host supports it
Drop id: Id
label: DisplayText
value: FileField
files: FileKinds
over: BoolField
opens: Flag
feature: Feature
Exactly one child; must bind an action
Toolbar No own properties Contains only ["Button", "IconButton", "Picker", "Menu", "Search", "Switch", "SplitButton", "PopoverButton", "ControlGroup", "Divider", "Spacer", "Text"]; no action
Adaptive id: Id Contains only ["Layout"]; no action
Layout size: compact / medium / expanded / large / tv May contain children; no action; directly inside ["Adaptive"]
Menu id: Id
label: DisplayText
hide_disabled: Flag
icon: Icon
style: button / icon
bold: Flag
shape: capsule
height: Length
placement: above / below
Contains only ["MenuItem", "Divider"]; no action; style: icon without icon renders a plain text trigger without a dropdown arrow
MenuItem id: Id
label: DisplayText
icon: Icon
role: normal / destructive
checked: Bool
enabled: Bool
feature: Feature
shortcut: Shortcut
pick: FileField
save: SaveFileField
suggested_name: DisplayText
files: FileKinds
paste: TextField
No children; must bind an action; directly inside ["Menu", "TableMenu", "ContextMenu"]; at most one of pick, save or paste; checked shows the platform's checkmark state
LanguagePicker id: Id
label: DisplayText
label_hidden: Flag
No children; no action; leads with a "Follow System" option ("system") followed by the app's supported languages
List items: Items
key: KeyField
May contain children; no action
ForEach items: Items
key: KeyField
May contain children; no action
Table id: Id
label: DisplayText
items: Items
key: KeyField
selection: KeysField
Contains only ["TableColumn", "TableMenu"], at least one TableColumn and at most one TableMenu; action optional, it is the primary action on the selected rows (double-click or Enter, or tapping a row on a touch screen); selection is a Vec<String> or Vec<i64> draft that stores the keys of the selected rows in row order. Uses the |item| row template
TableColumn title: DisplayText
width: Number
sorted: Bool
descending: Bool
Exactly one child, which is the content of this column's cell in each row; action optional, runs when the header is clicked; directly inside ["Table"]; sorted and descending only show the sort indicator, and the order of the rows is decided by the engine
TableMenu None Contains only ["MenuItem", "Divider"]; no action; directly inside ["Table"]; opens on right-click or long press on a row, and if that row is not among the selected rows, it first selects only that row
ContextMenu None Contains only ["MenuItem", "Divider"]; no action; directly inside a pointer event owner (see below), at most one per element; not part of what the element shows; opens on right-click or long press on the element
DoubleTap None No children; must bind an action; directly inside a pointer event owner, at most one per element; runs on a double click or double tap; on a Button it is exclusive with the button's own action, elsewhere single clicks still reach the content
WheelUp None No children; must bind an action; directly inside a pointer event owner, at most one per element; runs once per notch the wheel or trackpad scrolls up over the element (the way that moves a scroll view toward its top), and the element takes that scrolling
WheelDown None No children; must bind an action; directly inside a pointer event owner, at most one per element; runs once per notch the wheel or trackpad scrolls down over the element, and the element takes that scrolling
Hover delay: Number No children; must bind an action; directly inside a pointer event owner, at most one per element; runs when the pointer rests over the element, immediately or after delay seconds (>= 0)
PreviewList items: Items
key: KeyField
item_height: Number
gap: Number
more_height: Number
Creates the first few items that fit completely in the available height; when items remain, leaves room for +N, with a default height of 22; does not scroll and does not create hidden items. Uses the |item| row template
Text content: DisplayText
style: large_title / title / title2 / title3 / headline / subheadline / body / callout / footnote / caption / caption2 / control / code
emphasis: primary / secondary / tertiary
color: accent / status.success / status.warning / status.error
mark: ColorRole
lines: Number
font_size: Length
line_height: Length
ruby: TextValue
markdown: Flag
selectable: Flag
bold: Bool
lit: Length
lit_path: TextValue
lit_clock: NumberValue
lit_since: NumberValue
No children; no action; either color or emphasis; selectable: true enables native text selection and copying
Canvas width: Length
height: Length
label: DisplayText
bleed: Flag
Contains only ["Shape", "Series", "Pattern"]; no action
Shape kind: rect / rounded / capsule / ellipse
x: Number
y: Number
width: Number
height: Number
corner: Number
fill: ColorRole
fill_from: ImageResource
fade: up / down / left / right
stroke: ColorRole
stroke_width: Number
dash: Number
dash_gap: Number
opacity: Number
No children; no action; directly inside ["Canvas"]
Series values: NumberList
kind: area / line
max: NumberValue
fill: ColorRole
stroke: ColorRole
stroke_width: Number
opacity: Number
No children; no action; directly inside ["Canvas"]
Pattern name: PatternName
opacity: Number
No children; no action; directly inside ["Canvas"]
Label title: DisplayText
icon: Icon
style: large_title / title / title2 / title3 / headline / subheadline / body / callout / footnote / caption / caption2 / control / code
color: ColorRole
font_size: Number
display: title_and_icon / icon
No children; no action
Svg source: SvgResource
static_source: SvgResource
width: Length
height: Length
label: DisplayText
fit: contain / cover / fill
playing: Bool
speed: NumberValue
restart: NumberValue
interactive: Flag
data: DisplayText
external_links: Flag
No children; no action
WebPage url: DisplayText
cookies_file: DisplayText
cookie_domain: DisplayText
user_agent: DisplayText
content_mode: auto / mobile / desktop
close_on: DisplayText
label: DisplayText
No children; action optional (runs when an element matching CSS selector close_on is pressed); unavailable on tvOS, watchOS and Wear OS
Image source: ImageResource
label: DisplayText
width: Length
height: Length
fit: contain / cover / fill
corner: Length
rendering: original / template
saturation: NumberValue
aspect: Number
Optional single placeholder child (wrap several views in Stack, Column or Row); no action; saturation is from 0 (grayscale) to 1 (full color), can follow state, and animates with animate
Progress value: NumberValue
total: Number
label: DisplayText
style: bar / ring
width: Length
stroke_width: Number
No children; no action; style: ring needs value; width and stroke_width only with style: ring
Button id: Id
label: DisplayText
icon: Icon
shape: capsule / chip
height: Length
width: fill
role: normal / destructive / cancel
prominence: standard / prominent / plain
enabled: Bool
cursor: default / pointer
variant: StyleVariant
feature: Feature
shortcut: Shortcut
pick: FileField
save: SaveFileField
suggested_name: DisplayText
files: FileKinds
default_focus: Flag
clears: TextField
paste: TextField
May contain children; must bind an action; pick opens a single or multi-file (Vec<MediaSource>) picker, save opens a save-file dialog (optionally prefilled with suggested_name), and paste puts clipboard text into that draft before running the action; at most one of pick, save or paste
IconButton id: Id
icon: Icon
font_size: Number
height: Length
label: DisplayText
prominence: standard / prominent / plain
color: ColorRole
enabled: Bool
variant: StyleVariant
feature: Feature
shortcut: Shortcut
pick: FileField
save: SaveFileField
suggested_name: DisplayText
files: FileKinds
paste: TextField
default_focus: Flag
icon_progress: NumberValue
badge_icon: Icon
badge_visible: Bool
No children; must bind an action; at most one of pick, save or paste
TextInput id: Id
label: DisplayText
label_hidden: Flag
value: TextField
current: TextValue
prompt: DisplayText
kind: plain / secure / multiline
submit: clear
clear_key: NumberValue
feature: Feature
No children; action optional; either value or current; with value the action runs on submit, and submit: clear clears the draft and gives up focus after the action; with current the action runs on every edit, the same expression in the action's arguments is the text typed, and while editing the engine's text does not overwrite the user's input; SwiftUI's clear_key clears when the number changes, for use with asynchronous success acknowledgements
Search id: Id
value: TextField
prompt: DisplayText
feature: Feature
shortcut: Shortcut
style: automatic / palette
display: automatic / icon
panel_prompt: DisplayText
width: Number
height: Number
font_size: Number
suggest: Flag
May contain children; action optional; display: icon only with style: palette
SearchItem id: Id
label: DisplayText
icon: Icon
detail: DisplayText
hint: DisplayText
navigation: Bool
pick: FileField
files: FileKinds
feature: Feature
May contain children; must bind an action
Switch id: Id
label: DisplayText
value: BoolField
checked: Bool
label_hidden: Flag
shape: capsule / chip
height: Length
style: switch / checkbox / button
variant: StyleVariant
icon: Icon
shortcut: Shortcut
login_item: Flag
No children; action optional; login_item: true shows and changes the system login item, and is written without value, checked or an action
ShortcutInput id: Id
label: DisplayText
label_hidden: Flag
current: Shortcut (state, cannot be a literal)
prompt: DisplayText
empty: DisplayText
enabled: Bool
feature: Feature
No children; must bind an action, and in the action the expression identical to current is replaced with the chosen shortcut
Slider id: Id
label: DisplayText
label_hidden: Flag
value: NumberField
current: NumberValue
continuous: Flag (only with current)
hover: OptionalNumberField
min: Number
max: Number
step: Number
min_icon: Icon
max_icon: Icon
feature: Feature
axis: horizontal / vertical
No children besides pointer events; action optional; hover holds where the pointer is along the track while it is over the slider, from 0 at min to 1 at max, and None otherwise; it does not change the value
ColorPicker id: Id
label: DisplayText
label_hidden: Flag
value: NumberField
current: NumberValue
feature: Feature
No children; action optional with value and required with current; stores a 24-bit sRGB color (0xRRGGBB); not available on tvOS, watchOS or Wear OS
Video id: Id
source: MediaSource
player: Player
label: DisplayText
controls: standard / none
fit: contain / cover / fill
sizing: standard / fill
corner: Length
No children; no action. A video with controls: none shows only the picture and can be the content of a Button. sizing: fill makes the playback surface fill a parent container that has a definite size, and fit only controls how the video content is placed in the surface; danmaku drawn by the media core can use the letterbox bars. The default standard keeps the original layout. When the app registers a media core, the core draws into the surface the view gives it; see Windows, resources, and files
Query id: Id
query: Query
presented: Bool
loading: DisplayText
loading_style: automatic / skeleton / spinner
empty: DisplayText
failed: DisplayText
icon: Icon
Result template with an optional leading QueryStatusHeader; no action; automatic projects a compile-time skeleton when loading is omitted, or shows the native spinner when loading is explicit
QueryStatusHeader — Exactly one child; first direct child of Query, at most once; no action
Picker id: Id
label: DisplayText
value: PickerField
selected: KeyValue
items: Items
key: KeyField
item_label: KeyField
prompt: DisplayText
label_hidden: Flag
shape: capsule
height: Length
style: automatic / menu / segmented / radio / inline / chips / combobox
Contains only ["PickerOption"] (forbidden when items is given); action optional; items requires both key and item_label, and value / selected matches the key field type; style: combobox provides a filterable dropdown; chips accepts shape: capsule and does not accept height
Tooltip content: DisplayText
keys: Shortcut
placement: above / below
Exactly one child; no action; shows contextual hover / focus help across all backends
Banner id: Id
severity: info / success / warning / error
title: DisplayText
content: DisplayText
icon: Icon
dismiss_label: DisplayText
May contain trailing action children (such as Button); optional dismiss action (shows a close button when bound)
Disclosure id: Id
label: DisplayText
icon: Icon
expanded: BoolField
open: Bool
May contain children; action optional (open requires an action and is mutually exclusive with expanded; omitting both uses local toggle state)
NumberInput id: Id
label: DisplayText
label_hidden: Flag
value: NumberField
current: NumberValue
min: Number
max: Number
step: Number
precision: Number
enabled: Bool
No children; action optional with value and required with current; numeric text entry with native increment/decrement steppers and range clamping
Alert title: DisplayText
message: DisplayText
Contains only ["AlertAction"]; optional dismiss action; mounts a native modal confirmation dialog (typically guarded by if)
AlertAction id: Id
label: DisplayText
role: default / cancel / destructive
enabled: Bool
No children; must bind an action; directly inside ["Alert"]
DatePicker id: Id
label: DisplayText
label_hidden: Flag
value: DateField
current: DateValue
min: DateValue
max: DateValue
enabled: Bool
No children; action optional with value and required with current; native calendar date picker backed by CalendarDate
TimePicker id: Id
label: DisplayText
label_hidden: Flag
value: NumberField
current: NumberValue
min: Number
max: Number
step: Number
enabled: Bool
No children; action optional with value and required with current; native time-of-day picker storing minutes since midnight (0..=1439)
EmptyState title: DisplayText
message: DisplayText
icon: Icon
May contain action children (such as Button); no action; centered placeholder for empty views and search results
Badge content: DisplayText
tone: neutral / accent / success / warning / error
icon: Icon
No children; no action; compact inline semantic status capsule
Avatar source: ImageResource
label: DisplayText
size: Length
shape: circle / rounded
No children; no action; circular or rounded avatar displaying an image with automatic initials fallback
TreeView id: Id
label: DisplayText
items: Items
key: KeyField
parent: KeyField
selection: PositionField
expanded: KeysField
feature: Feature
Uses the |item| row template; action optional (runs on double-click / Enter); parent names an Option<Key> field referencing the parent row's key; selection stores the selected key and expanded stores the expanded node keys
SplitPane id: Id
axis: horizontal / vertical
ratio: NumberField
min_first: Length
min_second: Length
Exactly two children; no action; resizable split container with a draggable divider storing the leading pane's ratio (0..1)
Reorderable id: Id
label: DisplayText
items: Items
key: KeyField
move_from: IntField
move_to: IntField
feature: Feature
Uses the |item| row template; must bind an action; writes the source and destination zero-based indices into move_from and move_to before running the action
BottomSheet detents: medium / large / both
drag_indicator: Flag
May contain children; action optional (runs on dismiss); mounts a native bottom-anchored modal sheet (typically guarded by if)
Refreshable id: Id
refreshing: Bool
feature: Feature
Exactly one child; must bind an action; triggers pull-to-refresh (and CLI activate) and displays a native refresh indicator while refreshing is true
NativeView id: Id
label: DisplayText
swiftui: NativeFile
winui3: NativeFile
compose: NativeFile
gtk: NativeFile
gpui: NativeFile
web: NativeFile
Contains only ["NativeValue", "NativeText", "NativeDraft", "NativeAction", "NativeNumber", "NativeBool", "NativeInput", "Fallback", "DoubleTap", "ContextMenu", "WheelUp", "WheelDown", "Hover"]; must specify at least one backend file and at least one CLI control entry (NativeAction / NativeNumber / NativeBool / NativeInput), at most one Fallback; targets without a matching backend file render Fallback (or fail the build if absent)
NativeValue name: NativeName
value: NativeScalar
No children; no action; directly inside ["NativeView"]; generates a typed read-only field in Props
NativeText name: NativeName
content: DisplayText
No children; no action; directly inside ["NativeView"]; passes localized tr! text into Props
NativeDraft name: NativeName
value: NativeDraftField
No children; no action; directly inside ["NativeView"]; exposes the current draft value in Props and a set_<name> callback in Actions
NativeAction id: Id
label: DisplayText
enabled: Bool
feature: Feature
No children; must bind an action; directly inside ["NativeView"]; registered for CLI ui activate under <component>.<view>.<id>
NativeNumber id: Id
label: DisplayText
current: NumberValue
min: Number
max: Number
step: Number
enabled: Bool
feature: Feature
No children; must bind an action; directly inside ["NativeView"]; registered for CLI ui set-number under <component>.<view>.<id>
NativeBool id: Id
label: DisplayText
checked: Bool
enabled: Bool
feature: Feature
No children; must bind an action; directly inside ["NativeView"]; registered for CLI ui set-bool under <component>.<view>.<id>
NativeInput id: Id
label: DisplayText
current: TextValue
enabled: Bool
feature: Feature
No children; must bind an action; directly inside ["NativeView"]; registered for CLI ui edit / ui submit under <component>.<view>.<id>
Fallback None May contain children; no action; directly inside ["NativeView"], at most one; rendered on targets without a native file
Skeleton width: Length
height: Length
fraction: Number
max_width: Length
aspect: Number
corner: Length
shape: rect / capsule / circle
tone: primary / secondary / media
opacity: Number
pulse: Flag
No children; no action; non-interactive placeholder shape in text.primary at low opacity (primary 0.09, media 0.07, secondary 0.06, or explicit opacity) with a gentle pulse frozen under reduced motion; fraction cannot be combined with width and sizes width as min(available, max_width) * fraction

When Grid is given cell_ratio, every row has the same height: column width ÷ cell_ratio + cell_extra (for example a 2 : 3 poster plus the height of two lines of text: cell_ratio: 0.6667, cell_extra: 54); items are laid out from the top of their cell, and taller content extends into the row gap below, unlike the default, which sets the row height from the tallest item.

With masonry, Grid becomes a masonry layout: items are laid out at their own heights, and each item goes into the column that is currently shortest (the leftmost one when columns are equally short), which suits cards of varying heights. SwiftUI and Compose use a custom layout, and the Web uses one-pixel-high grid rows so that each item spans its own height; GTK and Windows for now lay it out row by row as an ordinary grid.

Text(style: code) uses the platform's own monospaced font, slightly smaller than body text, for code, commands and file contents: the .monospaced design in SwiftUI, FontFamily.Monospace in Compose, the ui-monospace family on the Web, the monospace style class in GTK, and Cascadia Mono on Windows (Consolas when it is not available). The text block of style! can set its font size and weight like any other style.

Pointer events. DoubleTap, ContextMenu, WheelUp, WheelDown and Hover are written as direct children of the element they act on, which owns them: Button, NavLink, Video, NativeView, Slider, Image, Svg, Text, Label, Progress, Column, Row, Grid, Stack, Flow, ScaleBox or Positioned. They are not views and are not part of what the element shows, so a leaf such as Text or Slider can take them in braces, and they cannot be placed in if or ForEach. An element takes at most one of each. They are shortcuts: what they do must also be reachable through a button, a menu or a shortcut, since keyboards, remotes and assistive technologies do not double-click, right-click, hover or scroll a wheel.

Svg compiles animated and interactive .svg resources at build time into compact BSVG scenes played natively in pure Rust across all targets without a WebView; pointer interactions are declared on <svg> with data-bern-click / data-bern-dblclick and optional data-bern-ready, while static_source, data, and external_links remain accepted for source compatibility. Static SVGs without animations or interactions lower automatically to Image. See Animated SVG.

With lit, Text keeps that much of itself in its color and fades the rest, for words sung one by one: 2.5 is two characters and the left half of the third, on the targets that draw inside a character; below zero, all of it shows as usual. The count is in Unicode scalars. SwiftUI, Compose, WinUI and GTK draw it; the other targets show the text whole.

With lit_path the front end moves that place by itself, every frame, while lit is not below zero: lit_path lists seconds and characters in order, apart by spaces ("10 0 11 2 12 2"), and the place moves evenly from each to the next. lit_clock is the second it showed at lit_since, in seconds since the Unix epoch; a lit_since of zero stands still. State changes only when the route or the clock does, so nothing has to send each step. Windows moves it on the compositor.

Text(ruby:) places readings above ranges of the unchanged content. Its dynamic string is a JSON array such as [[0,2,"とうきょう"]]: start and end are half-open Unicode scalar indices in the original text, never UTF-8 bytes or UTF-16 units. Empty or [] keeps normal text layout. Readings reserve space above the corresponding wrapped lines and do not add characters to lit or lit_path. Floating text uses the same format in overlay::Line::ruby. Malformed, overlapping and out-of-bounds ranges are ignored. The annotation string is metadata, not localized display text; literals and conditional string expressions are accepted.

With markdown, the content of Text is inline Markdown: **bold**, *italic* or _italic_, `code`, ~~strikethrough~~ and [link](url), and a backslash makes the next marker display literally. SwiftUI hands it to the system's AttributedString(markdown:), Compose writes it as an AnnotatedString with styles and LinkAnnotation, the Web generates elements (not treated as HTML; links accept only web and email addresses), and GTK converts it to Pango markup; Windows for now strips the markup and shows only the text. A whole document (headings, lists, tables and so on) is split into blocks by the app itself, and each block is shown as such text.

Search placed in a Toolbar or a Sidebar is taken over by them; placed in a page, it is the platform's own search field (UISearchTextField on iOS, NSSearchField on macOS, input[type=search] on the Web), its children are the results listed below the field when the field has focus or contains text, and width / height / font_size are the size and font size of the field itself (for the search panel in a toolbar, they are the panel's size).

Rail(overhang:) makes the ticks extend this many points past each end of the track: a child at ratio f stands at f × (length + 2 × overhang) − overhang, like a timeline built with negative margins in CSS. ScrollView(open_at:) is the position on opening: the point at ratio f of the content is aligned to the same ratio of the view (0 the start, 0.5 center to center, 1 the end). ScrollView(open_center:) is also the position on opening: the point at ratio f of the content stops at the center of the view; near either end, where it cannot reach the center, the view scrolls as far as it can, and the point is still in view. It can bind an expression, which is read only once on opening, and the view does not scroll along when the value changes later; for example, it centers "now" as far as possible when a timeline opens.

The gap of Form is the distance between groups, row_height is the minimum row height, and padding_x / padding_y are the inner padding of the rows of all groups (a Section's own properties of the same name take precedence); when a form begins with Section(style: plain), it starts at the top of the page, and the rows of that group have no background, margins or separators, serving as a heading that scrolls with the form. The row padding the form gives groups does not apply to plain groups, which use only their own padding_x / padding_y. The leading plain group can also come from a slot, a component or a condition: during layout the form checks whether the first item is a plain group, and follows when the condition changes, so if window.compact { Section(style: plain) { … } } makes the form start at the top only in narrow windows. In style!, Form { background: role } is the background of the rows, and the form itself lets the page background show through.

Items in a Row take their own widths when they fit, and the remaining space is shared equally by Spacers and filling items; when they do not fit, the other items shrink in proportion to their own widths, but not below their own minimum widths. Spacer has no minimum length and is the first to shrink to zero when things do not fit, the same on every target. When leading text in a Row is immediately followed by a Spacer (a Text without a width, or a Column without align or with align: leading), the text takes the Spacer's place: the controls after it keep their own widths, and the text wraps within the remaining width, like the label of a system list row; SwiftUI and Compose lay it out this way, and other targets follow the general rule above. When width / height is given and the content is smaller, Column starts from the top and is placed horizontally by align, and Row starts from the leading edge and is placed vertically by align. A Column without align is the same as leading: buttons and other controls, as well as inner Column and Stack, keep their own widths, while horizontally filling content such as input fields, dividers, Grid and List spans the whole column; to make a button span the whole column, write Button(width: fill). A Column written directly in a window without a width is as wide as the window content area, starts from the top and is placed horizontally by align; a Stack without a size fills the content area; other body content smaller than the content area is laid out from the top-left corner.

Keep a page's query while showing another tab

Declare Query inside the page but outside the branch that switches tabs. Use presented to choose when to show its result and status controls. If the tab selector stays fixed, make it a sibling of the query so it works even before the first answer.

Column {
    Switch(id: show_results, label: tr! { "en" => "Show results" }, value: draft.show_results)
    Query(id: results, query: app.search(draft.text, 20), presented: draft.show_results,
          empty: tr! { "en" => "No matches" }) |books| {
        ForEach(items: books, key: id) |book| { Text(content: book.title) }
    }
    if !draft.show_results { Text(content: tr! { "en" => "Settings" }) }
}

presented defaults to true. It is a Boolean expression in the surrounding scope, not a query argument: toggling it neither requests data nor advances the request version. While false, there is no result, status or retry control in layout, focus, accessibility or external control lookup. The subscription still follows argument changes, invalidation from #[reads] and replies. Showing it again presents its current state: ready data or an empty result immediately, a real pending load, or a failure with retry. This does not cache results per tab or argument set.

Removing the declaration (for example by putting the entire Query inside if draft.show_results) or closing its window ends the subscription. Another window owns a separate subscription.

A header that scrolls with the results

If the selector should scroll with the results, put it inside the success template’s ScrollView. To offer the same selector before the first answer, make QueryStatusHeader the first direct child of Query and call the selector component inside it:

Query(id: results, query: app.search(draft.text, 20), presented: draft.show_results) |books| {
    QueryStatusHeader { browse_header(app: app) }
    ScrollView {
        browse_header(app: app)
        ForEach(items: books, key: id) |book| { Text(content: book.title) }
    }
}

QueryStatusHeader takes one child, evaluated in the surrounding scope: it can use app and draft, not this query's books. To make it conditional, put if inside the header. It appears above the native progress indicator until the first answer, or above the native failure and retry controls if there is no previous answer. It does not replace those controls or start a second subscription.

A successful empty list or None counts as an answer. Once an answer is available, the status header is absent, including during a refresh or a failure that carries the previous answer. The query keeps its usual handling of data, empty results and errors. When presented is false neither layout is built. Omitting QueryStatusHeader leaves the default query UI unchanged.

Common motion and rail properties

The following properties are open only to layout elements for which ComponentSpec::moves() is true, and should not be added to nodes that do not accept motion, such as Window, navigation structures and slots. Each backend may have further capability restrictions.

Property Type
appear Transition
appear_delay Number
disappear Transition
reflow MotionToken
hero HeroName
hero_key KeyValue
reveal hover
animate MotionToken
appearance light / dark
tint ColorRole: the accent color of this part of the interface changes to that role, and the controls, selection states and links inside it are colored accordingly
scroll_scale Number
scroll_opacity Number
scroll_origin_x Number
scroll_origin_y Number
nudge Bool
nudge_key KeyValue
nudge_scale Number
nudge_motion MotionToken: how the element returns after a nudge, jelly when omitted; requires nudge or nudge_key
reduce_motion Bool
spin Bool: when true, rotates at a constant speed around its center; when false, stops at the angle it has at that moment
spin_period Number: seconds per revolution, default 1, negative for counterclockwise; requires spin
glow Number: a white glow that follows the pointer (a hovering mouse, or a finger held down) while it is within the element, with a radius of this multiple of the element's shorter side; it lights up even with other elements on top
glow_opacity Number: the opacity at the center of the glow, greater than 0 and at most 1, default 0.4; requires glow
blur Length: blurs the element's picture by this radius (points), without going beyond the element's bounds and corner radius; can follow state, and with animate changes with its motion (bound_blur: implemented on all six targets)
opacity NumberValue: element opacity from 0 to 1; can follow state, and with animate changes with its motion (elements with their own opacity property — Marquee, Skeleton, Shape, Series, Pattern — apply it directly)
stagger Number
idle_area Number: the number of seconds the mouse must rest here before the window goes idle; when there are idle areas, the mouse resting elsewhere in the window does not make the window idle (once it leaves the window, the window goes idle after its idle_after)
at NumberValue
from NumberValue
to NumberValue
skeleton Bool: when true, replaces the element (after a 120 ms anti-flicker delay) with a compile-time skeleton projected from its own UI tree, and fades real content in over 150 ms once false; not valid on Query or Skeleton
skeleton_count Number: whole number 1–30 controlling how many repeated placeholder items ForEach, List, Table, PreviewList or Query project

Current components that do not accept the common properties above: WindowSet, Window, Detail, SidebarItem, Section, Slot, Pages, PageContent, Destination, Tab, Layout, MenuItem.

scroll_origin_x and scroll_origin_y are the point that stays still when scroll_scale enlarges the element, taken as a ratio of the element's width and height from 0 to 1, default 0.5 (the center), like CSS transform-origin. at, from and to are used for positioning in a Rail; stagger is used only in Column, Row, Grid, Stack, ForEach and List, which support staggering. The existence of a common property does not mean that it is meaningful in every container.

Popover state and message input

The bubble of PopoverButton(panel_appearance: window) follows the window (the app's appearance choice or the system's), while the trigger button keeps the appearance of the region it is in. When omitted, the bubble inherits the region it is in; it also responds to appearance changes while it is open. panel_appearance: surface chooses according to the current platform style: with a specified background color it follows the window, and a native material bubble inherits the region it is in, so that a glass bubble above a video keeps its dark look and light text. On macOS without a specified background color, the system bubble material is kept (Liquid Glass on systems that support it). On Windows without a specified background color, it is the system's in-app acrylic, which likewise inherits the appearance of the region it is in and is confined to the window. All targets support style! { PopoverButton { background: color(light: "#F2F2F2", dark: "#1E1E1E"), foreground: text.primary } }; the colors apply to the entire bubble surface and its content, not to the trigger button.

PopoverButton(open: app.panel) { … } => app.set_panel(app.panel) replaces the identical state expression in the action with the new open/closed value; opening, dismissing by clicking outside and closing with Escape all go through this action. When open is omitted, presented: draft.panel can still be used, or the component can keep its own state.

On macOS, clicking outside a TextInput releases focus and keeps the draft, and does not block the normal action of the clicked control. Clicking inside still positions the cursor and selects text. submit: clear clears and releases the keyboard immediately after submitting; an input field that waits for server confirmation should use clear_key and increment the number on success, keeping the text on failure. clear_key does not clear on first mount; currently only the SwiftUI backend implements its runtime behavior.

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.