raea/ui

bevy_ui: Node and its layout fields, Text, images, scrolling, gradients and units.

View as Markdown

raea/ui is bevy_ui in TSX. <Node> takes Bevy's layout fields as props (width, flex_direction, justify_content, padding and the rest, with Bevy's defaults), and px, percent, vw and the other units build Bevy's Val. <Text> and <TextSpan> are Bevy's text; <Text2d> is text in the 2D world. Plain HTML elements with CSS work too; these components are for matching Bevy exactly.

TSX
import { staticFile } from "raea";
import { Srgba } from "raea/color";
import { Node, Text, UiRect, percent, px } from "raea/ui";

const Panel = () => (
  <Node width={percent(100)} height={percent(100)} align_items="Center" justify_content="Center" flex_direction="Column">
    <Node width={px(250)} height={px(250)} margin={UiRect.bottom(px(15))} background_color={new Srgba(0.92, 0.14, 0.05)} />
    <Text font={staticFile("fonts/FiraSans-Bold.ttf")} font_size={{ Px: 33 }} color={new Srgba(0.9, 0.9, 0.9)}>Hello</Text>
  </Node>
);
TS
import { AbsoluteFill, ACTION_KEY, actionsIn, AngularColorStop } from "raea/ui"

raea/ui exports 20 components, 1 hook, 12 functions, 30 values, 37 types. Bevy's counterpart: bevy_ui; drawn by Blitz, blitz-bevy.feature B5. Source: sdk/raea/src/ui.ts.

Components

AbsoluteFill

A box over the whole of its parent, laid out as a flex column; style is merged over that.

PropTypeWhat it does
styleCSSPropertiesmerged over the fill's own style (absolute, inset 0, a flex column)
classNamestringTailwind or CSS classes
childrenReactNodewhat fills it

BoxShadowSamples

bevy_ui_render's BoxShadowSamples: the steps each shadow's blur is summed in down its height (4 by default). Bevy sets it on a UI camera; here it wraps the UI that camera draws.

Bevy: bevy_ui_render::BoxShadowSamples.

PropTypeWhat it does
samples (required)numbersteps each shadow's blur is summed in (4)
childrenReactNodethe UI it applies to

Used in: ui/styling/box_shadow.

EditableText

A text input's text, its caret drawn while it has focus.

Bevy: bevy_text::EditableText.

PropTypeWhat it does
childrenstringthe text it starts with (EditableText::new)
visible_linesnumber | nullvisible_lines: its height in lines (1 by default; null leaves the height to the layout)
visible_widthnumber | nullvisible_width: its width in "0"s (None by default: the width it's given)
allow_newlinesbooleanallow_newlines (false by default): Enter adds a line, under input
max_charactersnumber | nullmax_characters (None by default): the most characters typing can make it hold, under input
filter(c: string) => booleanEditableTextFilter: the characters typing may add (each tested alone), under input
read_write_mode"Editable" | "ReadOnly" | "Static"TextReadWriteMode ("Editable" by default): ReadOnly takes no edits, under input; Static draws no caret either
cursor_widthnumbercursor_width: the caret's width as a share of the font size (0.2 by default)
cursor_blink_periodnumbercursor_blink_period in seconds (1 by default)
cursor_styleTextCursorStyleTextCursorStyle
auto_focusbooleanAutoFocus: it has the input focus, so its caret is drawn
justifyTextProps["justify"]TextLayout's justify and linebreak
linebreakTextProps["linebreak"]where lines break: WordBoundary, AnyCharacter, WordOrCharacter or NoWrap

Also takes the props of NodeProps; PickProps (popover, onClick, onPointerDown, onPointerUp, onPointerOver, onPointerOut, onPointerEnter, onPointerLeave, onPointerMove); TextStyleProps.

Used in: ui/text/multiline_text_input, ui/text/multiple_text_inputs, ui/text/editable_text_filter, ui/text/ime_support, ui/text/text_input, ui/widgets/virtual_keyboard.

GhostNode

bevy_ui's GhostNode: no box of its own, its children laid out as its parent's (CSS display: contents), each one a root when it is at the top.

Bevy: bevy_ui::experimental::GhostNode.

PropTypeWhat it does
childrenReactNodewhat's laid out as the parent's children

Used in: ui/layout/ghost_nodes.

GlobalUiDebugOptions

bevy_ui's GlobalUiDebugOptions: the debug overlay for every node inside that has no UiDebugOptions of its own (a node's ui_debug).

Bevy: bevy_ui_render::GlobalUiDebugOptions.

PropTypeWhat it does
childrenReactNodethe UI the overlay draws over

Also takes the props of UiDebugOptions.

Used in: ui/images/image_node_resizing.

ImageNode

bevy_ui's ImageNode: a Node showing a picture stretched over its content box (inside its padding and border), sized by the picture when its width or height is auto, as bevy_ui's ImageNodeSize measures it. No children (an ).

Bevy: bevy_ui::widget::image::ImageNode.

PropTypeWhat it does
image (required)string | { path: string; sampler: SamplerSpec }the picture: staticFile("branding/icon.png"), or one with its own sampler ({ path, sampler: { filter: "nearest" } }, Bevy's load_with_settings)
colorSrgbaits tint: white (none) by default; only white or a grey multiplies here yet (a picture's brightness)
flip_xbooleanBevy: Whether the image should be flipped along its x-axis.
flip_ybooleanBevy: Whether the image should be flipped along its y-axis.
texture_atlas{ layout: TextureAtlasLayout; index: number }TextureAtlas: the one cell of a sheet laid out by a TextureAtlasLayout to draw (the picture is the sheet)
image_mode"Auto" | "Stretch" | { Sliced: TextureSlicer }NodeImageMode: "Auto" (the default) sizes the node by the picture and draws it contained in the content box, its aspect kept; "Stretch" gives the node no size of its own and stretches the picture over its content box; Sliced cuts the picture in nine by a TextureSlicer (its corners kept, its sides and centre stretched or tiled), drawn as CSS border-image with bevy_ui's scale; a sliced ImageNode holds children

Also takes the props of NodeProps; PickProps (popover, onClick, onPointerDown, onPointerUp, onPointerOver, onPointerOut, onPointerEnter, onPointerLeave, onPointerMove).

Used in: ui/images/image_node, ui/images/ui_texture_slice_flip_and_tile, ui/images/image_node_resizing, ui/images/ui_texture_atlas_slice, ui/images/ui_texture_slice, ui/images/ui_texture_atlas, ui/ui_transform, ui/scroll_and_overflow/overflow, and 5 more.

ImagePlugin

bevy_image's ImagePlugin: its default_sampler for every picture drawn inside it (Linear by default; ImagePlugin::default_nearest() is default_sampler="Nearest", for pixel art).

Bevy: bevy_image::ImagePlugin.

PropTypeWhat it does
default_sampler"Linear" | "Nearest""Linear" (the default) or "Nearest" (pixel art)
childrenReactNodethe UI and sprites whose pictures it samples

Used in: ui/images/ui_texture_atlas.

InlineImage

bevy_ui's InlineImage: a picture in a 's line, as an inline box on its baseline (bevy_text's parley lays it out so, and Blitz's parley here), width and height px (the other by its aspect, or its own size), tinted by color (each pixel times it: the picture multiplied over the tint, its own alpha the mask).

Bevy: bevy_ui::widget::InlineImage.

PropTypeWhat it does
image (required)stringBevy: Handle to the texture.
colorColorBevy: The tint color used to draw the image.
widthnumberBevy: Set a fixed width in logical pixels for the image's inline box target.
heightnumberBevy: Set a fixed height in logical pixels for the image's inline box target.

Used in: ui/text/inline_image.

MaterialNode

A node its own fragment shader draws (MaterialNode(handle) with a UiMaterial asset in Bevy).

Bevy: bevy_ui_render::ui_material::MaterialNode.

PropTypeWhat it does
fragment (required)stringthe fragment shader's file, as UiMaterial::fragment_shader names one: staticFile("shaders/x.wesl")
uniformsRecord<string, Uniform | Record<string, Uniform>>each var<uniform> the shader declares, by name: a number, [x, y], [x, y, z], [x, y, z, w] (a LinearRgba's to_f32_array()) or "#rrggbb"; a struct's as {field: value}
texturesRecord<string, string>each texture_2d<f32> it declares, by name: a picture file (staticFile), sampled with Bevy's default sampler
defsRecord<string, boolean | number>shader defs, as a Material's
childrenReactNodethe nodes inside it

Also takes the props of NodeProps; PickProps (popover, onClick, onPointerDown, onPointerUp, onPointerOver, onPointerOut, onPointerEnter, onPointerLeave, onPointerMove).

Used in: ui/ui_material.

Node

A box of Bevy's UI, laid out as bevy_ui lays it (taffy, with Bevy's defaults). Put it over the 3D in an (after the ): each root fills the frame as Bevy's window.

Bevy: bevy_ui::ui_node::Node.

Takes NodeProps's props.

Used in: ui/images/image_node, ui/images/ui_texture_slice_flip_and_tile, ui/images/image_node_resizing, ui/images/ui_texture_atlas_slice, ui/images/ui_texture_slice, ui/images/ui_texture_atlas, ui/layout/grid, ui/layout/ghost_nodes, and 56 more.

Region

A box at the band its name stands for, clear of the face perception found at this frame.

PropTypeWhat it does
nameRegionNamethe band: "auto" (default) takes the larger of top and bottom; top and bottom stay clear of the face; center is the middle third; full is the safe area
marginnumberthe gap kept from the face and the sides, as a share of the width (0.06)
styleCSSPropertiesmerged under the box's own placement
classNamestringTailwind or CSS classes
childrenReactNodewhat goes in the band; useRegion() reads its box

Scrollbar

A scrollbar's track: its ScrollbarThumb inside shows how much of its target is in view and where.

Bevy: bevy_ui_widgets::Scrollbar.

PropTypeWhat it does
target (required)stringthe Name of the Node it scrolls (an overflow Scroll one)
orientation (required)ControlOrientationBevy: Whether the scrollbar is vertical or horizontal.
min_thumb_length (required)numberthe thumb's least length, px
childrenReactNodeits ScrollbarThumb

Also takes the props of NodeProps; PickProps (popover, onClick, onPointerDown, onPointerUp, onPointerOver, onPointerOut, onPointerEnter, onPointerLeave, onPointerMove).

Used in: ui/scroll_and_overflow/scrollbars.

ScrollbarThumb

A Scrollbar's thumb: the track's width across it, its length the share of the target in view.

Bevy: bevy_ui_widgets::ScrollbarThumb.

PropTypeWhat it does
border_radiusBorderRadiusBevy: Border radius of the scrollbar thumb, used to update ComputedNode::border_radius in UiSystems::Layout.
borderUiRectthe border's width on each side
background_colorNodeProps["background_color"]BackgroundColor
border_colorNodeProps["background_color"]BorderColor, every side

Used in: ui/scroll_and_overflow/scrollbars.

Text

Bevy's UI text: a Node whose content is its string and its children, in its TextFont, TextColor, TextLayout and LineHeight (Bevy's defaults when left out).

Bevy: bevy_ui::widget::text::Text.

Takes TextProps's props.

Used in: ui/images/image_node_resizing, ui/images/ui_texture_atlas_slice, ui/images/ui_texture_slice, ui/images/ui_texture_atlas, ui/layout/grid, ui/layout/ghost_nodes, ui/layout/flex_layout, ui/layout/size_constraints, and 47 more.

Text2d

Text in Bevy's 2D world, its block's centre at its Transform (Text2d; Bevy's Anchor::CENTER unless anchor says). bevy_text lays it out as a 's. Inside a it is Bevy's own Text2d (text2d.tsx), ordered with the 2D parts by z; after it, in the , it is that Text placed on the frame, over the 2D and 3D parts.

Bevy: bevy_sprite::text2d::Text2d.

PropTypeWhat it does
transformTransformValueits place in Bevy's 2D world: the frame's centre the origin, +Y up, a unit a pixel, turns counterclockwise
justify"Left" | "Center" | "Right" | "Justified" | "Start" | "End"how its lines line up with each other (TextLayout's Justify, Left by default)
linebreak"WordBoundary" | "AnyCharacter" | "WordOrCharacter" | "NoWrap"TextLayout's LineBreak (WordBoundary by default); inside a Canvas3D
anchor[number, number]Bevy's Anchor, as its Vec2: which point of the block sits at its Transform, [-0.5, -0.5] its bottom left to [0.5, 0.5] its top right ([0, 0], the centre, by default; Anchor::TOP_CENTER is [0, 0.5])
bounds[number | null, number | null]TextBounds: the box its lines wrap in, [width, height] px (either null, unbounded), the anchor then the box's point; inside a Canvas3D
shadowText2dShadow | trueText2dShadow (true for its default); inside a Canvas3D
childrenReactNodethe text, and TextSpan runs

Also takes the props of TextStyleProps; TextRunProps (underline, strikethrough, underline_color, strikethrough_color, text_background_color).

Used in: shader/pipeline_constants, 2d/text2d, 2d/sprite_slice, 2d/texture_atlas, 2d/sprite_scale, 2d/mesh2d_repeated_texture.

TextSpan

A run of a in a style of its own (Bevy's defaults, not its Text's, where left out).

Bevy: bevy_text::text::TextSpan.

PropTypeWhat it does
childrenReactNodethe run's text

Also takes the props of TextStyleProps; TextRunProps (underline, strikethrough, underline_color, strikethrough_color, text_background_color).

Used in: ui/images/ui_texture_atlas, ui/scroll_and_overflow/overflow_debug, ui/text/text_debug, ui/text/text_background_colors, ui/text/inline_image, ui/text/strikethrough_and_underline, ui/text/text, 2d/text2d.

UiScale

bevy_ui's UiScale: every UI length inside times value (2 draws a 16 px node 32 px), as CSS's zoom: laid out and its text shaped at that size, in physical px, as Bevy lays out (a 3 px padding at 1.25 is 4 px, not 3 drawn 1.25 times as big). Text2d and the 2D and 3D parts aren't UI, so they stay as they are.

Bevy: bevy_ui::UiScale.

PropTypeWhat it does
value (required)numberhow many times as big the UI is drawn (UiScale)
childrenReactNodethe UI it scales

Used in: ui/images/ui_texture_slice_flip_and_tile, ui/scroll_and_overflow/scrollbars, ui/scroll_and_overflow/drag_to_scroll.

UiTargetCamera

The roots inside drawn by their own Camera2d (bevy_ui's UiTargetCamera): a layer over the whole window, stacked by the camera's order as Bevy draws its cameras, lowest first. Cameras on one window share its main texture, which only the first of them clears (bevy_render's ViewTarget, its first call), so the window's clear is the layered 's and a later camera's own clear colour shows nowhere. Roots outside any are the default camera's (the highest order).

Bevy: bevy_ui::UiTargetCamera.

PropTypeWhat it does
ordernumberthe camera, by its order, these roots draw with (0)
childrenReactNodethe UI roots that camera draws

Used in: ui/ui_target_camera, 3d/split_screen.

UiTexture

The UI roots inside drawn into target instead of the window (a Camera2d with RenderTarget::Image, the roots' UiTargetCamera): laid out in a box the image's size, see-through where they draw nothing, and nowhere in the frame itself. A root's 100% is the image's size.

Bevy: bevy_camera::RenderTarget::Image.

PropTypeWhat it does
target (required)stringthe image's name, as a material or ImageNode uses it
childrenReactNodethe UI roots drawn into it

Used in: ui/render_ui_to_texture.

Viewport

The UI camera's viewport (bevy_camera's Viewport on the Camera2d the UI draws through): its roots lay out in this region of the window, physical_position from its top left and physical_size big (px, at a scale factor of 1), and are clipped to it.

Bevy: bevy_camera::Viewport.

PropTypeWhat it does
physical_position (required)[number, number]the region's top-left corner, px from the window's
physical_size (required)[number, number]the region's width and height, px
childrenReactNodethe cameras and UI drawn into the region

Used in: ui/relative_cursor_position, 3d/split_screen.

Hooks

useRegion

The Region this is rendered inside: its name and box in composition px.

TS
function useRegion(): RegionBox

Functions

actionsIn

The actions handed in this frame, in order.

TS
function actionsIn(input: FrameInput): { name: string; args: any; }[]

applyActions

state with this frame's handed-in actions run on it, in order (an unknown name is skipped).

TS
function applyActions<S>(actions: PanelActions<S>, state: S, input: FrameInput): S

feedIn

What the app tells the panels, by name ("transcript", "object"); undefined until it has.

TS
function feedIn<T = any>(input: FrameInput, what: string): T | undefined

percent

Bevy's Val::Percent: of the parent's size on that axis (padding and margin: its width, as CSS)

TS
function percent(n: number): string

Used in: ui/images/image_node, ui/images/ui_texture_slice_flip_and_tile, ui/images/image_node_resizing, ui/images/ui_texture_atlas_slice, ui/images/ui_texture_slice, ui/images/ui_texture_atlas, ui/layout/grid, ui/layout/ghost_nodes, and 44 more.

proofBoxes

Checks measured part boxes; returns one fault per problem, empty when all is well.

TS
function proofBoxes({ width, height, face, parts }: ProofInput): string[]

px

Bevy's Val::Px: logical pixels

TS
function px(n: number): string

Used in: ui/images/image_node, ui/images/ui_texture_slice_flip_and_tile, ui/images/image_node_resizing, ui/images/ui_texture_atlas_slice, ui/images/ui_texture_slice, ui/images/ui_texture_atlas, ui/layout/grid, ui/layout/ghost_nodes, and 57 more.

regionBand

Works out the vertical band each name stands for, given perception and the composition size.

TS
function regionBand(name: RegionName, width: number, height: number, perception: Perception, margin?: number): Band

targetImage

An image the UI inside a is drawn into, width x height px (bevy_image's Image::new_target_texture): pass it to a material's texture field, e.g. StandardMaterial's base_color_texture. The name tells one target from another (and from the composition's s).

Bevy: bevy_image::Image::new_target_texture.

TS
function targetImage(name: string, width: number, height: number): string

Used in: ui/render_ui_to_texture.

vh

Bevy's Val::Vh: percent of the viewport's height

TS
function vh(n: number): string

Used in: ui/styling/stacked_gradients, ui/text/letter_spacing.

vmax

Bevy's Val::VMax: percent of the viewport's larger side

TS
function vmax(n: number): string

vmin

Bevy's Val::VMin: percent of the viewport's smaller side

TS
function vmin(n: number): string

vw

Bevy's Val::Vw: percent of the viewport's width

TS
function vw(n: number): string

Used in: ui/text/letter_spacing.

Values

ACTION_KEY

The prefix the app puts on an action handed in as input: a key action:NAME ARGS_JSON, held for one frame.

AngularColorStop

bevy_ui's AngularColorStop: a colour at angle radians round a conic gradient (spaced evenly when left out).

Bevy: bevy_ui::gradients::AngularColorStop.

Used in: ui/styling/stacked_gradients, ui/styling/gradients.

auto

Bevy's Val::Auto

Used in: ui/text/text_input.

BorderRadius

Bevy's BorderRadius: a Val (circular) or a CornerRadius (elliptical) for each corner (0 by default).

Used in: ui/layout/ghost_nodes, ui/navigation/directional_navigation_overrides, ui/navigation/directional_navigation, ui/scroll_and_overflow/scrollbars, ui/scroll_and_overflow/overflow_transform, ui/render_ui_to_texture, ui/ui_material, ui/styling/gradients, and 7 more.

BoxShadow

bevy_ui's BoxShadow: drop shadows under a node, drawn back to front.

Bevy: bevy_ui::BoxShadow.

Used in: ui/scroll_and_overflow/overflow_transform, ui/styling/box_shadow, ui/widgets/standard_widgets.

ColorStop

bevy_ui's ColorStop: a colour at point along the gradient (spaced evenly when left out, as CSS's), and hint, where between it and the next the colour is half way (0.5, linear, by default).

Bevy: bevy_ui::gradients::ColorStop.

Used in: ui/styling/stacked_gradients, ui/styling/gradients.

ConicGradient

bevy_ui's ConicGradient: from start radians (0 up, clockwise) round position.

Bevy: bevy_ui::gradients::ConicGradient.

Used in: ui/styling/stacked_gradients, ui/styling/gradients.

CornerRadius

Bevy's CornerRadius: a corner's x and y radii, an elliptical corner (a Val alone is a circular one).

Used in: ui/styling/borders.

FEED_KEY

The prefix of the keys the app hands every panel for what it knows: feed:transcript (the conversation's last lines, [{ who: "you" | "agent" | "tool" | "note", text, live }]), feed:object (the object on the stage: { name, kind }) and feed:stage (what the object publishes with data-feed-publish, as a panel's publishes reach the object) and feed:player (the stage's player: { frame, frames, rate, playing }; frames is 0 for a game, which runs on). Handed in only on the frame it changes (and when the panel opens), so keep it in state: useGameState([], (s, input) => feedIn(input, "transcript") ?? s). A panel standing in for the terminal sends by publishing { send: { n, text } } (a higher n is a new message); a panel drives the player by publishing { control: { n, do: "play" | "pause" | "seek", frame } } the same way.

FontAtlasSet

bevy_text's FontAtlasSet, the glyph atlases Bevy's text is drawn from, for one face at one size: atlases(font, font_size, text) is the pages a Text of text in the font file font at font_size px fills, each glyph rasterized and packed by bevy_text's own code (natively) in the order its layout meets them. A text that grows a character at a time fills them as its last version does.

Bevy: bevy_text::FontAtlasSet.

Used in: ui/text/font_atlas_debug.

FontCx

bevy_text's FontCx, the font collection Bevy's text resolves families in: family_names() lists the system's families (natively, by fontique as Bevy's collection has them), sorted and each once.

Bevy: bevy_text::FontCx.

Used in: ui/text/system_fonts.

FontFeatureTag

bevy_text's FontFeatureTag: the registered OpenType features' tags.

Bevy: bevy_text::FontFeatureTag.

Used in: ui/text/text.

FontSource

bevy_text's FontSource: a font file (a string, staticFile("fonts/x.ttf")), { Family } by name, or { Generic }.

Bevy: bevy_text::FontSource.

Used in: ui/text/system_fonts, ui/text/generic_font_families, ui/text/ime_support.

FontVariationTag

bevy_text's FontVariationTag: the registered axes' OpenType tags.

Bevy: bevy_text::FontVariationTag.

Used in: ui/text/font_variations.

FontWidth

bevy_text's FontWidth: a face's width as a share of its normal one (CSS's font-stretch), for a Text's font_width.

Bevy: bevy_text::FontWidth.

Used in: ui/text/font_query.

GridPlacement

bevy_ui's GridPlacement: a start line, an end line (1-based, negative from the end) and a span (1 by default).

Bevy: bevy_ui::GridPlacement.

Used in: ui/images/image_node_resizing, ui/layout/grid, ui/layout/anchor_layout, ui/ui_drag_and_drop, ui/scroll_and_overflow/scrollbars, ui/scroll_and_overflow/drag_to_scroll, ui/text/multiple_text_inputs, ui/text/generic_font_families.

GridTrack

bevy_ui's GridTrack: a track sized between its min and max sizing functions.

Bevy: bevy_ui::GridTrack.

Used in: ui/images/image_node_resizing, ui/layout/grid, ui/text/system_fonts, ui/text/multiple_text_inputs.

LinearGradient

bevy_ui's LinearGradient: angle radians, 0 up and clockwise.

Bevy: bevy_ui::gradients::LinearGradient.

Used in: ui/styling/stacked_gradients, ui/styling/gradients.

Overflow

Bevy's Overflow: each axis Visible, Clip, Hidden or Scroll.

Used in: ui/scroll_and_overflow/overflow, ui/scroll_and_overflow/scrollbars, ui/scroll_and_overflow/drag_to_scroll, ui/scroll_and_overflow/scroll, ui/scroll_and_overflow/overflow_clip_margin, ui/text/multiple_text_inputs, ui/text/text_wrap_debug, ui/widgets/headless_tabs.

OverflowClipMargin

Bevy's OverflowClipMargin: the box an overflow clip clips to, grown by a margin in px (the padding box by default).

Used in: ui/scroll_and_overflow/overflow_clip_margin, ui/text/multiple_text_inputs.

RadialGradient

bevy_ui's RadialGradient: centred, ClosestCorner by default.

Bevy: bevy_ui::gradients::RadialGradient.

Used in: ui/styling/stacked_gradients, ui/styling/gradients.

RepeatedGridTrack

bevy_ui's RepeatedGridTrack: tracks repeated. bevy_ui's RepeatedGridTrack constructors: each GridTrack's, repeated repetition times.

Bevy: bevy_ui::RepeatedGridTrack.

Used in: ui/layout/grid, ui/layout/anchor_layout, ui/scroll_and_overflow/scrollbars, ui/scroll_and_overflow/drag_to_scroll, ui/scroll_and_overflow/overflow_debug, ui/scroll_and_overflow/scroll, ui/text/multiline_text_input, ui/text/multiple_text_inputs, and 1 more.

Rot2

bevy_math's Rot2: a rotation by its cosine and sine; positive turns a UI node clockwise.

Bevy: bevy_math::Rot2.

Used in: ui/ui_transform, ui/navigation/directional_navigation, ui/scroll_and_overflow/overflow_debug, ui/scroll_and_overflow/overflow_transform.

SPACE_KEY

The prefix of the key the app holds on the stage for each panel that publishes (data-feed-publish on an element): space:PANEL JSON, held while the value stands, so the object on the stage reads what the panels picked.

TextShadow

bevy_ui's TextShadow.

Bevy: bevy_ui::widget::text::TextShadow.

Used in: ui/text/text, ui/widgets/standard_widgets, ui/widgets/button, ui/widgets/standard_widgets_observers.

TextureAtlasLayout

bevy_image's TextureAtlasLayout: a sheet's size and its cells' rects in px.

Bevy: bevy_image::TextureAtlasLayout.

Used in: ui/images/ui_texture_atlas_slice, ui/images/ui_texture_atlas.

UiPosition

bevy_ui's UiPosition: a point of the node, anchor from its centre (each axis -0.5 to 0.5 of its size), moved x and y from there: right and down from a left, top or centre anchor, left and up from a right or bottom one.

Bevy: bevy_ui::UiPosition.

Used in: ui/styling/stacked_gradients, ui/styling/gradients.

UiRect

Bevy's UiRect: a Val for each side (0 by default).

Used in: ui/images/image_node, ui/images/image_node_resizing, ui/images/ui_texture_atlas_slice, ui/images/ui_texture_slice, ui/layout/grid, ui/layout/ghost_nodes, ui/layout/flex_layout, ui/layout/size_constraints, and 43 more.

UiTransform

bevy_ui's UiTransform: the node scaled, then turned, then moved, about its centre, after layout.

Bevy: bevy_ui::ui_transform::UiTransform.

Used in: ui/ui_transform, ui/navigation/directional_navigation, ui/scroll_and_overflow/overflow_debug, ui/scroll_and_overflow/overflow_transform.

Val2

bevy_ui's Val2: a translation's x and y (a percent of the node's own width and height; auto is 0).

Bevy: bevy_ui::ui_transform::Val2.

Used in: ui/scroll_and_overflow/overflow_debug.

Types

AbsoluteFillProps

The props of AbsoluteFill, tabled there.

ControlOrientation

bevy_ui_widgets' ControlOrientation.

Bevy: bevy_ui_widgets::ControlOrientation.

TS
type ControlOrientation = "Horizontal" | "Vertical"

EditableTextProps

The props of EditableText, tabled there.

FontAtlas

One page of bevy_text's glyph atlas: its texture (a PNG data: URL, which an ImageNode shows) and its size.

Bevy: bevy_text::FontAtlas.

FieldTypeWhat it is
texture (required)stringBevy: The texture where this font atlas is located
width (required)numberthe texture's width in px
height (required)numberthe texture's height in px

GenericFontFamily

bevy_text's GenericFontFamily.

Bevy: bevy_text::GenericFontFamily.

TS
type GenericFontFamily = "Serif" | "SansSerif" | "Cursive" | "Fantasy" | "Monospace" | "SystemUi" | "UiSerif" | "UiSansSerif" | "UiMonospace" | "UiRounded" | "Emoji"

Gradient

One of bevy_ui's Gradients.

Bevy: bevy_ui::gradients::Gradient.

TS
type Gradient = | { kind: "Linear"; angle: number; stops: ColorStop[]; color_space?: InterpolationColorSpace } | { kind: "Radial"; position: UiPosition; shape: RadialGradientShape; stops: ColorStop[]; color_space?: InterpolationColorSpace } | { kind: "Conic"; start: number; position: UiPosition; stops: AngularCo…

GridAutoFlow

bevy_ui's GridAutoFlow.

Bevy: bevy_ui::GridAutoFlow.

TS
type GridAutoFlow = "Row" | "Column" | "RowDense" | "ColumnDense"

GridTrackRepetition

bevy_ui's GridTrackRepetition: a count, or as many as fit (AutoFill), the empty ones collapsed (AutoFit).

Bevy: bevy_ui::GridTrackRepetition.

TS
type GridTrackRepetition = number | "AutoFill" | "AutoFit"

IgnoreScroll

bevy_ui's IgnoreScroll: the axes on which a node keeps its place while its parent scrolls (BVec2).

Bevy: bevy_ui::IgnoreScroll.

FieldTypeWhat it is
x (required)booleanit keeps its place while the parent scrolls across
y (required)booleanit keeps its place while the parent scrolls down

ImageNodeProps

The props of ImageNode, tabled there.

InterpolationColorSpace

bevy_ui's InterpolationColorSpace: Oklaba by default.

Bevy: bevy_ui::gradients::InterpolationColorSpace.

TS
type InterpolationColorSpace = "Oklaba" | "Oklcha" | "OklchaLong" | "Srgba" | "LinearRgba" | "Hsla" | "HslaLong" | "Okhsla" | "OkhslaLong"

MaterialNodeProps

The props of MaterialNode, tabled there.

MaxTrackSizingFunction

bevy_ui's MaxTrackSizingFunction: a MinTrackSizingFunction, a Fraction of the free space, or a fit-content limit.

Bevy: bevy_ui::MaxTrackSizingFunction.

TS
type MaxTrackSizingFunction = MinTrackSizingFunction | { Fraction: number } | { FitContentPx: number } | { FitContentPercent: number }

MinTrackSizingFunction

bevy_ui's MinTrackSizingFunction.

Bevy: bevy_ui::MinTrackSizingFunction.

TS
type MinTrackSizingFunction = | "Auto" | "MinContent" | "MaxContent" | { Px: number } | { Percent: number } | { Rem: number } | { Vw: number } | { Vh: number } | { VMin: number } | { VMax: number }

NodeProps

bevy_ui's Node: its layout fields as Bevy names them (each Bevy's default when left out), and the components that draw it: background_color (BackgroundColor), border_color (BorderColor, every side), z_index (ZIndex).

Bevy: bevy_ui::Node.

PanelAction

One action: what it does (for the agent), its arguments by name with a few words each, and what it does to the panel's state.

FieldTypeWhat it is
about (required)stringwhat the action does, for the agent
argsRecord<string, string>its arguments by name, a few words each
run (required)(state: S, args: A) => Sthe panel's state after it

PanelActions

TS
type PanelActions = Record<string, PanelAction<S>>

Popover

A popup placed beside its parent's box (inside its border) after layout, at the first of positions the window (less window_margin px) hides least; absolutely positioned, as Bevy's position_popover makes it.

Bevy: bevy_ui_widgets::popover::Popover.

FieldTypeWhat it is
positions (required)PopoverPlacement[]Bevy: List of potential positions for the popover element relative to the parent.
window_marginnumberBevy: Indicates how close to the window edge the popup is allowed to go.

PopoverPlacement

One of a Popover's placements beside its parent.

Bevy: bevy_ui_widgets::popover::PopoverPlacement.

FieldTypeWhat it is
side"Top" | "Bottom" | "Left" | "Right"PopoverSide: Bottom by default
align"Start" | "End" | "Center"PopoverAlign: which edges line up along that side, Start by default
gapnumberthe gap from the parent, in px (0 by default)

ProofInput

FieldTypeWhat it is
width (required)numberthe composition's width, px
height (required)numberthe composition's height, px
faceRectthe face's box, when perception found one
parts (required)ProofPart[]the measured boxes of the parts to check

ProofPart

FieldTypeWhat it is
name (required)stringthe part's name, in the faults
band[number, number]the band the part must fit in, [top, bottom] in px
x (required)numberthe left edge, px
y (required)numberthe top edge, px
w (required)numberwidth, px
h (required)numberheight, px

RadialGradientShape

bevy_ui's RadialGradientShape (ClosestCorner by default): Bevy's ClosestSide and FarthestSide are circles to the nearest or farthest side, its ClosestCorner and FarthestCorner ellipses through the nearest or farthest sides on each axis (CSS's closest-side and farthest-side ellipses), Circle a radius, Ellipse two.

Bevy: bevy_ui::gradients::RadialGradientShape.

TS
type RadialGradientShape = "ClosestSide" | "FarthestSide" | "ClosestCorner" | "FarthestCorner" | { Circle: Val } | { Ellipse: [Val, Val] }

RegionBox

The band a Region occupies, in composition px.

FieldTypeWhat it is
name (required)RegionNamethe band it took: top, bottom, center or full ("auto" resolves to top or bottom)
x (required)numberthe left edge, px
y (required)numberthe top edge, px
w (required)numberwidth, px
h (required)numberheight, px

RegionName

TS
type RegionName = "auto" | "top" | "bottom" | "center" | "full"

RegionProps

The props of Region, tabled there.

ScrollbarProps

The props of Scrollbar, tabled there.

ScrollbarThumbProps

The props of ScrollbarThumb, tabled there.

ShadowStyle

bevy_ui's ShadowStyle: one drop shadow's colour, offset, spread and blur.

Bevy: bevy_ui::ShadowStyle.

FieldTypeWhat it is
color (required)unknownBevy: The shadow's color
x_offset (required)ValBevy: Horizontal offset
y_offset (required)ValBevy: Vertical offset
spread_radius (required)ValBevy: How much the shadow should spread outward.
blur_radius (required)ValBevy: Blurriness of the shadow

SliceScaleMode

bevy_ui's SliceScaleMode: a side or the centre stretched, or tiled every slice x stretch_value px from its start

TS
type SliceScaleMode = "Stretch" | { Tile: { stretch_value: number } }

Text2dProps

The props of Text2d, tabled there.

TextCursorStyle

bevy_text's TextCursorStyle (color: SLATE_700 by default).

Bevy: bevy_text::TextCursorStyle.

FieldTypeWhat it is
colorColorBevy: Color of the cursor
selection_colorColorBevy: Background color of selected text
unfocused_selection_colorColorBevy: Background color of unfocused selected text
selected_text_colorColorBevy: If some, overrides the color of selected text
selection_radiusnumberBevy: Corner radius of selection highlight rectangles, normalized relative to the selection height.

TextProps

TextRunProps

What bevy_text draws with a section's own glyphs (a Text's string, not its spans; a TextSpan's run).

FieldTypeWhat it is
underlinebooleanUnderline and Strikethrough: a line under or through the run, as thick as the font says
strikethroughbooleana line through the run
underline_colorColorUnderlineColor and StrikethroughColor: the lines' colours (the text's colour by default)
strikethrough_colorColorthe strikethrough's colour (the text's by default)
text_background_colorColorTextBackgroundColor: a box behind the run, line by line

TextStyleProps

bevy_text's TextFont, TextColor, TextLayout and LineHeight, on a Text or a TextSpan.

Bevy: bevy_text::TextFont.

FieldTypeWhat it is
fontFontSourceFontSource: a font file (staticFile("fonts/FiraSans-Bold.ttf")), FontSource.family(name) or a generic family (FontSource.serif()); Bevy's default font when left out
font_sizenumber | { Px: number } | { Rem: number } | { Vw: number } | { Vh: number } | { VMin: n…Bevy's FontSize: a number of px, or { Px }, { Rem } (of bevy_text's 20 px rem), { Vw }, { Vh }, { VMin }, { VMax }
weightnumberFontWeight: 100 to 900 (400 by default)
style"Normal" | "Italic" | "Oblique"Bevy: The slant style of a font face: normal, italic, or oblique.
font_widthnumberTextFont's width (FontWidth): a share of the face's normal width, FontWidth.CONDENSED 0.75 (1 by default)
colorColorTextColor: white by default
line_height{ Px: number } | { RelativeToFont: number }LineHeight: { Px } or { RelativeToFont } (1.2 of the size by default)
font_variationsRecord<string, number>FontVariations: a variable font's axes by their four-letter tag, { [FontVariationTag.WEIGHT]: 300 }
font_featuresRecord<string, number>FontFeatures: OpenType features by their four-letter tag, 1 to turn one on, { [FontFeatureTag.SMALL_CAPS]: 1 }
letter_spacing{ Px: number } | { Rem: number }LetterSpacing: { Px } or { Rem } (of bevy_text's 20 px rem) after every glyph (none by default)
font_smoothing"AntiAliased" | "None"TextFont's FontSmoothing: "None" draws the glyphs unantialiased (a inside a Canvas3D only)

TextureSlicer

bevy_sprite's TextureSlicer: the slices' insets in the picture's px, how the sides and centre scale (Stretch by default), and the corners' most scale (1 by default)

FieldTypeWhat it is
border (required){ left: number; right: number; top: number; bottom: number }the slices' insets, in the picture's px
center_scale_modeSliceScaleModehow the centre scales (Stretch)
sides_scale_modeSliceScaleModehow the sides scale (Stretch)
max_corner_scalenumberhow much the corners may scale at most (1)

UiDebugOptions

bevy_ui's UiDebugOptions (and GlobalUiDebugOptions): which of a node's boxes to outline, how thick (px), in what colour (each node its own by default), and whether a clipped or hidden node's outline shows. Every field Bevy's default when left out.

Bevy: bevy_ui_render::UiDebugOptions.

FieldTypeWhat it is
enabledbooleanBevy: Set to true to enable the UI debug overlay
outline_border_boxbooleanBevy: Show outlines for the border boxes of UI nodes
outline_padding_boxbooleanBevy: Show outlines for the padding boxes of UI nodes
outline_content_boxbooleanBevy: Show outlines for the content boxes of UI nodes
line_widthnumberBevy: Width of the overlay's lines in logical pixels
line_color_overrideSrgbaone colour for every outline, instead of each node's (Hsla::sequential_dispersed of its index)
show_clippedbooleanan outline not cut by its ancestors' overflow

Val

A bevy_ui Val as CSS: px(12) is "12px", percent(50) "50%", auto "auto".

TS
type Val = string