Skip to main content

Rules: Controls and layout

scripts/gen-rules.mjs builds this page from rules/*.json. Do not edit it by hand; edit the JSON and run npm run gen-rules. The rule bullets on topic pages (- **[ID]**) are filled from the same source.

Explanations and examples are on the topic page Controls and layout.

IDRuleLevelEvidence environmentSource
LAY-01Judge the list of valid types by vanilla usage, not by the official enum. The official enum is missing types vanilla uses, such as factory, collection_panel, tooltip_trigger and scroll_track. The scroll track type is scroll_track (scrollbar_track is not a type), and the legacy types tab, grid_item and scrollbar never appear in vanilla. carousel_label, which the wiki classifies as legacy, remains once in vanilla, but the Windows 1.26.65.1 engine rejects it as an unknown type and does not create it (ANI-46).vanilla, measuredWindows 1.26.65.1VN, BC-facts official schema section, BW-doc, 2026-11-20 Windows 1.26.65.1
LAY-02scroll_box is not a type but a control name in ui_common.json. Do not assemble scrolling by hand; reuse the common.scrolling_panel template with variables such as $scrolling_content.vanilla, working pack-VN server_form.json scrolling_panel@common.scrolling_panel, BA chapter 5, AP, MJ 4.2-2
LAY-03Use the size keywords in the table above. The meaning "based on the other axis" for %x/%y was judged from a vanilla comment (25%x * 56.25%) and usage. "default" was the same as an omitted size and differs by type. Measured on Windows 1.26.65.1, a panel was 100% of the parent, a label the text size (Hello 24x10), a vertical stack panel 100% of the parent wide and the sum of its children high, and a grid the extent of its children (a 2x2 grid of 10x10 cells was 20x20) (claim measurements). Only a panel equals "100%" on both axes. In the code this grid size is not the extent of the children but dimensions x template size, so the value is the same but it is measured by the dimensions even when there are fewer items than the dimensions (2026-11-24 decompilation). In the Cinnabar reconstruction, an omitted size is 100%c if it is the main axis of a stack panel, the texture ratio for a ratio image, and the parent size otherwise (LAY-38). In size expressions %c and the like are written after % (LAY-36).vanilla, code (source), code (binary), inferred, measuredWindows 1.26.65.1VN store_search_screen.json:64 comment, VN exhaustive search, BW-doc, CN, 2026-11-18 Windows 1.26.65.1, 2026-11-24 Windows 1.26.65.1 decompilation
LAY-04A stack panel gives no space to hidden (#visible false) children. Collapsing a conditional row pulls what is below up, and turning power-of-two spacers on and off makes the sum the coordinate (pattern recipe 6).working pack, measuredunknownBA chapter 4, BC-S12
LAY-05The position (offset) of a static control changes when a view binding copies a property_bag key that holds an array to #offset. In the Windows 1.26.65.1 HUD, a label with a static "offset": [70, 0], "property_bag": {"#o": [10, 20]} and a view binding from #o to #offset moved to the (10, 20) GUI position (it replaced the static offset). A label with only "#offset": [10, 20] in property_bag and no binding stayed at its static [30, 0] position. The Cinnabar reconstruction also accepts an [x, y] binding on #offset. The code is the same: when the #offset property bag key holds an array, [0] and [1] are read as floats, the offset becomes two pixel terms and layout is redone. If it is not an array, (0, 0) is used, and nothing happens when that equals the current expression. A binding expression only yields a boolean, integer, float or string, so an expression cannot compute an array. So for a position that changes with a value, bind the size of a spacer placed before it so the stack pushes the next child.measured, working pack, code (source), code (binary)Windows 1.26.65.1BC-S12, BA chapter 4, CN, 2026-11-24 Windows 1.26.65.1 decompilation, 2026-11-25 Windows 1.26.65.1
LAY-06Make responsiveness with max_size and min_size. Example: with "size": [314, "100% - 64px"] and "max_size": [314, 236], the window height shrinks on small screens.working pack, vanilla-BA chapter 5, VN max_size 204 uses
LAY-07If you put a background as "100%sm" inside a "100%cm" box, when a row inside hides, the box and background shrink together and what is below follows up.measuredunknownBC-S12
LAY-08If you put a label and a "100%sm" button inside a "100%cm" panel, the button hitbox fits the text size exactly in each language. Using "100%c" in the same place makes the button fall below the label.measuredunknownBC-S10
LAY-09When putting an icon-only button in a row whose height is set by its children, give an explicit square size. A percentage height does not decide the row height.measuredunknownBC-rules
LAY-10A size binding writes values to #size_binding_x and #size_binding_y. The value is a multiple of the parent size, not pixels. Measured on Windows 1.26.65.1, a declared 10x10 child in a 100-wide parent got width 50 for .5 and width 200 for 2, past the parent, and #size_binding_x_absolute 20 gave 20 (claim measurements). The Cinnabar reconstruction does the same (value v becomes v x 100%, _absolute is pixels). So inside a [1, 1] size frame the value becomes pixels. Keep the declaration as ["100%", "100%"]. With a [0, 0] declaration an unbound axis stays 0 and nothing is drawn (LAY-11). Vanilla's only size binding (resizing_xp_bar_with_hotbar) is used with use_anchored_offset: true, but on a static control the result was the same 50 without it (measured on Windows 1.26.65.1). Avoid the combination of a size binding + use_anchored_offset + a collection cell (LAY-14). The offset binding #anchored_offset_value_x (use_anchored_offset: true) was a multiple of the parent width in game: 50 in a [1, 1] frame and 0.5 in a 100-wide frame both landed at 50px, and 50 in a 100-wide frame went outside the frame. This matches the parent size reading; to move by pixels, put the control in a [1, 1] frame.measured, code (source)Windows 1.26.65.1BC-S6, BC-S12, BW-doc, VN hud_screen.json:319, CN, CPR, 2026-11-18 Windows 1.26.65.1
LAY-11A size binding binds both axes. If only one axis is bound, the other axis becomes 0 and it looks as if the binding failed. An unbound axis keeps its declared value (Cinnabar reconstruction), so if the declaration is [0, 0] that axis stays 0.measured, code (source)unknownBC-S12, CN
LAY-12What can be bound where depends on where the control was created. A size binding on a static control did not need use_anchored_offset (Windows 1.26.65.1 measurement).measuredWindows 1.26.65.1BC-S12, BW-doc, 2026-11-18 Windows 1.26.65.1
LAY-13A bound alpha applies as the float it is. On Windows 1.26.65.1, a white image over a black image with "alpha": "#alpha" and 0.5 from property_bag passed through a view binding had a center pixel of (128,128,128), and a static "alpha": 0.5 was also (128,128,128). .2, .5 and .9 also each drew with a different transparency. In the code #alpha is read as a float and stored without clamping. Integers and floats give their value, booleans give 1.0 and 0.0, and strings (including numeric strings), arrays, objects and a missing key give 1.0. With only the view binding target set to #alpha and no declaration, even the integer 1 was invisible (measurement record). An expression of constants only ((1 * .5)) has no # property, so the binding is dropped and alpha stayed 1; pass the value through a # property (BND-05).measured, code (source), code (binary)Windows 1.26.65.1BC-S12, CN, 2026-11-19 Windows 1.26.65.1, 2026-11-24 Windows 1.26.65.1 measurement and decompilation
LAY-14The combination of a size binding + use_anchored_offset + a collection cell crashed the client twice on a chest screen. Avoid this combination.measuredunknownBC-S6
LAY-15When the size binding value changes while the screen is open, layout is redone. In the code, when a #size_binding_* value changes the size expression, the size node is marked dirty and recomputed; if the expression is the same, nothing happens. This was not measured in game.code (binary)Windows 1.26.65.1BC-S6, BC chapter 8, 2026-11-24 Windows 1.26.65.1 decompilation
LAY-16anchor_from is the parent's reference point and anchor_to is its own reference point. The values are 9: top_left, top_middle, top_right, left_middle, center, right_middle, bottom_left, bottom_middle and bottom_right.vanilla-VN all 9 used, value dictionary
LAY-17offset is movement relative to the anchor and uses the same units as size (pixels, %, expressions). Example: "offset": [0, "50%-68px"]. The axis is not flipped even for right and bottom anchors: in the distribution over 206 vanilla files, the x of right anchors is negative 104 to positive 37 and the y of bottom anchors is negative 190 to positive 45, and common.close_button uses [-2, 2] with a top_right anchor (ui_common.json:3239-3246).vanilla-VN hud_screen.json:2146, ui_common.json:3239-3246
LAY-18layer is a relative value to the parent. To know which of two overlapping controls is in front, you must compare the layers of the whole ancestor chain. In the code the absolute layer is the parent's absolute layer + its own value (integer).measured, code (binary)Windows 1.26.65.1BC-rules, 2026-11-24 Windows 1.26.65.1 decompilation
LAY-19There is a measurement record that for siblings on the same layer, array order does not guarantee draw order. In the code, draw items are stable-sorted by absolute layer in ascending order, and equal values keep tree preorder (array order). So siblings with the same absolute layer are predicted to draw in array order, with the later sibling on top. The measurement that looked unordered may have had different ancestor layer sums (inferred). The order of siblings with the same absolute layer was not measured separately in game, so if front and back matter, give different layers.measured, code (binary)Windows 1.26.65.1BC-rules, MJ 4.2-10, 2026-11-24 Windows 1.26.65.1 decompilation
LAY-20If the same data must be drawn in the order "all outlines, then all lines, then all nodes, then hover", raising layers within one item is not enough (the next item's outline covers the previous item). Draw the same collection several times with factories on different layers.working pack-BA chapter 5
LAY-21Layers of 50 or more are common in vanilla too. A warning that the layer is high can be ignored. The 2026-11-24 decompilation found no code for a layer limit or a warning, and the layer was used as the integer sum.vanilla, inferred-MJ chapter 5, 2026-11-24 Windows 1.26.65.1 decompilation
LAY-22clips_children: true clips children to its own area. Giving a child allow_clipping: false draws it outside the ancestor's clipping (a tooltip that goes out of a scroll area).vanilla, working pack-VN clips_children 27 uses and allow_clipping 7 uses, BA chapter 5, AP 4.8
LAY-23To darken the surroundings when a tooltip shows, put a very large translucent black image (BA 4000x4000 alpha 0.3, AP 500x500 alpha 0.225) behind the tooltip and give it allow_clipping: false.working pack-BA chapter 5, AP 4.8
LAY-24If you need a background fitted to the text width, grow the parent to "100%c"/"100%cm" with a measuring label of alpha: 0, and draw the visible label separately on top.working pack-BA chapter 5
LAY-25A grid is made with grid_dimensions (fixed size) or grid_dimension_binding (bound size), grid_item_template and maximum_grid_items.vanilla-VN by property key 37, 79, 117 and 11 uses
LAY-26grid_fill_direction uses only vertical in vanilla. Values like left_to_right have no basis. grid_rescaling_type uses only horizontal (21) and vertical (1) in vanilla and does not use none of the official enum. Of the 3 values of grid_fill_direction the wiki lists (vertical, horizontal, none), only vertical has vanilla evidence. grid_rescaling_type: "vertical" has a crash warning (LAY-32). On a collection grid reading chest slots (grid_dimensions: [3, 2], maximum_grid_items: 6), horizontal drew only the three cells of the top row and vertical drew only the first cell and one cell outside the right edge of the grid. It cannot be used for column-first filling.vanilla, measuredunknownVN, MJ 4.2-3 and 4, BW-doc, BW-dyn, CPR
LAY-27For 9-slice, put a .json of the same name next to the texture file and write nineslice_size ([left, top, right, bottom] or one value) and base_size. Vanilla UI JSON does not use nineslice_size as a literal property and uses it once through a binding (#banner_nineslice_size to #nineslice_size).working pack, vanilla-BA chapter 5, AP 4.9, VN start_screen.json:1639
LAY-28For a repeating background, give the image "tiled": true.vanilla, working pack-VN 44 uses, AP 4.9, BA chapter 5
LAY-29To place a static child directly in a grid cell, give the child "grid_position": [column, row] (from 0). In a grid_dimensions [4, 2] grid, [3, 0] landed at the top right and [0, 1] at the bottom left (measured, mobile, 2026-11-16). Vanilla also uses it 71 times, and it is also used to overwrite a specific cell of an engine-made grid.vanilla, measuredmobile 1.26.63VN, HXC, BW-dyn screenshot
LAY-30For a grid whose count is decided by a binding, give grid_rescaling_type: "horizontal" and a fixed width and set the count with #maximum_grid_items (or maximum_grid_items). The column count is floor(grid width / template width) (160px / 32px = 5 columns, count 15 gives 3 rows). Set the height to "100%c".measuredunknownBW-dyn screenshot
LAY-31A grid gives space to hidden (visible false) items too. This is the opposite of a stack panel (LAY-04), so putting conditional items in a grid leaves empty cells. Make lists that must collapse with a stack panel. In the Cinnabar reconstruction too, grid cell positions are decided by index, so hidden cells take up space. Measured on Windows 1.26.65.1, hiding item 1 of a grid [4,1] left items 2 and 3 at x 40 and 60, and the same items in a horizontal stack panel pulled item 2 to x 20 (claim measurements).code (source), measuredWindows 1.26.65.1BW-dyn "Useful Information", CN, 2026-11-18 Windows 1.26.65.1
LAY-32There is a warning that grid_rescaling_type: "vertical" can crash the game. Vanilla uses it once (store_item_list_screen.json). When making something new, use horizontal. In the 2026-11-24 decompilation, vertical rescaling was the formula rows = max(1, floor(height / cell height)), and no path leading to a crash was found.unverified, vanilla-BW-dyn, VN, 2026-11-24 Windows 1.26.65.1 decompilation
LAY-33alpha makes only that control transparent and is not propagated to children. To make children transparent too, give propagate_alpha: true (BND-15). layer may be negative and then draws below the parent. The code agrees.code (binary), vanillaWindows 1.26.65.1BW-doc Control table, 2026-11-24 Windows 1.26.65.1 decompilation
LAY-34The size keywords "fill" and "default" are keywords only when exactly in lowercase. A unitless numeric string ("10") becomes 0. Write it as a number or as "10px". A space is not a separator, and the last number remains after a term is made (LAY-63).code (source)-CN-run
LAY-35The sign in a size expression carries on to the next sign: "100% - 10px 5px" is 100% - 15px. Write a sign on every term.code (source)-CN-run
LAY-36%c, %cm and %sm are written after %. "100c%" and "50c%" in vanilla progress_screen.json are read as parent-based %. On Windows 1.26.65.1, inside a 210-wide parent, a ["100c%", 10] panel (child 30x10) was 210x10 and a ["50c%", 4] panel was 105x4. In the code the parser treats only the token after % as a modifier and ignores a separate c.vanilla, code (source), code (binary), measuredWindows 1.26.65.1VN progress_screen.json:21, 31 and 48, CN-run, 2026-11-24 Windows 1.26.65.1 measurement and decompilation
LAY-37%cm and %sm ignore the coefficient and are the maximum value itself. "50%cm" is also the largest child size. On Windows 1.26.65.1, a ["50%cm", 10] panel was 90 wide with children 30 and 90 wide (not half 45, not half the sum 60, not a fixed 50), and [10, "50%cm"] was 30 high with children 10 and 30 high. ["100%cm", "100%cm"] was 40x20 with children 30x10 and 40x20. In the code a %cm term stores no coefficient or sign and is the maximum of the child sizes (starting at 0). If you need half, shrink again with % in a wrapping panel.code (source), code (binary), measuredWindows 1.26.65.1CN-run, CN tests G06 and G07, 2026-11-24 Windows 1.26.65.1 measurement and decompilation
LAY-38Children of a stack panel ignore offset, and ignore anchors too unless use_child_anchors: true. The main axis size of an omitted stack panel is 100%c.code (source)-CN test S04, CN
LAY-39Minimum and maximum are applied as: the maximum if the value is above it, otherwise the larger of the value and the minimum. So if minimum and maximum conflict (min > max), a value above the maximum is clipped to the maximum, and a value at or below the maximum gets the minimum. On Windows 1.26.65.1, size 10 with minimum 50 and maximum 30 gave 50. fill outside the stack's main axis is 0.code (source), code (binary), measuredWindows 1.26.65.1, Android 1.26.52.3CN, NB, 2026-11-20 Windows 1.26.65.1
LAY-40With a stack's use_priority: true, when the sum of children overflows, children with the lowest priority are kept first (0 or lower always kept) and children that do not fit are hidden.code (source)-CN test S05
LAY-72On a child of a use_priority: true stack, "priority_rule": "show_when_controls_are_hidden" takes the child out of the overflow count (LAY-40) and shows it only when another child overflowed and was hidden. Use it for a "more" marker. In a 100 wide horizontal stack with three 40 wide labels (priority 1, 2, 3) and a 20 wide marker, the third label was hidden and the marker shown. With only two labels everything fit and the marker was hidden. Given to an ordinary child, the child is hidden unless another child is hidden. It had no effect in a stack without use_priority, and it was hidden along with the HUD on F1. The other value is default.measured, code (binary)Windows 1.26.65.12026-12-03 Windows 1.26.65.1 measurement and decompilation
LAY-41A grid cell ignores its own anchor and offset. A template grid fills cells in row-first creation order and does not create cells beyond capacity. In game, the cells of a 100-wide grid with grid_dimensions: [5, 1] were 20px, and a 12px template stuck to the top left of its cell, leaving 8px between the last item and the right edge. A template size of ["100%", "100%"] resolved to the whole grid size, so items stacked one per row downward and overflowed the grid. To spread items evenly, use a fixed template the size of a cell (here [20, 14]) and anchor the item to its center.code (source), measuredunknownCN tests D01 and D08, CPR
LAY-42A scroll view searches for the role controls (viewport, content, track, box, bar panel) breadth-first by name, so their position in the tree is free, but if any one of the four is missing it does not scroll. The box length is ceil(track length x viewport / content). On Windows 1.26.65.1, a scroll with content 5161 and viewport 666 had an 84 px box, matching this formula. Cinnabar keeps the box at 10% of the track or more, but this measurement had a ratio of about 13%, so it did not test that minimum. The Windows 1.26.65.1 code confirms the minimum of 0.1. "If any one of the four is missing it does not scroll" was confirmed in the code only for a missing box (the scroll axis comes from the box's draggable). The bar panel hides when the content fits.code (source), code (binary), measuredWindows 1.26.65.1CN tests V02, V07 and V06, 2026-11-20 Windows 1.26.65.1, 2026-11-24 Windows 1.26.65.1 decompilation
LAY-43An anchor value is read only when it equals one of the 9 names (LAY-16) exactly, including case; any other string is center. On Windows 1.26.65.1, left, top, middle_left and Top_Left all landed at the center. The Cinnabar reconstruction, which decides by whether the name contains left, right, top or bottom, differs from the game.code (source), code (binary), measuredWindows 1.26.65.1, Android 1.26.52.3NB, CN, 2026-11-20 Windows 1.26.65.1
LAY-51Putting two columns as two vertical stacks in a horizontal stack_panel gave height 0. Put two vertical stacks attached to the top left and top right inside a panel (height 100%cm).measuredWindows 1.26.52DF
LAY-52With a left panel and a right detail in a horizontal stack, 100%c added the two heights and 100%cm collapsed the right detail. Put the panels inside a panel with a top-left reference and offset, and give that panel a height of 100%cm (the largest child) (LAY-51). The 100%c of a plain panel is also the sum of visible children, so it adds the two heights (LAY-59).measuredWindows 1.26.65.1, Windows 1.26.52DF, 2026-11-20 Windows 1.26.65.1
LAY-53Fitting the window height to the content with 100%c made the window and content refer to each other and collapse (buttons went outside the window). Keep a server form window at a fixed pixel size and handle overflowing content with an inner scrolling_panel or server-side paging. Phones draw the UI large, so a window bigger than the vanilla inventory (326x166) does not fit on screen.measuredWindows 1.26.52DF
LAY-54Making a list cell the content height (100%c + 8px) made an empty list a thin bar and let a long list go outside the window. Fix the list cell to the window height and put common.scrolling_panel inside it. If you fix a button cell at a fixed height, a scrollbar appears when a body is attached above it, so use a stack_panel 100%c so that it takes only as much as the buttons.measuredWindows 1.26.52DF
LAY-55When the label of a cell created by a factory or grid inside a scroll area was put on the same layer as the background image (default 0), icons and progress bars showed immediately but text was empty until something touched it (sometimes only the touched cell appeared). Putting the label on a layer higher than the background (icon 2, label 3) made everything visible as soon as it opened. Vanilla button labels are also layer: 2. binding_condition, having an expression or not, having a factory or not, clipping and scroll refresh had nothing to do with this symptom.measuredunknownFFR
LAY-56The offset given to stack_panel children did not move the position the stack decided. When 48 cells were put in a horizontal stack and folded per row with offset, they ran in one line out of the window. For 2D layout, put horizontal stack rows inside a vertical stack.measuredunknownFFR
LAY-57A scroll area covering the whole screen (common.scrolling_panel) took over touches of that area even when its content was empty. When it was always placed in $screen_content, the vanilla buttons and close button of other forms could not be pressed and only scrolling worked. Create or show a scroll area only in the form that uses it.measuredunknownFFR
LAY-58When a label and the fill under it have the same ancestor layer sum, the fill can cover the label. In the chest screen gallery the PlayerList names (sum 14), the Badge counts (sum 38) and the NumberInput value did not show, and each sat on a fill with the same layer sum. Raising the label layer made them show. Whether an equal sum always covers was not tested on its own (inference). Give text a larger sum than its fill. The setup is in Building basic components with InvUI.measuredmobile 1.26.63IUC
LAY-59The 100%c of a plain panel is also the sum of the sizes of its visible children. A panel with children of 30x10 and 50x20 and a hidden 40x40 was 80x30. Even when children overlap it is a sum, not an extent, so use 100%cm to fit the largest child (LAY-52). On 2026-11-24 a ["100%c", "100%c"] panel with children 30x10 and 50x20 was also 80x30. In the Windows 1.26.65.1 code, %c of every non-grid type adds a "coefficient x child size" term per child (a grid uses dimensions x template size), and hidden children (JSON visible false, hidden by a binding) have a size node of 0 and drop out of the sum.code (binary), measuredWindows 1.26.65.1, Android 1.26.52.3NB, 2026-11-20 Windows 1.26.65.1, 2026-11-24 Windows 1.26.65.1 measurement and decompilation
LAY-60An omitted anchor_to is center. A control given only anchor_from: "bottom_right" had its own center on the parent's bottom right point. To attach a corner, write anchor_to with the same name too (LAY-45).code (binary), measuredWindows 1.26.65.1, Android 1.26.52.3NB, 2026-11-20 Windows 1.26.65.1
LAY-61A size value must be an array. A non-array value such as "size": 20 makes both axes default, and the panel was 100% of the parent. To give both axes the same value, write [20, 20].code (binary), measuredWindows 1.26.65.1, Android 1.26.52.3NB, 2026-11-20 Windows 1.26.65.1
LAY-62min_size and max_size also accept child-based terms such as %c. A control with "min_size": ["100%c", 0] and a 30-wide child was 30 wide.code (binary), measuredWindows 1.26.65.1, Android 1.26.52.3NB, 2026-11-20 Windows 1.26.65.1
LAY-63In a size string a space is not a separator, and the last number remains after a term is made and is reused by the next unit. In a 100-wide parent, "50px%" and "50px %" were both 50px + 50%, which is 100, and "10px px" was 20. Write a number for every unit (LAY-34, LAY-35).code (binary), measuredWindows 1.26.65.1, Android 1.26.52.3NB, 2026-11-20 Windows 1.26.65.1
LAY-64%cm ignores the sign as well as the coefficient (LAY-37). "50px - 100%cm" with a 20-wide child was 70. A %cm term is added even with a - in front of it.code (binary), measuredWindows 1.26.65.1, Android 1.26.52.3NB, 2026-11-20 Windows 1.26.65.1
LAY-65Several fill children on a stack's main axis split the remaining space equally. In a 100-wide horizontal stack with a fixed 20 child and two fill children, the fill children were 40 and 40.code (source), measuredWindows 1.26.65.1CN, 2026-11-20 Windows 1.26.65.1
LAY-66A stack's orientation reads only the lowercase horizontal and vertical. A value with different case such as "Horizontal", or an unknown value, stacked vertically.code (binary), measuredWindows 1.26.65.1, Android 1.26.52.3NB, 2026-11-20 Windows 1.26.65.1
LAY-67layer is read only as an integer. Writing it as a string such as "layer": "5" gives layer 0.code (binary), measuredWindows 1.26.65.1, Android 1.26.52.3NB, 2026-11-20 Windows 1.26.65.1
LAY-68An omitted allow_clipping inherits the parent's value (true without a parent). So a control with allow_clipping: false draws outside the parent's clips_children, and its children, unless they set it themselves, drew outside too. The code follows an explicit value, so to clip a descendant again, write allow_clipping: true on that descendant (LAY-22).code (binary), measuredWindows 1.26.65.1, Android 1.26.52.3NB, 2026-11-20 Windows 1.26.65.1
LAY-69A control with inherit_max_sibling_width: true computes its width and then takes the largest of its own width and the widths of all the parent's children (itself included) that have a layout. inherit_max_sibling_height does the same on the height axis. Both are booleans read by every control and default to false. There is no visibility check, but a hidden sibling has a size node of 0 and has no effect. Whether min_size/max_size is applied again to the result, and how many passes run when two siblings both turn it on, is unknown.code (binary)Windows 1.26.65.12026-11-24 Windows 1.26.65.1 decompilation
LAY-70screen_not_flushable is a boolean read only by type: screen controls and defaults to false. The value is stored as a bit of the screen component and a screen getter returns that bit, but the screen stack code that calls the getter was not found. From the name it looks like a mark that keeps this screen when the screen stack is flushed all at once, but the effect is inferred.code (binary), inferredWindows 1.26.65.12026-11-24 Windows 1.26.65.1 decompilation
LAY-71The distance a scroll view moves for one mouse wheel step is a constant independent of the view size. In the code, a scroll view that gets a wheel event clamps new position = current position + (-scroll_speed x y) to [0, content - viewport] and moves there at once without animation, and the place that creates this event has no term that multiplies by the view size. scroll_speed is stored only once in a static variable of the function, so the value of the first scroll view that gets a wheel event is used for every scroll view after that. y looks like the screen's vertical_scroll_delta (20 if not a number, truncated to an integer), so one step = scroll_speed x vertical_scroll_delta was inferred. The vanilla common.scrolling_panel scroll_speed of 15 (ui_common.json:4435) times the default 20 gives 300, which matches the figure "about 300 px" whose measurement conditions are not recorded. It does not match the Windows 1.26.65.1 measurement: in the vanilla chat messages_scrolling_panel (content 5646 px, viewport 810 px, GUI scale 4) one wheel step moved the content by 56 to 57 client px (about 14 GUI), and one step down was -56. So the 15 x 20 = 300 inference is not supported by this measurement, and the unit of the step value (14 GUI, or 15 with another scale applied) is unknown. After merging vertical_scroll_delta: 40 into the screen chat_screen and reopening it, the step distance was the same, but whether the merge reached the actual screen control was not confirmed (no related log line). The call path from wheel input to this event was not found.measured, code (binary), inferredWindows 1.26.65.12026-11-24 Windows 1.26.65.1 decompilation, VN ui_common.json:4435, 2026-11-25 Windows 1.26.65.1

Proposed rules​

These proposals are not merged into the adopted rules yet. Check the evidence before using them.

IDRuleLevelEvidence environmentSource
LAY-44Use only + and - in size and position expressions. The 551 kinds of vanilla size strings (12,806 uses, 12,712 when counted by element) never have * or /, and Mojang does ratio calculations in a comment and then writes the resulting coefficient ("34.628%x + 2px" in store_common.json:5870, a comment in store_search_screen.json:64). Decimal coefficients (56.25%x, 1.1249px) and negative terms ("-50% + 10px") are used. Not checked: whether using * in a size expression ("50% * 2") is ignored or an error.vanilla-UIS, bedrock-samples
LAY-45Write anchor_from and anchor_to together. Vanilla writes both in 2,985 of 2,997 places (99.6%), and in 106 of those they differ from each other (12 places write only one, 6 each). An omitted side is center (LAY-60, measured on Windows 1.26.65.1). The center assumption of JsonForge and Cinnabar matches the game, and the w1zardz editor's assumption that anchor_to equals anchor_from differs from the game.vanilla, code (source), measuredWindows 1.26.65.1JF, WZ, CN, bedrock-samples, 2026-11-20 Windows 1.26.65.1
LAY-46Do not give a child inside a "100%c" parent a % size on the same axis. In the vanilla tally this setup appears in 0 of 1,972 places. A comment by the editor (JsonForge) author says the child size decides the parent and the parent size decides the child, making a cycle where nothing is drawn. There is no engine code evidence. On Windows 1.26.65.1, the parent width and the "50%" child width became 0, but a fixed-size sibling (40x10) was still drawn. So "nothing is drawn" does not hold for fixed-size children (claim measurements). Give children of a content panel pixels or default.vanilla, measured, unverifiedWindows 1.26.65.1JF, bedrock-samples
LAY-47The UI pixel size of a screen is not a fixed value. It varies with window size and GUI scale, and visual editors also assume different values (w1zardz 427x240, 520x240, 320x240, JsonForge 384x216). Fixed px are drawn multiplied by an integer scale, and vanilla layouts assume minimum virtual screens of pocket 320x210 and desktop 376x250 (comments at ui_common.json:6380 and 6430). If you keep the top-level window within this size it is not cut off at any resolution. Elements attached to the screen edge are placed with the corresponding corner anchor and a small pixel offset. The scale system changed in 1.26.0 (the minimum scale is half the maximum, and handheld devices are DPI based, MS Learn Update1.26.0). Not checked: the scale calculation in 1.26.50.vanilla, unverified-NE, ms-learn, WZ, JF
LAY-48common.scrolling_panel creates only one of the scroll_touch (touch) and scroll_mouse (mouse) subtrees depending on $touch (ui_common.json:4718-4750). The path to the scroll content and the size variables (the _touch pair) differ per input mode, so when pointing inside a scroll with path keys or source_control_name, consider both paths or pin one side by passing "$touch": true to the instance (resource_packs_screen.json:2685 does the same).vanilla-NE, bedrock-samples
LAY-49#anchored_offset_value_x/y pushes in the anchor direction by value times the parent size on a control with use_anchored_offset: true. It has no effect if anchor_from is center. To use it on a static control, give a corner or edge anchor. On Windows 1.26.65.1, a static panel in a 100-wide parent moved x by 1000 with top_left and 10, and by 10 with bottom_left and .1. center and no use_anchored_offset did not move it (claim measurements). A name with the _absolute suffix had no effect. Not checked: edge anchors.code (source), measuredWindows 1.26.65.1CN, LG, BC, 2026-11-18 Windows 1.26.65.1
LAY-50When drawing an engine collection grid (hotbar_items, etc.) in another shape, copy the vanilla definition while removing the grid_dimension_binding property itself and fixing grid_dimensions. Just emptying bindings makes the dimension binding automatically reattach in the Cinnabar model. Conflict C-62.code (source), unverified, conflict-CN, LG, bedrock-samples
Sources
idSourceLicenseCommitAccessed
repo-guideJSON UI comprehensive guide (this repository) (guide/)This project's material2026-11-13
private-researchPrivate research (-)-2026-11-13