Expand description
ECS component primitives.
Hierarchy components ChildOf and Children are re-exported from bevy_ecs::hierarchy via crate::prelude.
Structs§
- A11y
Announcement - One-shot live-region announcement. Drained by the a11y translation system each tick and emitted as a transient AccessKit node so screen readers speak the string and immediately forget it.
- A11y
Announcement Queue - Queue of pending one-shot announcements. Resource form of
A11yAnnouncementused by scripts (Rhaiannounce(msg, "polite")) that have no entity handle. - A11y
Context Menu Requests - Queue of entities the assistive tech requested context menus for.
- A11y
Description - Accessible description (
aria-description). Distinct fromA11yLabel; screen readers announce label first, then description. - A11y
Label - Accessible label (
aria-label). Distinct fromTextContentso prose markup does not collide with visible body text. - A11y
Level - Hierarchy level for headings (1..6) and tree items (depth from root).
- A11y
Relations - Cross-entity accessibility relations. Mirrors GTK 4
GtkAccessibleRelation. - A11y
Root Label - Optional human-readable label for the AccessKit tree root.
- A11y
Scroll Into View Requests - Queue of entities the assistive tech requested be scrolled into view.
- A11y
SetSize - Position-in-set metadata for list / tree / grid items.
- A11y
State - Boolean accessibility state flags.
- A11y
Value - Bounded numeric value carrier (slider / progress / spin). The
From<&SliderValue> for A11yValueimpl converts existingSliderValuestate without callers having to set both. - Bind
Checked - Two-way binding for
<toggle bind-checked="signal">. - Bind
Disabled - One-way binding for
<button bind-disabled="signal">(any tag). - Bind
Parent Checked - Parent-entity toggle binding:
bind-checked="$parent.field". Stub component; consumer lands in the follow-up commit. - Bind
Parent Text - Parent-entity text binding:
bind-text="$parent.field". The follow-up consumer walks oneChildOfstep up the tree and reads the named field from the parent’s per-entity property bag. - Bind
Parent Value - Parent-entity slider-value binding:
bind-value="$parent.field". Stub component; consumer lands in the follow-up commit. - Bind
Scroll - Two-way binding for
<scroll bind-scroll="signal">(W6 T6). - Bind
Self Checked - Per-entity toggle binding:
bind-checked="$self.field". Stub component; consumer lands in the follow-up commit. - Bind
Self Text - Per-entity text binding:
bind-text="$self.field"lowers to this marker. The follow-up consumer reads the named field from the owning entity’sArrayItem(or other per-entity property bag) each tick and writes it intoTextContent. The field name is stored asArc<str>and shared across instances that bind the same field. - Bind
Self Value - Per-entity slider-value binding:
bind-value="$self.field". Stub component; consumer lands in the follow-up commit. - Bind
Text - Binds this entity’s
TextContentto a named entry incrate::signals::Signals; markupbind-text="counter". - Bind
Value - Two-way binding for
<slider bind-value="signal">. - Border
- Solid border paint record stored on
Visuals::border. Supportsborder-style: solidwith per-side widths (including0= no border on that side) and optional per-side colors. - Caret
Blink - Caret blink phase, shared main-world resource (W2 text-editing core).
- Caret
Width - Per-entity override for
CARET_WIDTH_PX(caret-widthCSS property). Split off as its own tiny component for the same reason asPasswordCharacter. Absent =>CARET_WIDTH_PX. Only meaningful on<input>/<textarea>. - Color
- RGBA color, each channel in [0, 1].
- Default
Layout Direction - Default writing direction for the application root. The
resolve_layout_directionsystem uses this when the root entity has no explicitLayoutDirection. It defaults toLayoutDirection::Ltrand nothing sets it from the locale today, so a right-to-left app still needsdir="rtl"in its markup. - Dirty
A11y - Marker: this entity’s accessibility-relevant state changed.
- Dirty
Layout - Marker: this entity’s layout (or one of its ancestors’) has changed.
- Disabled
- Marker: user input is rejected on this entity.
- Document
Order - Spawn-order tiebreak for focus cycling.
bevy_ecs0.19’sEntity: Ordis a niche-optimized row-index comparison, not a spawn-order one - for entities recycled through a freed ECS row, a later-spawned entity can sort before an earlier one.lumenc::spawnassigns this from a monotonic per-document counter as it walks the parsed tree in markup order, so entities with equalTabIndexcycle in the order they appear in the source, not in whatever order their table rows landed. - Drop
Hovered - Marker: an in-app drag is currently hovering this
DropTargetand its payload is acceptable. Maintained each tick bylumen-os-dnd’s drag-gesture tracker while a drag is active, removed the moment the pointer leaves or the drag ends. Drives the:drag-overpseudo-class (HTML5 DnDdragoverparity) so the hovered drop zone can light up via design tokens. - Drop
Target - Marker: this entity accepts file drops.
- Edges
- Per-edge length values (padding, margin, border). Physical edges
(
left/right/top/bottom) carry the authored values; the optional*_inline_*/*_block_*fields override them per writing direction (W5.5 - CSS Logical Properties Level 1 subset). - Focus
Boundary - Tab-navigation boundary. While the carrier is visible (no
Visiblecomponent or [Visible(true)]), Tab / Shift-Tab cycling stays within its descendants. Applied by<dialog>to trap focus; cycling tolerates nested visible boundaries by keeping focus inside the active one. - Gap
- CSS
gap/row-gap/column-gap- per-axis spacing between adjacent rows / columns of a flex or grid container (W5.9). The previous single-scalargap: f32is reachable viaGap::from(value)for back-compat with existing call sites. - Grid
Template - CSS Grid template - explicit
grid-template-rows+-columnstrack lists (W5.9). Implicit-grid sizing is taffy’s default behaviour for cells placed past the explicit grid. - Image
Blob - Type-erased blob sidecar for an image render entity.
- Image
Component - An image with a backing GPU texture (uploaded asynchronously).
- ImeState
- In-progress IME composition state.
- Inline
Style - Per-element inline style overrides: the DOM
element.stylelayer. Stored as ordered(property, value)pairs so a later write wins and iteration is deterministic. The runtime CSS re-apply reads this LAST (highest cascade tier, above the stylesheet), mirroring how inline style beats author rules in the browser.set_style/style_get/style_removemutate it;computed_stylereflects it after the cascade. - Lang
- BCP-47 language tag (e.g.
"en-US","ar-EG"). Drives text shaping (cosmic_text::Attrs::language), AccessKit (Node::set_language), and locale-aware formatters. - Lumen
Attributes - Generic attribute overflow map for element attributes that have no typed
component of their own (
role,data-*,aria-*, custom attrs). The dynamic DOM API’sset_attr/get_attr/remove_attrroute KNOWN attrs (src, id, class, text, …) to their typed components and everything else here. Attribute names are stored verbatim; values are strings. - Lumen
Classes - Class list assigned in markup via
class="a b c". Apps test membership withLumenClasses::has("tile"). Storage isVec<Arc<str>>so repeated class names share one allocation; cloning performs only Arc bumps. - LumenId
- Stable string id assigned in markup via
id="...". Apps queryQuery<(Entity, &LumenId)>and match by name. - Lumen
Tag - Markup tag name (
tile,label,button, …) retained on entities that carry aclass/id, so the runtime can rebuild a minimal selector target and re-run the CSS cascade in place on a theme / media flip (seelumenc’sreapply_computed_styles). Only attached to selector-reachable entities to keep archetype churn off the plain layout containers that no rule can name. - Memory
Budget - Per-cache memory caps in megabytes, honoured by per-tick LRU eviction across the image, shape, scene-fragment, and GPU-texture caches.
Each cache exposes
bytes_usedandevict_until(target_bytes); a shared system reduces the live total below the cap. Defaults target desktop-class machines; override vialumen.toml [perf]. - Opacity
- Alpha multiplier applied to every drawn aspect of this entity (background fill, gradient, image, SVG, text, shadow, outline).
- Password
Character - Per-entity override for
PASSWORD_MASK_CHAR(password-characterCSS property). Split off as its own tiny component - rather than a field onTextInputPaint- so adding it never touches that component’s existing struct literals elsewhere in the tree (same reasoning asTextInputPaint’s own doc comment). Absent =>PASSWORD_MASK_CHAR. Only meaningful on<input>/<textarea>. - Pending
A11y Update - Latest AccessKit tree update produced by the
sync_a11y_treesystem. - Relayout
Boundary - Marker indicating that the entity’s size is fully determined by parent-imposed constraints (a
<scroll>clip box, fixedwidth/height, or explicitlayout-boundaryattribute). - Resolved
Direction - Cascade output written by
resolve_layout_direction. EitherLayoutDirection::LtrorLayoutDirection::Rtl- neverLayoutDirection::Auto(the resolver folded the inheritance chain). Downstream consumers (layout backend, text shaper, AccessKit) read this instead of walking the hierarchy themselves. - Root
Window Entity - Window-root entity used by the a11y tree as the AccessKit tree root.
- Selected
- Marker: this entity is the currently-selected member of a single-selection group (active tab button today; dropdown current-value button later). Maintained by the owning primitive’s sync system - inserted on the active member, removed from siblings.
- Shadow
Spec - Shadow record stored on
Visuals::shadows. - Slider
Value - Bounded scalar state for
<slider>entities.valueis held in[min, max]; the runtime emitson_slider(id, value)on drag or track click. - Style
- Framework-internal style record. Smaller and renderer-agnostic compared with
taffy::Style; the layout impl crate translates it into its backend type. New fields require a correspondingdirty_maskbit allocation inlumen/src/style_mask.rs. - Style
Manager - Color-scheme arbiter mirroring
AdwStyleManager. Combines the app’s stated intent (scheme) with the last-seen OS preference (system_dark) to produce a single boolean (effective_dark) used by the rest of the pipeline. - SvgPayload
- Type-erased payload sidecar for an SVG render entity.
- TabIndex
- Tab navigation order. Lower values focus first. Negative = not in tab chain.
- Text
Block Origin - Published vertical origin of an entity’s text block (see
text_block_top). - Text
Content - Text payload for text-bearing entities. Stored as its own component so high-frequency keystroke mutation does not bump change detection on the cold
TextStylefields. - Text
Input - Marker: this entity is an editable text input.
- Text
Input Paint - Optional caret + selected-glyph paint overrides for a text input,
split from
TextStyleso they can be added without touching everyTextStylestruct literal in the tree. Sourced from thecaret-color/selection-text-colorCSS properties by the reconciler; absent => the renderer falls back (caret takes the text fill, selected glyphs keep their fill on the translucent highlight). - Text
Input Scroll - Per-input content scroll offset that keeps the caret visible inside the field box (W2 text-editing core).
- Text
Style - Text style record carrying fill color, size, family/weight, alignment, wrap policy, and optional max-line cap.
TextContentis stored separately so keystrokes do not bump change detection on these cold fields. Default: near-white at 16px, weight 400, platform sans-serif, left-aligned, no wrap, unbounded lines. - Title
BarDraggable - Marker: presses on this entity (and hit-bubbled descendants) trigger a native window drag.
Authored by the
<title-bar drag>region; the window backend setsWindowDragRequestand callswinit::Window::drag_window(). - Toggleable
- On/off state for
<toggle>entities. Click flipscheckedand the runtime emitson_toggle(id, checked). - Transform
- Layout-resolved absolute position and size in logical pixels.
- Validation
- Form-field validation rules attached when
<input>,<toggle>, or<slider>declaresrequired/pattern/min/max. Thevalidate_inputssystem inlumen-primitivesrecomputesSelf::is_validfrom the entity’s content and mirrors the result into thevalid:<id>reactive signal. - Visible
- Render gate. When present and set to
false, every extract fn skips the entity (no rect, text, image, outline, or shadow), while layout still allocates space for it. - Visuals
- Visual record for one rect: optional fill (solid or gradient), uniform corner radius, and stacked shadows.
- Window
Drag Request - Window-backend request to begin a native window drag on the next tick.
Populated by the input layer on a press over a
TitleBarDraggableentity; consumed and cleared bylumen-window-winit. - ZIndex
- CSS
z-index- paint-order override among siblings. Higher values paint later (on top). Missing component =auto(0, document order). Consumed byrender_world::build_parent_map, which stable-sorts each entity’s child list by(z_index, document order)before assigning pre-order paint ranks - so an element with a higherz-index(and its whole subtree) paints above its siblings, matching CSS stacking behaviour within one parent stacking context.
Enums§
- A11y
Live - Live-region politeness. Drives
accesskit::Liveon the carrier. - A11y
Role - Explicit accessibility role override. Maps to [
accesskit::Role] through theFrom<A11yRole> for accesskit::Roleimpl inlumen-a11y-accesskit. - Align
Content - CSS
align-contentvalues - distribution of flex lines / grid tracks along the cross axis. - BoxSizing
- CSS
box-sizingvalues. - Color
Scheme - App-side intent for color-scheme resolution; mirrors libadwaita’s
AdwColorScheme. - Display
- CSS
displayvalue. Selects the layout algorithm for the element’s children (W5.9). - Echo
Mode - How a text input renders its content - Qt’s
QLineEdit::EchoMode. - Fill
- Fill brush variants for a
Visualsrect. - Flex
Align - Cross-axis alignment.
- Flex
Direction - Flexbox main-axis direction. Includes the logical *Reverse variants so
the layout backend can flip the inline axis when
ResolvedDirectionisLayoutDirection::Rtl(W5.5). - Flex
Justify - Main-axis distribution.
- Flex
Wrap - CSS
flex-wrapvalues. - Image
Fit - How an image fits its layout rectangle; mirrors CSS
object-fit. Defaults toSelf::Fill(stretch to the entity’sTransform.size). - Layout
Direction - Per-entity layout direction (CSS
direction). Tri-state: - Length
- One-dimensional length specifier.
- Line
Height Spec - Resolved CSS
line-height: either a multiplier of the element’s font size (unitless, e.g.line-height: 1.5) or an absolute value in logical pixels (line-height: 24px). - Overflow
- CSS
overflowvalues. - Position
- CSS
positionvalues. - Text
Align - Horizontal text alignment inside the entity’s content rectangle, stored inside
TextStyleandExtractedText. Defaults toSelf::Start(left in left-to-right reading order). - Text
Wrap - Text wrap policy stored inside
TextStyleandExtractedText. Defaults toSelf::None(no wrap, overflow clips). Mirrors CSSwhite-space: nowrap(None),word-wrap: break-word(Word), and a CJK-style glyph-level break (Glyph). - Track
Size - One track in a grid template - CSS Grid L1 subset.
Constants§
- CARET_
WIDTH_ PX - Default text-input caret stroke width, in logical pixels (
caret-widthCSS property). The single Rust fallback, used when noCaretWidthoverride is present; render paths scale this by the active DPR themselves. - DEFAULT_
LINE_ HEIGHT_ MULTIPLIER - Default CSS
line-height: normalmultiplier - the single Rust fallback used wherever noline-heightvalue reaches the layout / shaping / paint path. Common browsers use ~1.2; Lumen matches that. This is the sole line-height ratio in the codebase;text_block_topandtext_baseline_in_linetake the resolved line height (seeresolve_line_height) rather than re-deriving it fromsize_pxand a hardcoded factor, so an authored CSSline-heightmoves the text block and baseline the same way it moves everything else. - PASSWORD_
MASK_ CHAR - Default glyph substituted for each scalar under
EchoMode::Password: U+2022 BULLET, the platform password convention Qt and the web use. This is the single Rust fallback, used when noPasswordCharacteroverride is present; the CSSpassword-characterproperty authors that override per skin.
Functions§
- apply_
bind_ parent_ checked - No-op consumer stub for
BindParentChecked. Seeapply_bind_self_text. - apply_
bind_ parent_ text - No-op consumer stub for
BindParentText. Seeapply_bind_self_text. - apply_
bind_ parent_ value - No-op consumer stub for
BindParentValue. Seeapply_bind_self_text. - apply_
bind_ self_ checked - No-op consumer stub for
BindSelfChecked. Seeapply_bind_self_text. - apply_
bind_ self_ text - No-op consumer stub for
BindSelfText. Registered so plugin scheduling can already wire it in; the follow-up commit populates the query and reads from the per-entity property bag. Today this is a pure no-op to keep the system graph stable without behavioural change. - apply_
bind_ self_ value - No-op consumer stub for
BindSelfValue. Seeapply_bind_self_text. - hidden_
via_ ancestors - Shared hidden-check for every path that must honour visibility (spec
section 17.4: one visibility story). True when
entityor any ancestor is hidden by either mechanism: - resolve_
layout_ direction - Resolve every entity’s
LayoutDirection(defaulting toLayoutDirection::Autowhen the component is absent) against its ancestor chain and stamp the answer intoResolvedDirection. - resolve_
line_ height - Resolve a possibly-absent CSS
line-heightagainstsize_px, falling back toDEFAULT_LINE_HEIGHT_MULTIPLIER(line-height: normal) when no value was authored. The single fallback-consumption point every line-height-aware call site outside this module should route through, rather than re-derivingsize_px * 1.2locally. - text_
baseline_ in_ line - Baseline offset of a line from the top of its own line box, in logical
pixels. Centers the cap height (a
size_px-derived font metric) inside the resolvedline_height(seeresolve_line_height). - text_
block_ top - Offset from the inner content box top to the top of the FIRST line box,
in logical pixels.
line_heightis the resolved CSS line height (seeresolve_line_height) - the caller passesresolve_line_height(style.line_height, size_px)so an authoredline-heightmoves the block origin the same way it moves the line box.
Type Aliases§
- OsTheme
Deprecated - Backwards-compatible alias for the pre-W4.6
OsThemeresource. New code should useStyleManagerdirectly; the alias keeps existing call sites that still read or writeis_darkcompiling through theDeref/DerefMutshim on the legacy wrapper.