<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.spiretrading.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Jon</id>
	<title>Spire Trading Inc. - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.spiretrading.com/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Jon"/>
	<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php/Special:Contributions/Jon"/>
	<updated>2026-08-27T02:45:39Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.34.1</generator>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=Layout&amp;diff=212</id>
		<title>Layout</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=Layout&amp;diff=212"/>
		<updated>2026-07-07T20:32:06Z</updated>

		<summary type="html">&lt;p&gt;Jon: Created page with &amp;quot;&amp;lt;code&amp;gt;layout.xd&amp;lt;/code&amp;gt; defines the visual composition for a component and its child elements. It’s required whenever a new element arrangement is needed. &amp;lt;code&amp;gt;layout.xd&amp;lt;/co...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;code&amp;gt;layout.xd&amp;lt;/code&amp;gt; defines the visual composition for a component and its child elements. It’s required whenever a new element arrangement is needed. &amp;lt;code&amp;gt;layout.xd&amp;lt;/code&amp;gt; is not necessary when it inherits its layout from another component and does not modify that layout. For example, &amp;lt;code&amp;gt;Label&amp;lt;/code&amp;gt; is a customized &amp;lt;code&amp;gt;TextBox&amp;lt;/code&amp;gt; that makes no changes to the layout, so &amp;lt;code&amp;gt;layout.xd&amp;lt;/code&amp;gt; is not needed.&lt;br /&gt;
&lt;br /&gt;
This document is the go-to for widths, heights, and positions; it takes precedence in the event of conflicts with &amp;lt;code&amp;gt;preview.xd&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;components.xd&amp;lt;/code&amp;gt;. However, dynamic adjustments tied to user input can override it, as specified in &amp;lt;code&amp;gt;user_flow.drawio&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
While &amp;lt;code&amp;gt;components.xd&amp;lt;/code&amp;gt; outlines the parts of a component, &amp;lt;code&amp;gt;layout.xd&amp;lt;/code&amp;gt; is about fitting these parts together. &amp;lt;code&amp;gt;layout.xd&amp;lt;/code&amp;gt; answers the question: “What goes where?” It should include the following details: &lt;br /&gt;
* '''Position:''' Specifying where child components are positioned relative to each other. &lt;br /&gt;
* '''Size Policy:''' Define the size or proportions of child components and how they change with resizing. &lt;br /&gt;
* '''Spacing:''' Detailing the spacing or gaps between child components. &lt;br /&gt;
* '''Layer Hierarchy:''' How the elements of a child component are visually stacked.&lt;br /&gt;
&lt;br /&gt;
== Getting Started ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;layout.xd&amp;lt;/code&amp;gt; comes after &amp;lt;code&amp;gt;preview.xd&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;model.txt&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;components.xd&amp;lt;/code&amp;gt;. It is generally advised to ensure &amp;lt;code&amp;gt;components.xd&amp;lt;/code&amp;gt; is finalized first, as the names defined there carry over to &amp;lt;code&amp;gt;layout.xd&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;layout.xd&amp;lt;/code&amp;gt; communicates spatial relations (position and size policy) through a primarily visual language. Each element is portrayed as a rectangle, with constraints along each edge indicated by edge color. When first learning the system, start by reviewing the [https://drive.spiretrading.com/f/91480 layout reference document].&lt;br /&gt;
&lt;br /&gt;
Before starting &amp;lt;code&amp;gt;layout.xd&amp;lt;/code&amp;gt;, the visual design for all scenarios should already be worked out, with the key ones ideally captured in &amp;lt;code&amp;gt;preview.xd&amp;lt;/code&amp;gt;. Use &amp;lt;code&amp;gt;layout.xd&amp;lt;/code&amp;gt; to formalize the layout.&lt;br /&gt;
&lt;br /&gt;
Sketch the component’s layout and that of each child at the preferred size. Maintain simplicity by restricting layouts to a single depth level; nesting layouts within layouts isn’t a convention in the visual layout language. If a child’s layout is specified elsewhere and remains unchanged, omit it. When included, consider it an ''override'': the specified layout takes precedence over the existing one within the component instance.&lt;br /&gt;
&lt;br /&gt;
=== Example: Slider ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Slider_preview.png|640px|center|A Slider component that can be oriented horizontally or vertically]] &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
From the preview, we can see that &amp;lt;code&amp;gt;Slider&amp;lt;/code&amp;gt; has a different layout depending on its orientation. Based on the examples, it appears that the thumb and the track are customizable.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Styles:&lt;br /&gt;
  orientation: The orientation of the slider.&lt;br /&gt;
    HORIZONTAL - The thumb can be dragged horizontally.&lt;br /&gt;
    VERTICAL - The thumb can be dragged vertically.&lt;br /&gt;
&lt;br /&gt;
Data:&lt;br /&gt;
  current: The current value represented by the slider. Cannot be null.&lt;br /&gt;
           Defaults to halfway between min and max.&lt;br /&gt;
  min: The minimum value that current is allowed to be. Default 0.&lt;br /&gt;
  max: The maximum value that current is allowed to be. Default 100.&lt;br /&gt;
  step: The granularity that current must adhere to. Default 0.&lt;br /&gt;
  default_increment: The amount of change in current when the user increments or&lt;br /&gt;
                     decrements the slider.&lt;br /&gt;
  shift_increment: The amount of change in current when the user increments or&lt;br /&gt;
                   decrements the slider while holding the shift key.&lt;br /&gt;
  track: The component representing the track of the slider.&lt;br /&gt;
  thumb: The component representing the thumb of the slider.&lt;br /&gt;
 ...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The model for &amp;lt;code&amp;gt;Slider&amp;lt;/code&amp;gt; shows a style &amp;lt;code&amp;gt;orientation&amp;lt;/code&amp;gt; (&amp;lt;code&amp;gt;HORIZONTAL&amp;lt;/code&amp;gt; | &amp;lt;code&amp;gt;VERTICAL&amp;lt;/code&amp;gt;) corresponding to the preview. There are also two slots &amp;lt;code&amp;gt;track&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;thumb&amp;lt;/code&amp;gt;, indicating that these are customizable.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Slider_components.png|640px|center|Components breakdown of a Slider component]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In &amp;lt;code&amp;gt;components.xd&amp;lt;/code&amp;gt;, child names and styles are defined.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Slider_layout_Thumb.png|640px|center|Layout definition for the Slider Thumb]] &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Slider_layout_Track.body.png|640px|center|Layout definition for the Slider Track]] &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Slider_layout_Box.body.png|640px|center|Layout definition for the Slider Box]] &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Slider_layout_Slider.png|640px|center|Layout definition for the Slider]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
By contrast with &amp;lt;code&amp;gt;components.xd&amp;lt;/code&amp;gt;, in &amp;lt;code&amp;gt;layout.xd&amp;lt;/code&amp;gt; the bottommost (outermost) element receives the title of the component itself. This is necessary to clarify how the component’s children are arranged within it and to provide its size constraints. In the above, &amp;lt;code&amp;gt;Slider&amp;lt;/code&amp;gt; is a &amp;lt;code&amp;gt;Box&amp;lt;/code&amp;gt; that contains &amp;lt;code&amp;gt;track&amp;lt;/code&amp;gt; on layer 0 and &amp;lt;code&amp;gt;thumb&amp;lt;/code&amp;gt; on layer 1.&lt;br /&gt;
&lt;br /&gt;
'''Note''': The &amp;lt;code&amp;gt;Box&amp;lt;/code&amp;gt; did not appear in &amp;lt;code&amp;gt;components.xd&amp;lt;/code&amp;gt; as no customization is done to it, but it is required in &amp;lt;code&amp;gt;layout.xd&amp;lt;/code&amp;gt; to define &amp;lt;code&amp;gt;Slider&amp;lt;/code&amp;gt;. The use of &amp;lt;code&amp;gt;Box&amp;lt;/code&amp;gt; means that components using &amp;lt;code&amp;gt;Slider&amp;lt;/code&amp;gt; can customize it with &amp;lt;code&amp;gt;Box&amp;lt;/code&amp;gt;-specific styling such as &amp;lt;code&amp;gt;border&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;padding&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;background_color&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Separate layers in &amp;lt;code&amp;gt;Box.body&amp;lt;/code&amp;gt; allow for overlap between &amp;lt;code&amp;gt;thumb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;track&amp;lt;/code&amp;gt;. Similarly, two layers are used in the layout of &amp;lt;code&amp;gt;Track.body&amp;lt;/code&amp;gt; for &amp;lt;code&amp;gt;Rail&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;Fill&amp;lt;/code&amp;gt;. To avoid overriding &amp;lt;code&amp;gt;Track&amp;lt;/code&amp;gt;’s layout, &amp;lt;code&amp;gt;Track.body&amp;lt;/code&amp;gt; is laid out instead. Generally, when a component has slots, composition is done by laying out the slots without altering the overall layout.&lt;br /&gt;
&lt;br /&gt;
The width of &amp;lt;code&amp;gt;Fill&amp;lt;/code&amp;gt; is determined by an expression, creating a ''binding'' that updates with model property changes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Thumb&amp;lt;/code&amp;gt; is laid out directly using absolute &amp;lt;code&amp;gt;FIXED&amp;lt;/code&amp;gt; size. Here, an ''anonymous'' element is used to specify the size without overriding the layout.&lt;br /&gt;
&lt;br /&gt;
To understand &amp;lt;code&amp;gt;layout.xd&amp;lt;/code&amp;gt;, one must be familiar with Spire’s visual layout language.&lt;br /&gt;
&lt;br /&gt;
== Visual Layout Language ==&lt;br /&gt;
&lt;br /&gt;
Within &amp;lt;code&amp;gt;layout.xd&amp;lt;/code&amp;gt;, each element has a specific color and an identifier, rather than appearing as they do in &amp;lt;code&amp;gt;preview.xd&amp;lt;/code&amp;gt;. These colors convey size constraints.&lt;br /&gt;
&lt;br /&gt;
=== Elements ===&lt;br /&gt;
&lt;br /&gt;
Layouts are composed of ''elements'', representing components like &amp;lt;code&amp;gt;Box&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;Button&amp;lt;/code&amp;gt;, spacers for visual separation, or containers strictly for layout. Elements are generally depicted as rectangles, with center-aligned identifiers like &amp;lt;code&amp;gt;&amp;amp;lt;ElementName&amp;amp;gt;&amp;lt;/code&amp;gt;. The appearance of the identifier doesn’t align with text orientation within the element. An element without an identifier is ''anonymous''. Each element can be thought of as having &amp;lt;code&amp;gt;top&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;bottom&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;left&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;right&amp;lt;/code&amp;gt; for its position and &amp;lt;code&amp;gt;width&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;height&amp;lt;/code&amp;gt; for its size.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Element Basics.png|640px|center|Diagram of a box identifying its left, top, right, bottom, width, height and identifier]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Size Constraints ===&lt;br /&gt;
&lt;br /&gt;
Elements are sized through either fixed dimensions, expressed in pixels, or by occupying all available container space. An element’s size may also come from its contents, but ultimately any contents are either &amp;lt;code&amp;gt;FIXED&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;FILL&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Constraint&lt;br /&gt;
! Meaning&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;FIXED&amp;lt;/code&amp;gt;&lt;br /&gt;
| The size of the component is a literal value that comes directly from the visual. An element drawn 12px wide is rendered 12px wide. As the size of the layout changes, the element size is unchanged.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;FILL&amp;lt;/code&amp;gt;&lt;br /&gt;
| The size of the component fills the available space. The literal size of the depicted element represents the ''preferred'' size if no preferred size can be determined from the layout bottom-up. As the size of the layout changes, the element shrinks or grows to fill all available space. When multiple components in a layout have this constraint, the available space is distributed equally among them.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;FIT&amp;lt;/code&amp;gt;&lt;br /&gt;
| The size of the component is determined by its contents. The literal size of the depicted element represents the ''preferred'' size if no preferred size can be determined from the layout bottom-up. This is often used for text which takes on a fixed value at any time, but changes dynamically or for windows that can be resized by the user and simultaneously restricted by their contents.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Uniform constraints (same in both axes) encode edges and background color with the appropriate constraint color. For non-uniform constraints, edges are color-encoded, and the background remains neutral. Optionally, a neutral background helps distinguish adjacent components with identical constraints.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:LayoutSpecificity.png|640px|center|Diagram of a box with shaded edges indicating vertical and horizontal constraints]] &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Color-encoding for borders and backgrounds is as follows:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:LayoutColorSemantics.png|640px|center|Diagram of different colored boxes with each color mapped to its interpretation within the layout]] &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A &amp;lt;code&amp;gt;Repeat&amp;lt;/code&amp;gt; element can be used to describe repetitive layouts. &amp;lt;code&amp;gt;Repeat&amp;lt;/code&amp;gt; duplicates adjacent layouts, following the color-encoded &amp;lt;code&amp;gt;Repeat Direction&amp;lt;/code&amp;gt;. It is useful for dynamic lists where the content dictates the number of items.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:LayoutExamples.png|640px|center|Diagram of different boxes representing different possible layout elements based on their size constraints]] &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Example: Box ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Box_preview.png|640px|center|Preview of the Box component]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Box&amp;lt;/code&amp;gt; establishes the basic style properties. The relevant properties are detailed in &amp;lt;code&amp;gt;model.txt&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Styles:&lt;br /&gt;
  border_top_size: The height of the top border.&lt;br /&gt;
  border_right_size: The width of the right border.&lt;br /&gt;
  border_bottom_size: The height of the bottom border.&lt;br /&gt;
  border_left_size: The width of the left border.&lt;br /&gt;
  ...&lt;br /&gt;
  padding_top: The amount of padding on the top of the box.&lt;br /&gt;
  padding_right: The amount of padding to the right of the box.&lt;br /&gt;
  padding_bottom: The amount of padding on the bottom of top of the box.&lt;br /&gt;
  padding_left: The amount of padding to the left of the box.&lt;br /&gt;
  ...&lt;br /&gt;
&lt;br /&gt;
Data:&lt;br /&gt;
  body: The component displayed in the box.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Box&amp;lt;/code&amp;gt; has a &amp;lt;code&amp;gt;border&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;padding&amp;lt;/code&amp;gt;, and a &amp;lt;code&amp;gt;body&amp;lt;/code&amp;gt;. &amp;lt;code&amp;gt;border&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;padding&amp;lt;/code&amp;gt; are specified as fixed sizes for each edge, while &amp;lt;code&amp;gt;body&amp;lt;/code&amp;gt; can be any component. &amp;lt;code&amp;gt;layout.xd&amp;lt;/code&amp;gt; for &amp;lt;code&amp;gt;Box&amp;lt;/code&amp;gt; shows how these elements are arranged:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Box_layout.png|640px|center|Diagram of a box labelled &amp;lt;body&amp;gt; with edges denoted as &amp;lt;padding&amp;gt; and &amp;lt;border&amp;gt; where each edge is a separate element]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In the layout, &amp;lt;code&amp;gt;body&amp;lt;/code&amp;gt; adopts &amp;lt;code&amp;gt;FIT&amp;lt;/code&amp;gt; constraints on all sides. By default, the size of the &amp;lt;code&amp;gt;Box&amp;lt;/code&amp;gt; adapts to its content. &amp;lt;code&amp;gt;padding&amp;lt;/code&amp;gt; is specified with separate components for each edge using &amp;lt;code&amp;gt;FIXED&amp;lt;/code&amp;gt; constraints. &amp;lt;code&amp;gt;border&amp;lt;/code&amp;gt;, akin to &amp;lt;code&amp;gt;padding&amp;lt;/code&amp;gt;, uses the same specifications but lies outside it. The layout makes clear that &amp;lt;code&amp;gt;border&amp;lt;/code&amp;gt; extends beyond &amp;lt;code&amp;gt;padding&amp;lt;/code&amp;gt;, and both consume space that &amp;lt;code&amp;gt;body&amp;lt;/code&amp;gt; cannot occupy.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' &amp;lt;code&amp;gt;Box&amp;lt;/code&amp;gt; introduces a unique scenario as both &amp;lt;code&amp;gt;border&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;padding&amp;lt;/code&amp;gt; elements converge at angles, presenting trapezoids instead of rectangles.&lt;br /&gt;
&lt;br /&gt;
=== Position Constraints ===&lt;br /&gt;
&lt;br /&gt;
The positioning of an element is considered relative to its container.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Positioning 1.png|640px|center|Diagram of a rectangular &amp;lt;Item&amp;gt; inside a rectangular container with its distances to the container edges highlighted]] &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In the above diagram, the element &amp;lt;code&amp;gt;Item&amp;lt;/code&amp;gt; is placed inside a container at some distances to its edges. Within the visual layout language, the layout must be drawn so that all of the space is taken up by elements, as shown below:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Positioning 2.png|640px|center|Diagram of a rectangular &amp;lt;Item&amp;gt; inside a rectangular container with its distances to the container edges filled by rectangular elements denoted &amp;lt;A&amp;gt;, &amp;lt;B&amp;gt;, &amp;lt;C&amp;gt;, and &amp;lt;D&amp;gt; ]] &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Above, the position of &amp;lt;code&amp;gt;Item&amp;lt;/code&amp;gt; is defined by the surrounding elements &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;B&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;C&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;D&amp;lt;/code&amp;gt;. These elements can be other components or ''anonymous'' and they each have their own size constraints. How &amp;lt;code&amp;gt;Item&amp;lt;/code&amp;gt; is positioned will depend on the ''size'' of the adjacent elements. The layout ensures no underflow, meaning no unoccupied space between components (the gaps shown in the diagram are for illustration only).&lt;br /&gt;
&lt;br /&gt;
Edges of elements that touch are bound together. Where the right edge of &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; is adjacent to the left edge of &amp;lt;code&amp;gt;B&amp;lt;/code&amp;gt;, it signifies &amp;lt;code&amp;gt;A.right = B.left&amp;lt;/code&amp;gt;. Likewise, where the bottom edge of &amp;lt;code&amp;gt;B&amp;lt;/code&amp;gt; aligns with the top edge of &amp;lt;code&amp;gt;Item&amp;lt;/code&amp;gt;, it signifies &amp;lt;code&amp;gt;B.bottom = Item.top&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== Example: A Fixed and B Fill ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Example1_1.png|640px|center|Layout of two adjacent elements &amp;lt;A&amp;gt; and &amp;lt;B&amp;gt; where &amp;lt;A&amp;gt; is FIXED size and &amp;lt;B&amp;gt; is FILL]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In this scenario, &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; is &amp;lt;code&amp;gt;FIXED&amp;lt;/code&amp;gt;, signifying a literal size, while &amp;lt;code&amp;gt;B&amp;lt;/code&amp;gt; has &amp;lt;code&amp;gt;FILL&amp;lt;/code&amp;gt; constraints so that it occupies the available space.&lt;br /&gt;
&lt;br /&gt;
When the width is reduced, &amp;lt;code&amp;gt;B&amp;lt;/code&amp;gt; goes to zero width:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Example1_2.png|640px|center|Layout of two adjacent elements &amp;lt;A&amp;gt; and &amp;lt;B&amp;gt; where &amp;lt;A&amp;gt; is FIXED size and &amp;lt;B&amp;gt; is FILL and there is no available space so &amp;lt;B&amp;gt; is not visible]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When the width is increased, &amp;lt;code&amp;gt;B&amp;lt;/code&amp;gt; stretches to fill the available space:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Example1_3.png|640px|center|Layout of two adjacent elements &amp;lt;A&amp;gt; and &amp;lt;B&amp;gt; where &amp;lt;A&amp;gt; is FIXED size and &amp;lt;B&amp;gt; is FILL and there is lots of available space so &amp;lt;B&amp;gt; is very wide]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For the horizontal direction, the constraints are:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;A.left = left&lt;br /&gt;
A.right = left + 128px&lt;br /&gt;
B.left = A.right&lt;br /&gt;
B.right = right&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And in the vertical direction:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;A.top = top&lt;br /&gt;
A.bottom = top + 128px&lt;br /&gt;
B.top = top&lt;br /&gt;
B.bottom = bottom&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Since underflow is forbidden, the layout cannot exceed the height of &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt;: there’s nothing to occupy the additional space.&lt;br /&gt;
&lt;br /&gt;
=== Spacers ===&lt;br /&gt;
&lt;br /&gt;
Negative space is specified with spacers — elements absent from &amp;lt;code&amp;gt;components.xd&amp;lt;/code&amp;gt; and devoid of interactive and styling attributes. Spacers, often ''anonymous'', serve the sole purpose of defining space between components.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' Negative space can also be introduced by using internal padding on adjacent components. Doing so is often preferred for &amp;lt;code&amp;gt;FIXED&amp;lt;/code&amp;gt; spacing.&lt;br /&gt;
&lt;br /&gt;
==== Example: A Fixed and B Fixed ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Example2_1.png|640px|center|Layout of two adjacent elements &amp;lt;A&amp;gt; and &amp;lt;B&amp;gt; where &amp;lt;A&amp;gt; is FIXED size and &amp;lt;B&amp;gt; is FIXED and there is FILL space between them]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In this scenario, both &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;B&amp;lt;/code&amp;gt; are &amp;lt;code&amp;gt;FIXED&amp;lt;/code&amp;gt;, with literal sizes of 128px in &amp;lt;code&amp;gt;width&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;height&amp;lt;/code&amp;gt;. They are positioned on opposite ends of the layout through the use of a spacer that is constrained to &amp;lt;code&amp;gt;FILL&amp;lt;/code&amp;gt; the available space. The spacer lacks an identifier: it is ''anonymous''.&lt;br /&gt;
&lt;br /&gt;
When the width of the layout is reduced, the spacer collapses and &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;B&amp;lt;/code&amp;gt; touch:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Example2_2.png|640px|center|Layout of two adjacent elements &amp;lt;A&amp;gt; and &amp;lt;B&amp;gt; where &amp;lt;A&amp;gt; is FIXED size and &amp;lt;B&amp;gt; is FIXED and there is zero space between them]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When the width of the layout is increased, the spacer expands to fill the available space:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Example2_3.png|640px|center|Layout of two adjacent elements &amp;lt;A&amp;gt; and &amp;lt;B&amp;gt; where &amp;lt;A&amp;gt; is FIXED size and &amp;lt;B&amp;gt; is FIXED and there is lots of available space between them]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
For the horizontal constraints:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;A.left = left&lt;br /&gt;
A.right = left + 128px&lt;br /&gt;
spacer.left = A.right&lt;br /&gt;
spacer.right = B.left&lt;br /&gt;
B.left = right - 128px&lt;br /&gt;
B.right = right&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For the vertical constraints:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;A.top = top&lt;br /&gt;
A.bottom = top + 128px&lt;br /&gt;
spacer.top = top&lt;br /&gt;
spacer.bottom = bottom&lt;br /&gt;
B.top = top&lt;br /&gt;
B.bottom = top + 128px&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Containers ===&lt;br /&gt;
&lt;br /&gt;
Layouts can be subdivided at the designer’s choosing using containers. They are used to encapsulate the arrangement of elements. Unlike spacers, containers cannot be anonymous; they require identification for referencing.&lt;br /&gt;
&lt;br /&gt;
==== Example: ListView ====&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;code&amp;gt;direction = VERTICAL and overflow = WRAP&amp;lt;/code&amp;gt; , the layout is divided into containers named &amp;lt;code&amp;gt;Column&amp;lt;/code&amp;gt;. &amp;lt;code&amp;gt;Column&amp;lt;/code&amp;gt; is purely a layout element, without any representation in &amp;lt;code&amp;gt;components.xd&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:ListView_layout.png|640px|center|Layout diagram showing &amp;lt;Column&amp;gt; elements repeated from left to right]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The layout for &amp;lt;code&amp;gt;Column&amp;lt;/code&amp;gt; is shown the same as for any other component.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:ListView_layout-2.png|640px|center|Layout diagram showing &amp;lt;Item&amp;gt; elements repeated from top to bottom]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Example: TitleBar ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:TitleBar_preview-2.png|640px|center|Preview of Title Bar component]] &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
From &amp;lt;code&amp;gt;preview.xd&amp;lt;/code&amp;gt;, we can see that &amp;lt;code&amp;gt;TitleBar&amp;lt;/code&amp;gt; consists of a few elements: &lt;br /&gt;
* Icon &lt;br /&gt;
* Title &lt;br /&gt;
* Window controls &lt;br /&gt;
* Container&lt;br /&gt;
&lt;br /&gt;
The height of &amp;lt;code&amp;gt;TitleBar&amp;lt;/code&amp;gt; is constant, while its width can vary.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:TitleBar_components.png|640px|center|Components breakdown of Title Bar component]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;components.xd&amp;lt;/code&amp;gt; introduces aliases: &lt;br /&gt;
* WindowIcon &lt;br /&gt;
* WindowName &lt;br /&gt;
* Minimize, Maximize, and Close &lt;br /&gt;
* Box&lt;br /&gt;
&lt;br /&gt;
Appearance tweaks—background colors, icons, and title text—are handled in the property declarations.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:TitleBar_layout.png|640px|center|Layout breakdown of Title Bar component]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;WindowIcon&amp;lt;/code&amp;gt; is an &amp;lt;code&amp;gt;Icon&amp;lt;/code&amp;gt; with &amp;lt;code&amp;gt;FIXED&amp;lt;/code&amp;gt; size of 10px that is vertically centered. Top and bottom spacers with &amp;lt;code&amp;gt;FILL&amp;lt;/code&amp;gt; size ensure center alignment.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' Centering is indicated because the two elements are equally sized. Any positional bias could be provided by adjusting the relative sizes of the spacers.&lt;br /&gt;
&lt;br /&gt;
The contents of &amp;lt;code&amp;gt;TitleBar&amp;lt;/code&amp;gt; are arranged in &amp;lt;code&amp;gt;Box.body&amp;lt;/code&amp;gt;: &lt;br /&gt;
* &amp;lt;code&amp;gt;WindowIcon&amp;lt;/code&amp;gt; is given a vertical constraint of &amp;lt;code&amp;gt;FILL&amp;lt;/code&amp;gt; and a horizontal constraint of &amp;lt;code&amp;gt;FIT&amp;lt;/code&amp;gt;. It will be as tall as allowed by &amp;lt;code&amp;gt;Box&amp;lt;/code&amp;gt; and only as wide as required by its content. &lt;br /&gt;
* &amp;lt;code&amp;gt;WindowName&amp;lt;/code&amp;gt; is constrained vertically as &amp;lt;code&amp;gt;FILL&amp;lt;/code&amp;gt; and horizontally as &amp;lt;code&amp;gt;FILL&amp;lt;/code&amp;gt;, adapting to available space. &lt;br /&gt;
* &amp;lt;code&amp;gt;Minimize&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;Maximize&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;Close&amp;lt;/code&amp;gt; are all given constraints of &amp;lt;code&amp;gt;FIXED&amp;lt;/code&amp;gt; in height and width (22px x 26px). Their literal size is defined by the visual.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Box&amp;lt;/code&amp;gt; is the container with a vertical constraint of &amp;lt;code&amp;gt;FIT&amp;lt;/code&amp;gt; and a horizontal constraint of &amp;lt;code&amp;gt;FILL&amp;lt;/code&amp;gt;. An expression for width restricts its minimum size.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot;&amp;gt;width: max(FIT_CONTENT, 100%)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This takes precedence over the sketch.&lt;br /&gt;
&lt;br /&gt;
The layout ensures that &amp;lt;code&amp;gt;TitleBar&amp;lt;/code&amp;gt; matches the width of its parent window without getting so narrow that the user is unable to interact with the controls.&lt;br /&gt;
&lt;br /&gt;
== Anatomy ==&lt;br /&gt;
&lt;br /&gt;
The structure of &amp;lt;code&amp;gt;layout.xd&amp;lt;/code&amp;gt; is a vertical list of sections, each dedicated to the layout of a single element. Each section is divided into a grid with columns for scenarios and rows for layers and property declarations.&lt;br /&gt;
&lt;br /&gt;
==== Example: SplitView ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:SplitView_layout_anatomy.png|640px|center|Structural breakdown of Layout definition on Split View component]] &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The heading is the name of the element being laid out.&lt;br /&gt;
&lt;br /&gt;
Layers are stacked vertically in the column for a scenario. If only one layer is needed, the layer name is omitted.&lt;br /&gt;
&lt;br /&gt;
When the scenario shown is the default condition, the scenario condition heading is omitted.&lt;br /&gt;
&lt;br /&gt;
Each scenario and layer has a layout. Layouts are sketched at 1:1 scale.&lt;br /&gt;
&lt;br /&gt;
At the bottom of each column are property declarations. These declarations supersede visual layout statements. They are useful for specifying sizes that are impractical to depict visually and for incorporating expressions.&lt;br /&gt;
&lt;br /&gt;
== Heading ==&lt;br /&gt;
&lt;br /&gt;
The heading identifies the element that is being laid out. If an alias is assigned in &amp;lt;code&amp;gt;components.xd&amp;lt;/code&amp;gt;, the alias is used.&lt;br /&gt;
&lt;br /&gt;
== Scenarios ==&lt;br /&gt;
&lt;br /&gt;
Scenarios are used to create conditional layouts. While the presence or absence of components can be handled in &amp;lt;code&amp;gt;components.xd&amp;lt;/code&amp;gt; using the &amp;lt;code&amp;gt;visibility&amp;lt;/code&amp;gt; property, specific positioning of children must be specified in &amp;lt;code&amp;gt;layout.xd&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Example: OverlayPanel ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Data:&lt;br /&gt;
  parent: The component that showed the OverlayPanel.&lt;br /&gt;
  ...&lt;br /&gt;
  positioning: Specifies the positioning of the panel relative to the parent:&lt;br /&gt;
    NONE: The panel is not positioned relative to any other component.&lt;br /&gt;
    PARENT: The panel is positioned relative to the parent. Default.&lt;br /&gt;
&lt;br /&gt;
State:&lt;br /&gt;
  vertical_orientation: Whether the OverlayPanel is placed above or below the&lt;br /&gt;
                        its parent, this is determined based on the position&lt;br /&gt;
                        of the parent and the size of the body. If the body&lt;br /&gt;
                        can fit entirely below the parent then the orientation&lt;br /&gt;
                        will be BELOW, otherwise it will be ABOVE.&lt;br /&gt;
    BELOW: The OverlayPanel is below the parent.&lt;br /&gt;
    ABOVE: The OverlayPanel is above the parent.&lt;br /&gt;
&lt;br /&gt;
...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:OverlayPanel_layout.png|640px|center|Layout definition for Overlay Panel component]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;OverlayPanel&amp;lt;/code&amp;gt; has a conditional layout based on whether the panel is: &lt;br /&gt;
* &amp;lt;code&amp;gt;default&amp;lt;/code&amp;gt; &lt;br /&gt;
* &amp;lt;code&amp;gt;positioning = PARENT and vertical_orientation = BELOW&amp;lt;/code&amp;gt; &lt;br /&gt;
* &amp;lt;code&amp;gt;positioning = PARENT and vertical_orientation = ABOVE&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These are the scenario conditions.&lt;br /&gt;
&lt;br /&gt;
Scenario evaluation follows a right-to-left sequence: the first matching scenario takes effect. In the &amp;lt;code&amp;gt;OverlayPanel&amp;lt;/code&amp;gt; example, the match depends on &amp;lt;code&amp;gt;parent&amp;lt;/code&amp;gt;’s location relative to the screen and the size of &amp;lt;code&amp;gt;Box&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Scenario conditions are written using selectors. Refer to the [https://wiki.spiretrading.com/index.php/Components#Selectors documentation for selectors on components] for details on using selectors to specify a condition.&lt;br /&gt;
&lt;br /&gt;
== Layers ==&lt;br /&gt;
&lt;br /&gt;
Layouts can be separated into layers. This is done by prepending &amp;lt;code&amp;gt;layer n:&amp;lt;/code&amp;gt; before the layout, where &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt; is the layer number. Layers are zero-indexed and arranged vertically from bottom to top. Lower layers have ''z-priority''.&lt;br /&gt;
&lt;br /&gt;
Layers are useful for specifying where components need to overlap.&lt;br /&gt;
&lt;br /&gt;
=== Example: DecimalBox ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:DecimalBox_layout.png|640px|center|Layout definition for Decimal Box component]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A &amp;lt;code&amp;gt;TextBox&amp;lt;/code&amp;gt; is placed on layer 0 while the step buttons &amp;lt;code&amp;gt;Increment&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;Decrement&amp;lt;/code&amp;gt; are placed on layer 1. This allows the step buttons to be visually nested in the &amp;lt;code&amp;gt;TextBox&amp;lt;/code&amp;gt; without modifying the &amp;lt;code&amp;gt;TextBox&amp;lt;/code&amp;gt; layout.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:DecimalBox_preview.png|640px|center|Preview for Decimal Box component]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Layout ==&lt;br /&gt;
&lt;br /&gt;
The layout is a 1:1 scale sketch of the scenario using the visual layout language. The size used to represent a layout is the ''preferred size''.&lt;br /&gt;
&lt;br /&gt;
Through the use of the visual layout language and property declarations, the layout fully specifies the positions and sizes of an element’s children for all possible sizes of the element.&lt;br /&gt;
&lt;br /&gt;
== Identifier ==&lt;br /&gt;
&lt;br /&gt;
Each element is labeled with an identifier. The identifier is shown in angle brackets as &amp;lt;code&amp;gt;&amp;amp;lt;ElementName&amp;amp;gt;&amp;lt;/code&amp;gt;. Naming follows the '''PascalCase''' convention from &amp;lt;code&amp;gt;components.xd&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
When an identifier matches the name of an existing component, the layout is for an ''instance'' of that component.&lt;br /&gt;
&lt;br /&gt;
''Slots'', components specified in &amp;lt;code&amp;gt;model.txt&amp;lt;/code&amp;gt; under Data, earmark children open to substitution with different components. When identifying slots, the '''snake_case''' convention from &amp;lt;code&amp;gt;model.txt&amp;lt;/code&amp;gt; is used.&lt;br /&gt;
&lt;br /&gt;
When an identifier does not match a component name or a slot, the layout is for a spacer or a container used for organizational purposes within the document.&lt;br /&gt;
&lt;br /&gt;
=== Example: SplitView ===&lt;br /&gt;
&lt;br /&gt;
The model for &amp;lt;code&amp;gt;SplitView&amp;lt;/code&amp;gt; shows two slots: &amp;lt;code&amp;gt;primary&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;secondary&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;...&lt;br /&gt;
Data:&lt;br /&gt;
  primary: The primary pane.&lt;br /&gt;
  secondary: The secondary pane.&lt;br /&gt;
...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In &amp;lt;code&amp;gt;layout.xd&amp;lt;/code&amp;gt;, these are represented as &amp;lt;code&amp;gt;&amp;amp;lt;primary&amp;amp;gt;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;&amp;amp;lt;secondary&amp;amp;gt;&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:SplitView_layout.png|640px|center|Layout definition for Split View component]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Additionally, three named elements are depicted—&amp;lt;code&amp;gt;Padding&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;Offset&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;Sash&amp;lt;/code&amp;gt;. These lack correspondence to any components or slots and serve as reference points for property declarations.&lt;br /&gt;
&lt;br /&gt;
While &amp;lt;code&amp;gt;Padding&amp;lt;/code&amp;gt; is intended to be 2px wide, it’s shown at an enlarged size for readability. The declaration is used to provide the true size. A similar approach applies to &amp;lt;code&amp;gt;Sash&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Multiples ==&lt;br /&gt;
&lt;br /&gt;
In a component, you might have several instances of the same type, and their layouts could be identical. In such cases, the element identifiers in &amp;lt;code&amp;gt;layout.xd&amp;lt;/code&amp;gt; drop the index found in &amp;lt;code&amp;gt;components.xd&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Example: ListView ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:ListView_components.png|640px|center|Component definition for List Item within List View component]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In &amp;lt;code&amp;gt;components.xd&amp;lt;/code&amp;gt; there is a child &amp;lt;code&amp;gt;Item[i]&amp;lt;/code&amp;gt;, as there are multiple &amp;lt;code&amp;gt;Item&amp;lt;/code&amp;gt; children depending on the data given to &amp;lt;code&amp;gt;ListView&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:ListView_layout-2.png|640px|center|Layout diagram showing &amp;lt;Item&amp;gt; elements repeated from top to bottom]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
However, in &amp;lt;code&amp;gt;layout.xd&amp;lt;/code&amp;gt;, we simply use &amp;lt;code&amp;gt;Item&amp;lt;/code&amp;gt; without an index in the identifier. Because the layout is positioning the items, specific index values would not accurately convey our intent. Instead, the &amp;lt;code&amp;gt;Repeat&amp;lt;/code&amp;gt; element is used to signify repetition and dictate the direction.&lt;br /&gt;
&lt;br /&gt;
== Property Declaration ==&lt;br /&gt;
&lt;br /&gt;
Property declarations take precedence over the visual layout. Properties come from the child being defined. To understand what’s available, consult its &amp;lt;code&amp;gt;model.txt&amp;lt;/code&amp;gt;. Generally, only size and position properties, such as &amp;lt;code&amp;gt;width&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;height&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;position&amp;lt;/code&amp;gt; should be declared in &amp;lt;code&amp;gt;layout.xd&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The key properties are as follows:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Property&lt;br /&gt;
! Definition&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;width&amp;lt;/code&amp;gt;&lt;br /&gt;
| The width of the component in pixels.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;height&amp;lt;/code&amp;gt;&lt;br /&gt;
| The height of the component in pixels.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;position&amp;lt;/code&amp;gt;&lt;br /&gt;
| The position of the component relative to its parent, if the component has no parent, then the position is equal to &amp;lt;code&amp;gt;screen_position&amp;lt;/code&amp;gt;.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
| &amp;lt;code&amp;gt;x&amp;lt;/code&amp;gt; The x-coordinate in pixels.&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
| &amp;lt;code&amp;gt;y&amp;lt;/code&amp;gt; The y-coordinate in pixels.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Property declarations are made using expressions which support basic mathematical operators (&amp;lt;code&amp;gt;+&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;×&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;/&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;-&amp;lt;/code&amp;gt;) and various functions. These are used for more complex constraints that are not easily visually represented.&lt;br /&gt;
&lt;br /&gt;
A fluid layout with a minimum width of 20px and a maximum width of 100px can be specified as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot;&amp;gt;width: clamp(20px, FILL_AVAILABLE, 100px)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
The preferred size is the middle value (&amp;lt;code&amp;gt;FILL_AVAILABLE&amp;lt;/code&amp;gt;), but it is bounded by 20px and 100px on either side.&lt;br /&gt;
&lt;br /&gt;
Expressions containing dependencies establish a binding.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot;&amp;gt;Offset.width: primary.width - (Sash.width - Divider.width) / 2&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
Whenever &amp;lt;code&amp;gt;primary.width&amp;lt;/code&amp;gt; changes, &amp;lt;code&amp;gt;Offset.width&amp;lt;/code&amp;gt; will also change.&lt;br /&gt;
&lt;br /&gt;
=== Expression Values and Units ===&lt;br /&gt;
&lt;br /&gt;
Expressions use a fixed set of units and preset values.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Unit / Value&lt;br /&gt;
! Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt; px&lt;br /&gt;
| A literal amount in pixels&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt; ch&lt;br /&gt;
| The width of the “0” character for the element font. A width value of &amp;lt;code&amp;gt;6ch&amp;lt;/code&amp;gt; is approximately 6 characters wide in the specified font.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt; em&lt;br /&gt;
| Represents the calculated font size of the element.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt; %&lt;br /&gt;
| A percentage amount relative to the immediate parent layout&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;FILL_AVAILABLE&amp;lt;/code&amp;gt;&lt;br /&gt;
| Fills its parent&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;FIT_CONTENT&amp;lt;/code&amp;gt;&lt;br /&gt;
| Fits its contents&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Additional units may be used provided they have compelling use cases and are documented. The above units come from [https://developer.mozilla.org/en-US/docs/Web/CSS/length CSS]&lt;br /&gt;
&lt;br /&gt;
=== Expression Functions ===&lt;br /&gt;
&lt;br /&gt;
Any function can be used in an expression provided its definition is provided or it is sufficiently self-explanatory. In practice, it is best to stick to a limited set of functions. The following have been used in layout specifications: &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Function !! Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;min(a, b)&amp;lt;/code&amp;gt; || The minimum of &amp;lt;code&amp;gt;a&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;b&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;max(a, b)&amp;lt;/code&amp;gt; || The maximum of &amp;lt;code&amp;gt;a&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;b&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;clamp(lower, value, upper)&amp;lt;/code&amp;gt; || &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;, clamped to between &amp;lt;code&amp;gt;lower&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;upper&amp;lt;/code&amp;gt; (inclusive)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
These have CSS equivalents: - [https://developer.mozilla.org/en-US/docs/Web/CSS/min min()] - [https://developer.mozilla.org/en-US/docs/Web/CSS/max max()] - [https://developer.mozilla.org/en-US/docs/Web/CSS/clamp clamp()]&lt;br /&gt;
&lt;br /&gt;
Expressions can also be set to animation values as outlined in the documentation on [https://wiki.spiretrading.com/index.php/Animations Animations].&lt;br /&gt;
&lt;br /&gt;
==== Example: DropDownList ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:DropDownList_layout.png|640px|center|Layout definition for Drop Down List component]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;DropDownList&amp;lt;/code&amp;gt; sets the &amp;lt;code&amp;gt;width&amp;lt;/code&amp;gt; to the greater of its parent’s width or the content width of the &amp;lt;code&amp;gt;ScrollableListBox&amp;lt;/code&amp;gt;. The &amp;lt;code&amp;gt;height&amp;lt;/code&amp;gt; is set dynamically to display either ten items or all available items, whichever is less.&lt;br /&gt;
&lt;br /&gt;
== Ordering ==&lt;br /&gt;
&lt;br /&gt;
When structuring &amp;lt;code&amp;gt;layout.xd&amp;lt;/code&amp;gt;, maintain an order mirroring &amp;lt;code&amp;gt;components.xd&amp;lt;/code&amp;gt;—from innermost to outermost. This ensures clarity and consistency.&lt;br /&gt;
&lt;br /&gt;
=== Example: TabView ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;components.xd&amp;lt;/code&amp;gt; lists a &amp;lt;code&amp;gt;Box&amp;lt;/code&amp;gt;, a &amp;lt;code&amp;gt;ScrollableListBox&amp;lt;/code&amp;gt;, and a custom &amp;lt;code&amp;gt;ListView&amp;lt;/code&amp;gt; that uses a &amp;lt;code&amp;gt;Tab&amp;lt;/code&amp;gt; component for each &amp;lt;code&amp;gt;ListItem&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:TabView_components.png|640px|center|Components breakdown for Tab View component]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
From top to bottom, the order is: &lt;br /&gt;
* Tab[i] &lt;br /&gt;
* ListItem[i] &lt;br /&gt;
* ListView:TabList &lt;br /&gt;
* ScrollableListBox &lt;br /&gt;
* Box:TabBar&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;layout.xd&amp;lt;/code&amp;gt; lays out &amp;lt;code&amp;gt;TabView&amp;lt;/code&amp;gt; as &amp;lt;code&amp;gt;TabBar&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;body&amp;lt;/code&amp;gt;, along with two spacing elements. &amp;lt;code&amp;gt;TabBar&amp;lt;/code&amp;gt; is laid out as &amp;lt;code&amp;gt;ScrollableListBox&amp;lt;/code&amp;gt; and a spacer, and &amp;lt;code&amp;gt;ScrollableListBox&amp;lt;/code&amp;gt; is laid out as &amp;lt;code&amp;gt;TabList&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:TabView_layout.png|640px|center|Layout breakdown for Tab View component]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
From top to bottom, the order is: &lt;br /&gt;
* ScrollableListBox &lt;br /&gt;
* TabBar &lt;br /&gt;
* TabView&lt;br /&gt;
&lt;br /&gt;
Unlike &amp;lt;code&amp;gt;components.xd&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;TabView&amp;lt;/code&amp;gt; itself is included in &amp;lt;code&amp;gt;layout.xd&amp;lt;/code&amp;gt;. As in &amp;lt;code&amp;gt;components.xd&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;ScrollableListBox&amp;lt;/code&amp;gt; comes before &amp;lt;code&amp;gt;TabBar&amp;lt;/code&amp;gt; as the order moves from innermost to outermost. While &amp;lt;code&amp;gt;components.xd&amp;lt;/code&amp;gt; lists &amp;lt;code&amp;gt;TabList&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;ListItem[i]&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;Tab[i]&amp;lt;/code&amp;gt;, they are absent from &amp;lt;code&amp;gt;layout.xd&amp;lt;/code&amp;gt;. As these components all specify their layouts and &amp;lt;code&amp;gt;TabView&amp;lt;/code&amp;gt; does not override any of these layouts, they are omitted.&lt;br /&gt;
&lt;br /&gt;
== Referencing ==&lt;br /&gt;
&lt;br /&gt;
In property declarations, only elements positioned higher in the document can be referenced.&lt;br /&gt;
&lt;br /&gt;
=== Example: HighlightPicker ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:HighlightPicker_layout.png|640px|center|Layout breakdown for Highlight Picker component]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The property declaration in &amp;lt;code&amp;gt;OverlayPanel.body&amp;lt;/code&amp;gt; references the width of &amp;lt;code&amp;gt;ListItem&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot;&amp;gt;HighlightPalette.width: 8 * ListItem.width&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
This is a valid reference, as &amp;lt;code&amp;gt;ListItem&amp;lt;/code&amp;gt; is a child of &amp;lt;code&amp;gt;OverlayPanel.body&amp;lt;/code&amp;gt; so the layout for &amp;lt;code&amp;gt;ListItem.body&amp;lt;/code&amp;gt; comes above that for &amp;lt;code&amp;gt;OverlayPanel.body&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Adaptive Layouts ==&lt;br /&gt;
&lt;br /&gt;
Sometimes it is necessary to specify a different layout according to the available space. Instead of a gradual transition of elements, a step-change may be appropriate such as switching between an even grid and a linear arrangement, or switching labels between a long-form and a short-hand. Consider the &amp;lt;code&amp;gt;TechnicalsPanel&amp;lt;/code&amp;gt; from &amp;lt;code&amp;gt;BookView&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:TechnicalsPanel_preview.png|640px|center|Preview of a grid of technical indicators and their respective labels used within the Book View Window]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The six technical indicators &amp;lt;code&amp;gt;High&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;Low&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;Open&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;Close&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;Def&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;Vol&amp;lt;/code&amp;gt; are shown stacked in a 3x2 grid or linearly as a 6x1 row. They are also shown either as a full name (e.g. &amp;lt;code&amp;gt;High&amp;lt;/code&amp;gt;) or an abbreviation (e.g. &amp;lt;code&amp;gt;H&amp;lt;/code&amp;gt;). There should be a step-change between the 3x2 and 6x1 arrangements, as a partially filled second row makes for more difficult reading. There should also be a step-change between full labels and abbreviations, since if the labels are not coordinated it becomes visually confusing.&lt;br /&gt;
&lt;br /&gt;
This behavior is not specified directly in the visual layout language. Instead, a purpose-built component &amp;lt;code&amp;gt;AdaptiveBox&amp;lt;/code&amp;gt; is used.&lt;br /&gt;
&lt;br /&gt;
To use &amp;lt;code&amp;gt;AdaptiveBox&amp;lt;/code&amp;gt;, the designer specifies each layout within &amp;lt;code&amp;gt;components.xd&amp;lt;/code&amp;gt;. It is convention to use size-based naming: &amp;lt;code&amp;gt;ExtraSmall&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;Small&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;Medium&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;Large&amp;lt;/code&amp;gt;, but this can be adjusted to suit the specific use-case. &amp;lt;code&amp;gt;AdaptiveBox&amp;lt;/code&amp;gt; is placed in &amp;lt;code&amp;gt;components.xd&amp;lt;/code&amp;gt; and its &amp;lt;code&amp;gt;components&amp;lt;/code&amp;gt; property is set to a list containing the named layouts.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:TechnicalsPanel_components.png|640px|center|Components breakdown of the Technicals Panel]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;components&amp;lt;/code&amp;gt; are listed in order of largest size to smallest size when passed to &amp;lt;code&amp;gt;AdaptiveBox&amp;lt;/code&amp;gt;. Within &amp;lt;code&amp;gt;layout.xd&amp;lt;/code&amp;gt;, the layout for &amp;lt;code&amp;gt;AdaptiveBox&amp;lt;/code&amp;gt; and each layout in &amp;lt;code&amp;gt;layouts&amp;lt;/code&amp;gt; is specified.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:TechnicalsPanel_layout.png|640px|center|Layout breakdown of the Technicals Panel]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;AdaptiveBox&amp;lt;/code&amp;gt; then manages which layout is displayed based on the available space. There is no specifying of fixed-pixel ''breakpoints''.&lt;br /&gt;
&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
When laying out children from &amp;lt;code&amp;gt;components.xd&amp;lt;/code&amp;gt; that have been assigned an alias, use the alias to title the layout. When laying out a component slot, use dot notation to title the slot (e.g. &amp;lt;code&amp;gt;Box.body&amp;lt;/code&amp;gt;) and avoid repeating the layout for the component itself.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;layout.xd&amp;lt;/code&amp;gt; is used to bring a component together, formalizing the position and size relations of it and its children. Approach &amp;lt;code&amp;gt;layout.xd&amp;lt;/code&amp;gt; after fully utilizing &amp;lt;code&amp;gt;components.xd&amp;lt;/code&amp;gt; to enumerate the component’s children and with a firm understanding of how the component will adjust at different sizes.&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
# [https://drive.spiretrading.com/f/91480 Layout Reference Document] &lt;br /&gt;
# [https://wiki.spiretrading.com/index.php/Components#Selectors Selectors Documentation] &lt;br /&gt;
# [https://developer.mozilla.org/en-US/docs/Web/CSS/length CSS Length Units] &lt;br /&gt;
# [https://developer.mozilla.org/en-US/docs/Web/CSS/clamp Clamp Function]&lt;/div&gt;</summary>
		<author><name>Jon</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=File:LayoutExamples.png&amp;diff=211</id>
		<title>File:LayoutExamples.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=File:LayoutExamples.png&amp;diff=211"/>
		<updated>2026-07-07T20:04:11Z</updated>

		<summary type="html">&lt;p&gt;Jon: Examples of various layout elements&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Examples of various layout elements&lt;/div&gt;</summary>
		<author><name>Jon</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=File:TechnicalsPanel_layout.png&amp;diff=210</id>
		<title>File:TechnicalsPanel layout.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=File:TechnicalsPanel_layout.png&amp;diff=210"/>
		<updated>2026-07-07T19:56:18Z</updated>

		<summary type="html">&lt;p&gt;Jon: Layout breakdown for Technicals Panel component&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Layout breakdown for Technicals Panel component&lt;/div&gt;</summary>
		<author><name>Jon</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=File:TechnicalsPanel_components.png&amp;diff=209</id>
		<title>File:TechnicalsPanel components.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=File:TechnicalsPanel_components.png&amp;diff=209"/>
		<updated>2026-07-07T19:55:52Z</updated>

		<summary type="html">&lt;p&gt;Jon: Components breakdown for Technicals Panel component&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Components breakdown for Technicals Panel component&lt;/div&gt;</summary>
		<author><name>Jon</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=File:TechnicalsPanel_preview.png&amp;diff=208</id>
		<title>File:TechnicalsPanel preview.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=File:TechnicalsPanel_preview.png&amp;diff=208"/>
		<updated>2026-07-07T19:55:25Z</updated>

		<summary type="html">&lt;p&gt;Jon: Preview of Technicals Panel component&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Preview of Technicals Panel component&lt;/div&gt;</summary>
		<author><name>Jon</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=File:TabView_layout.png&amp;diff=207</id>
		<title>File:TabView layout.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=File:TabView_layout.png&amp;diff=207"/>
		<updated>2026-07-07T19:54:32Z</updated>

		<summary type="html">&lt;p&gt;Jon: Layout breakdown for Tab View component&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Layout breakdown for Tab View component&lt;/div&gt;</summary>
		<author><name>Jon</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=File:TabView_components.png&amp;diff=206</id>
		<title>File:TabView components.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=File:TabView_components.png&amp;diff=206"/>
		<updated>2026-07-07T19:54:07Z</updated>

		<summary type="html">&lt;p&gt;Jon: Components breakdown for Tab View component&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Components breakdown for Tab View component&lt;/div&gt;</summary>
		<author><name>Jon</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=File:DropDownList_layout.png&amp;diff=205</id>
		<title>File:DropDownList layout.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=File:DropDownList_layout.png&amp;diff=205"/>
		<updated>2026-07-07T19:53:33Z</updated>

		<summary type="html">&lt;p&gt;Jon: Layout definition for Drop Down List component&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Layout definition for Drop Down List component&lt;/div&gt;</summary>
		<author><name>Jon</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=File:ListView_components.png&amp;diff=204</id>
		<title>File:ListView components.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=File:ListView_components.png&amp;diff=204"/>
		<updated>2026-07-07T19:52:43Z</updated>

		<summary type="html">&lt;p&gt;Jon: Component definition for List Item within List View component&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Component definition for List Item within List View component&lt;/div&gt;</summary>
		<author><name>Jon</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=File:SplitView_layout.png&amp;diff=203</id>
		<title>File:SplitView layout.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=File:SplitView_layout.png&amp;diff=203"/>
		<updated>2026-07-07T19:41:18Z</updated>

		<summary type="html">&lt;p&gt;Jon: Layout definition for Split View component in HORIZONTAL orientation&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Layout definition for Split View component in HORIZONTAL orientation&lt;/div&gt;</summary>
		<author><name>Jon</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=File:DecimalBox_preview.png&amp;diff=202</id>
		<title>File:DecimalBox preview.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=File:DecimalBox_preview.png&amp;diff=202"/>
		<updated>2026-07-07T19:40:29Z</updated>

		<summary type="html">&lt;p&gt;Jon: Preview of Decimal Box component&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Preview of Decimal Box component&lt;/div&gt;</summary>
		<author><name>Jon</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=File:DecimalBox_layout.png&amp;diff=201</id>
		<title>File:DecimalBox layout.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=File:DecimalBox_layout.png&amp;diff=201"/>
		<updated>2026-07-07T19:40:04Z</updated>

		<summary type="html">&lt;p&gt;Jon: Layout definition for Decimal Box component&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Layout definition for Decimal Box component&lt;/div&gt;</summary>
		<author><name>Jon</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=File:OverlayPanel_layout.png&amp;diff=200</id>
		<title>File:OverlayPanel layout.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=File:OverlayPanel_layout.png&amp;diff=200"/>
		<updated>2026-07-07T19:39:30Z</updated>

		<summary type="html">&lt;p&gt;Jon: Layout definition for Overlay Panel component&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Layout definition for Overlay Panel component&lt;/div&gt;</summary>
		<author><name>Jon</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=File:SplitView_layout_anatomy.png&amp;diff=199</id>
		<title>File:SplitView layout anatomy.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=File:SplitView_layout_anatomy.png&amp;diff=199"/>
		<updated>2026-07-07T19:38:44Z</updated>

		<summary type="html">&lt;p&gt;Jon: Structural breakdown of layout definition for Split View component&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Structural breakdown of layout definition for Split View component&lt;/div&gt;</summary>
		<author><name>Jon</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=File:TitleBar_layout.png&amp;diff=198</id>
		<title>File:TitleBar layout.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=File:TitleBar_layout.png&amp;diff=198"/>
		<updated>2026-07-07T19:38:02Z</updated>

		<summary type="html">&lt;p&gt;Jon: Layout for Title Bar component&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Layout for Title Bar component&lt;/div&gt;</summary>
		<author><name>Jon</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=File:TitleBar_preview-2.png&amp;diff=197</id>
		<title>File:TitleBar preview-2.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=File:TitleBar_preview-2.png&amp;diff=197"/>
		<updated>2026-07-07T19:36:36Z</updated>

		<summary type="html">&lt;p&gt;Jon: Preview of Title Bar component&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Preview of Title Bar component&lt;/div&gt;</summary>
		<author><name>Jon</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=File:ListView_layout-2.png&amp;diff=196</id>
		<title>File:ListView layout-2.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=File:ListView_layout-2.png&amp;diff=196"/>
		<updated>2026-07-07T19:35:55Z</updated>

		<summary type="html">&lt;p&gt;Jon: Layout definition for Column sub-component in List View component&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Layout definition for Column sub-component in List View component&lt;/div&gt;</summary>
		<author><name>Jon</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=File:ListView_layout.png&amp;diff=195</id>
		<title>File:ListView layout.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=File:ListView_layout.png&amp;diff=195"/>
		<updated>2026-07-07T19:35:20Z</updated>

		<summary type="html">&lt;p&gt;Jon: Layout definition for List View component&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Layout definition for List View component&lt;/div&gt;</summary>
		<author><name>Jon</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=File:Example2_3.png&amp;diff=194</id>
		<title>File:Example2 3.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=File:Example2_3.png&amp;diff=194"/>
		<updated>2026-07-07T19:34:30Z</updated>

		<summary type="html">&lt;p&gt;Jon: Layout example of two FIXED elements &amp;lt;A&amp;gt; and &amp;lt;B&amp;gt; with a FILL_AVAILABLE space between them where there is a lot of available space&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Layout example of two FIXED elements &amp;lt;A&amp;gt; and &amp;lt;B&amp;gt; with a FILL_AVAILABLE space between them where there is a lot of available space&lt;/div&gt;</summary>
		<author><name>Jon</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=File:Example2_2.png&amp;diff=193</id>
		<title>File:Example2 2.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=File:Example2_2.png&amp;diff=193"/>
		<updated>2026-07-07T19:33:48Z</updated>

		<summary type="html">&lt;p&gt;Jon: Layout example of two FIXED elements &amp;lt;A&amp;gt; and &amp;lt;B&amp;gt; with a FILL_AVAILABLE element between them when there is zero available space&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Layout example of two FIXED elements &amp;lt;A&amp;gt; and &amp;lt;B&amp;gt; with a FILL_AVAILABLE element between them when there is zero available space&lt;/div&gt;</summary>
		<author><name>Jon</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=File:Example2_1.png&amp;diff=192</id>
		<title>File:Example2 1.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=File:Example2_1.png&amp;diff=192"/>
		<updated>2026-07-07T19:33:10Z</updated>

		<summary type="html">&lt;p&gt;Jon: Layout example of two FIXED elements &amp;lt;A&amp;gt; and &amp;lt;B&amp;gt;, with a FILL_AVAILABLE element between them&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Layout example of two FIXED elements &amp;lt;A&amp;gt; and &amp;lt;B&amp;gt;, with a FILL_AVAILABLE element between them&lt;/div&gt;</summary>
		<author><name>Jon</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=File:Example1_3.png&amp;diff=191</id>
		<title>File:Example1 3.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=File:Example1_3.png&amp;diff=191"/>
		<updated>2026-07-07T19:32:15Z</updated>

		<summary type="html">&lt;p&gt;Jon: Layout example of two elements with one FIXED and one FILL_AVAILABLE when there is a lot of available space&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Layout example of two elements with one FIXED and one FILL_AVAILABLE when there is a lot of available space&lt;/div&gt;</summary>
		<author><name>Jon</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=File:Example1_2.png&amp;diff=190</id>
		<title>File:Example1 2.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=File:Example1_2.png&amp;diff=190"/>
		<updated>2026-07-07T19:31:40Z</updated>

		<summary type="html">&lt;p&gt;Jon: Layout example of two elements with one FIXED and the other FILL_AVAILABLE when there is zero available space&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Layout example of two elements with one FIXED and the other FILL_AVAILABLE when there is zero available space&lt;/div&gt;</summary>
		<author><name>Jon</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=File:Example1_1.png&amp;diff=189</id>
		<title>File:Example1 1.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=File:Example1_1.png&amp;diff=189"/>
		<updated>2026-07-07T19:30:45Z</updated>

		<summary type="html">&lt;p&gt;Jon: Layout example of two elements with one FIXED and the other FILL_AVAILABLE&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Layout example of two elements with one FIXED and the other FILL_AVAILABLE&lt;/div&gt;</summary>
		<author><name>Jon</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=File:Positioning_2.png&amp;diff=188</id>
		<title>File:Positioning 2.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=File:Positioning_2.png&amp;diff=188"/>
		<updated>2026-07-07T19:29:57Z</updated>

		<summary type="html">&lt;p&gt;Jon: Positioning diagram of an item and surrounding layout elements in a layout&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Positioning diagram of an item and surrounding layout elements in a layout&lt;/div&gt;</summary>
		<author><name>Jon</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=File:Positioning_1.png&amp;diff=187</id>
		<title>File:Positioning 1.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=File:Positioning_1.png&amp;diff=187"/>
		<updated>2026-07-07T19:29:09Z</updated>

		<summary type="html">&lt;p&gt;Jon: Positioning diagram of a single element in a layout&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Positioning diagram of a single element in a layout&lt;/div&gt;</summary>
		<author><name>Jon</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=File:Box_layout.png&amp;diff=186</id>
		<title>File:Box layout.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=File:Box_layout.png&amp;diff=186"/>
		<updated>2026-07-07T19:28:12Z</updated>

		<summary type="html">&lt;p&gt;Jon: Layout definition for Box component&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Layout definition for Box component&lt;/div&gt;</summary>
		<author><name>Jon</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=File:Box_preview.png&amp;diff=185</id>
		<title>File:Box preview.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=File:Box_preview.png&amp;diff=185"/>
		<updated>2026-07-07T19:27:39Z</updated>

		<summary type="html">&lt;p&gt;Jon: Preview of Box component&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Preview of Box component&lt;/div&gt;</summary>
		<author><name>Jon</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=File:LayoutColorSemantics.png&amp;diff=184</id>
		<title>File:LayoutColorSemantics.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=File:LayoutColorSemantics.png&amp;diff=184"/>
		<updated>2026-07-07T19:27:11Z</updated>

		<summary type="html">&lt;p&gt;Jon: Diagram of color encoding semantics used in layout files&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Diagram of color encoding semantics used in layout files&lt;/div&gt;</summary>
		<author><name>Jon</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=File:LayoutSpecificity.png&amp;diff=183</id>
		<title>File:LayoutSpecificity.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=File:LayoutSpecificity.png&amp;diff=183"/>
		<updated>2026-07-07T19:26:01Z</updated>

		<summary type="html">&lt;p&gt;Jon: Layout constraints specificity diagram&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Layout constraints specificity diagram&lt;/div&gt;</summary>
		<author><name>Jon</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=File:Element_Basics.png&amp;diff=182</id>
		<title>File:Element Basics.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=File:Element_Basics.png&amp;diff=182"/>
		<updated>2026-07-07T19:25:05Z</updated>

		<summary type="html">&lt;p&gt;Jon: Structural breakdown of a layout element&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Structural breakdown of a layout element&lt;/div&gt;</summary>
		<author><name>Jon</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=File:Slider_layout_Slider.png&amp;diff=181</id>
		<title>File:Slider layout Slider.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=File:Slider_layout_Slider.png&amp;diff=181"/>
		<updated>2026-07-07T19:24:03Z</updated>

		<summary type="html">&lt;p&gt;Jon: Layout definition for Slider&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Layout definition for Slider&lt;/div&gt;</summary>
		<author><name>Jon</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=File:Slider_layout_Box.body.png&amp;diff=180</id>
		<title>File:Slider layout Box.body.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=File:Slider_layout_Box.body.png&amp;diff=180"/>
		<updated>2026-07-07T19:23:26Z</updated>

		<summary type="html">&lt;p&gt;Jon: Layout definition for Slider Box body sub-component&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Layout definition for Slider Box body sub-component&lt;/div&gt;</summary>
		<author><name>Jon</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=File:Slider_layout_Track.body.png&amp;diff=179</id>
		<title>File:Slider layout Track.body.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=File:Slider_layout_Track.body.png&amp;diff=179"/>
		<updated>2026-07-07T19:22:53Z</updated>

		<summary type="html">&lt;p&gt;Jon: Layout definition for Slider Track body sub-component&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Layout definition for Slider Track body sub-component&lt;/div&gt;</summary>
		<author><name>Jon</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=File:Slider_layout_Thumb.png&amp;diff=178</id>
		<title>File:Slider layout Thumb.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=File:Slider_layout_Thumb.png&amp;diff=178"/>
		<updated>2026-07-07T19:22:14Z</updated>

		<summary type="html">&lt;p&gt;Jon: Layout definition for Slider Thumb sub-component&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Layout definition for Slider Thumb sub-component&lt;/div&gt;</summary>
		<author><name>Jon</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=File:Slider_components.png&amp;diff=177</id>
		<title>File:Slider components.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=File:Slider_components.png&amp;diff=177"/>
		<updated>2026-07-07T19:21:31Z</updated>

		<summary type="html">&lt;p&gt;Jon: Components breakdown for the Slider component&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Components breakdown for the Slider component&lt;/div&gt;</summary>
		<author><name>Jon</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=File:Slider_preview.png&amp;diff=176</id>
		<title>File:Slider preview.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=File:Slider_preview.png&amp;diff=176"/>
		<updated>2026-07-07T19:21:00Z</updated>

		<summary type="html">&lt;p&gt;Jon: Preview of the Slider component&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Preview of the Slider component&lt;/div&gt;</summary>
		<author><name>Jon</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=File:HighlightPicker_layout.png&amp;diff=175</id>
		<title>File:HighlightPicker layout.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=File:HighlightPicker_layout.png&amp;diff=175"/>
		<updated>2026-07-07T18:50:31Z</updated>

		<summary type="html">&lt;p&gt;Jon: Layout for Highlight Picker component&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Layout for Highlight Picker component&lt;/div&gt;</summary>
		<author><name>Jon</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=Model&amp;diff=174</id>
		<title>Model</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=Model&amp;diff=174"/>
		<updated>2026-07-07T18:21:33Z</updated>

		<summary type="html">&lt;p&gt;Jon: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;User interfaces are composed of reusable semantic elements called components. Each component is specified by a set of documents: &amp;lt;code&amp;gt;model.txt&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;preview.xd&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;components.xd&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;layout.xd&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;user_flow.drawio&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;use_cases.drawio&amp;lt;/code&amp;gt;. This page covers the &amp;lt;code&amp;gt;model.txt&amp;lt;/code&amp;gt; document.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;model.txt&amp;lt;/code&amp;gt; provides the complete description of the data the component operates on and displays, the state of the component, and the signals it produces. Any component with new behavior requires &amp;lt;code&amp;gt;model.txt&amp;lt;/code&amp;gt;. Components that simply customize the properties of existing components omit &amp;lt;code&amp;gt;model.txt&amp;lt;/code&amp;gt; as there is nothing to describe that is not already defined in &amp;lt;code&amp;gt;components.xd&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;data-and-behavior&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== Data and Behavior ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;model.txt&amp;lt;/code&amp;gt; is necessary when the component being defined has specific data that it displays or manipulates or introduces novel behavior not found elsewhere in the UI Kit.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;example-accountlistitem&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== Example: AccountListItem ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Data:&lt;br /&gt;
  identicon: A unique icon identifier for the account.&lt;br /&gt;
  id: A unique username for the account.&lt;br /&gt;
  name: The full name associated with the account.&amp;lt;/pre&amp;gt;&lt;br /&gt;
The model for &amp;lt;code&amp;gt;AccountListItem&amp;lt;/code&amp;gt; is very simple and deals only with data. There is no special behavior associated with &amp;lt;code&amp;gt;AccountListItem&amp;lt;/code&amp;gt;: it behaves no differently than any other &amp;lt;code&amp;gt;ListItem&amp;lt;/code&amp;gt; that has been defined elsewhere. &amp;lt;code&amp;gt;AccountListItem&amp;lt;/code&amp;gt; takes a structured set of data:&lt;br /&gt;
* &amp;lt;code&amp;gt;identicon&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;id&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;name&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using a specific &amp;lt;code&amp;gt;AccountListItem&amp;lt;/code&amp;gt; for displaying user accounts in this way keeps components contained and simple.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;example-button&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== Example: Button ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Data:&lt;br /&gt;
  body: The component to display inside of the button.&lt;br /&gt;
&lt;br /&gt;
State:  &lt;br /&gt;
  press: Whether the button is currently pressed.&lt;br /&gt;
&lt;br /&gt;
Signals:&lt;br /&gt;
  Click: Indicates that the button was clicked.&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;Button&amp;lt;/code&amp;gt; is a more generic component. From &amp;lt;code&amp;gt;body&amp;lt;/code&amp;gt;, we see that it can be used to display any component, so there is no specific data associated with it. What distinguishes &amp;lt;code&amp;gt;Button&amp;lt;/code&amp;gt; from &amp;lt;code&amp;gt;Component&amp;lt;/code&amp;gt; is its behavior:&lt;br /&gt;
* &amp;lt;code&amp;gt;press&amp;lt;/code&amp;gt; is a new '''State''' that &amp;lt;code&amp;gt;Button&amp;lt;/code&amp;gt; can be in.&lt;br /&gt;
* &amp;lt;code&amp;gt;Click&amp;lt;/code&amp;gt; is a new '''Signal''' that &amp;lt;code&amp;gt;Button&amp;lt;/code&amp;gt; can send.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;getting-started&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== Getting Started ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;model.txt&amp;lt;/code&amp;gt; is written after &amp;lt;code&amp;gt;preview.xd&amp;lt;/code&amp;gt;. Clarifying in writing what data the component uses greatly simplifies the making of &amp;lt;code&amp;gt;components.xd&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;use_cases.drawio&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;user_flow.drawio&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Most expected behavior is specified in &amp;lt;code&amp;gt;Component&amp;lt;/code&amp;gt;, the base component for all UI components. Any property or signal found in &amp;lt;code&amp;gt;Component&amp;lt;/code&amp;gt; can be used by any component without repeating them in the model. This makes the model for most components sparse and keeps the focus on their ''unique'' data and behavior.&lt;br /&gt;
&lt;br /&gt;
Components are built using composition: complexity is built up from simple elements that manage a small set of responsibilities. These smaller elements are the &amp;lt;code&amp;gt;children&amp;lt;/code&amp;gt; and when we consider the model for a component it is helpful to think about what responsibilities are handled by its children rather than being its concern.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;example-dropdownbox&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== Example: DropDownBox ===&lt;br /&gt;
&lt;br /&gt;
[[File:Drop_down_box_preview.png|640px|center|Closed and open states of Drop Down Box]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;DropDownBox&amp;lt;/code&amp;gt; lets the user select a single value from a list of options and submit that value. It has a child &amp;lt;code&amp;gt;DropDownList&amp;lt;/code&amp;gt;: the list of options and whether the list is open or closed can be thought of as properties of &amp;lt;code&amp;gt;DropDownList&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
To describe &amp;lt;code&amp;gt;DropDownBox&amp;lt;/code&amp;gt;, we need to understand a little more of its behavior: &lt;br /&gt;
* It represents a single value that the user can select.&lt;br /&gt;
* Selecting a value is different from submitting a value. The user can select a value without submitting it.&lt;br /&gt;
* The user can revert a selection to what was last submitted (by pressing the Escape key).&lt;br /&gt;
* Focusing out of the &amp;lt;code&amp;gt;DropDownBox&amp;lt;/code&amp;gt; is treated as a submission when the selected value has changed from the last submitted value.&lt;br /&gt;
* It can be set to be read only.&lt;br /&gt;
&lt;br /&gt;
Based on its behavior, we need a few properties:&lt;br /&gt;
* A property to track the selected value&lt;br /&gt;
* A property to track the last submitted value&lt;br /&gt;
* A property to indicate if it is read only&lt;br /&gt;
&lt;br /&gt;
Other components will need to be notified when the user has made a submission so they can respond to changes. We can add one more requirement:&lt;br /&gt;
* A signal to indicate a submission&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Data:&lt;br /&gt;
  read_only: Whether the value is modifiable by the user.&lt;br /&gt;
  current: The item currently represented by the DropDownBox.&lt;br /&gt;
&lt;br /&gt;
State:&lt;br /&gt;
  submission: The last value submitted by the user.&lt;br /&gt;
  modified: Whether current has been modified since last Submit.&lt;br /&gt;
&lt;br /&gt;
Signals:&lt;br /&gt;
  Submit: Indicates the user is submitting current.&amp;lt;/pre&amp;gt;&lt;br /&gt;
Reviewing the &amp;lt;code&amp;gt;model.txt&amp;lt;/code&amp;gt;, we see the following:&lt;br /&gt;
* &amp;lt;code&amp;gt;current&amp;lt;/code&amp;gt; to track the selected value&lt;br /&gt;
* &amp;lt;code&amp;gt;submission&amp;lt;/code&amp;gt; to track the last submitted value&lt;br /&gt;
* &amp;lt;code&amp;gt;read_only&amp;lt;/code&amp;gt; to indicate if it is read only&lt;br /&gt;
* &amp;lt;code&amp;gt;modified&amp;lt;/code&amp;gt; to track whether &amp;lt;code&amp;gt;current&amp;lt;/code&amp;gt; changed from &amp;lt;code&amp;gt;submission&amp;lt;/code&amp;gt; (not strictly necessary)&lt;br /&gt;
* &amp;lt;code&amp;gt;Submit&amp;lt;/code&amp;gt;, a signal to indicate a submission&lt;br /&gt;
&lt;br /&gt;
We note that &amp;lt;code&amp;gt;read_only&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;current&amp;lt;/code&amp;gt; have been placed in &amp;lt;code&amp;gt;Data&amp;lt;/code&amp;gt;, while &amp;lt;code&amp;gt;submission&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;modified&amp;lt;/code&amp;gt; are in &amp;lt;code&amp;gt;State&amp;lt;/code&amp;gt;. This means that external components can modify &amp;lt;code&amp;gt;read_only&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;current&amp;lt;/code&amp;gt;, while &amp;lt;code&amp;gt;DropDownBox&amp;lt;/code&amp;gt; manages &amp;lt;code&amp;gt;submission&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;modified&amp;lt;/code&amp;gt; itself. &amp;lt;code&amp;gt;Submit&amp;lt;/code&amp;gt; is placed in &amp;lt;code&amp;gt;Signals&amp;lt;/code&amp;gt;. Properties are named using '''snake_case''' while signals use '''PascalCase'''.&lt;br /&gt;
&lt;br /&gt;
It may be useful for external components to respond to changes in &amp;lt;code&amp;gt;current&amp;lt;/code&amp;gt; as well as &amp;lt;code&amp;gt;submission&amp;lt;/code&amp;gt;, such as showing a preview based on the current selection, but a &amp;lt;code&amp;gt;Current&amp;lt;/code&amp;gt; signal is not necessary for this. Because properties in &amp;lt;code&amp;gt;Data&amp;lt;/code&amp;gt; are read-write for external components, components can subscribe to property changes directly without requiring a signal.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;anatomy&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== Anatomy ==&lt;br /&gt;
&lt;br /&gt;
The structure of &amp;lt;code&amp;gt;model.txt&amp;lt;/code&amp;gt; is a linear document divided into preset sections. These sections are as follows: &lt;br /&gt;
* Definitions&lt;br /&gt;
* Styles&lt;br /&gt;
* Selectors&lt;br /&gt;
* Pseudo-Elements&lt;br /&gt;
* Data&lt;br /&gt;
* State&lt;br /&gt;
* Signals&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Definitions&amp;lt;/code&amp;gt; serve as an optional index for terms used throughout the model. &amp;lt;code&amp;gt;Selectors&amp;lt;/code&amp;gt; are used in older specs but should be avoided for simplicity. &amp;lt;code&amp;gt;Pseudo-Elements&amp;lt;/code&amp;gt; define sub-sections of the component and make them available for styling. The remaining sections &amp;lt;code&amp;gt;Styles&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;Data&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;State&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;Signals&amp;lt;/code&amp;gt; can be conceptualized as relating to the interface as shown: &lt;br /&gt;
&lt;br /&gt;
[[File: Model_Component_anatomy.png|640px|center|Diagram of dataflow through a component]] &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Data&amp;lt;/code&amp;gt; flows through the interface, depending on the component, both external resources and the user may be able to modify &amp;lt;code&amp;gt;Data&amp;lt;/code&amp;gt; properties.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Styles&amp;lt;/code&amp;gt; can be set by external components to change the appearance of the component. Generally, the user doesn’t directly modify the style of a component, so these can be thought of as one-way.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;State&amp;lt;/code&amp;gt; is managed internally by the component. It can be influenced by user interactions, by &amp;lt;code&amp;gt;Data&amp;lt;/code&amp;gt;, or any combination of properties, but it remains encapsulated.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Signals&amp;lt;/code&amp;gt; are messages sent out by the component. They inform other components about changes that are useful to know about resulting from a user action.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;breakdown&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== Breakdown ===&lt;br /&gt;
&lt;br /&gt;
Within each section is a list of properties followed by their definitions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Section Heading:&lt;br /&gt;
  property_name: Property description. Optional default.&amp;lt;/pre&amp;gt;&lt;br /&gt;
Property names should balance brevity with self-description. Leaning on familiar and established terminology is preferred over introducing new terms with the same meaning.&lt;br /&gt;
&lt;br /&gt;
Descriptions should be precise, concise, and readable, expressing in plain language the meaning of the property. If a property can only be one of a finite set of values, the possible values are enumerated directly in the definition by nesting them below the property name and definition.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Section Heading:&lt;br /&gt;
  property_name: Property description.&lt;br /&gt;
    POSSIBLE_VALUE_1: Value description for 1. Default.&lt;br /&gt;
    POSSIBLE_VALUE_2: Value description for 2.&amp;lt;/pre&amp;gt;&lt;br /&gt;
Values are distinguished using UPPERCASE.&lt;br /&gt;
&lt;br /&gt;
Properties can consist of sub-properties, such as list or tabular data, or properties consisting of multiple orthogonal components such as the &amp;lt;code&amp;gt;x&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;y&amp;lt;/code&amp;gt; components of a position. Sub-properties are nested beneath properties.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Section Heading:&lt;br /&gt;
  property_name: Property description. Optional default.&lt;br /&gt;
    sub_property_name: Sub property description. Optional default.&amp;lt;/pre&amp;gt;&lt;br /&gt;
Descriptions can include inline expressions provided they are trivial. With expressions, it is understood that they represent a ''binding'': they update automatically without requiring a sub-flow in &amp;lt;code&amp;gt;user_flow.drawio&amp;lt;/code&amp;gt;. When an expression is used, it is placed on its own line below the last sentence for the description. The equality is implied.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Section Heading:&lt;br /&gt;
  property_name_1: Property description. Optional default.&lt;br /&gt;
  property_name_2: Property description.&lt;br /&gt;
                   property_name_1 + 10&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;span id=&amp;quot;example-component&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== Example: Component ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Styles:&lt;br /&gt;
  visibility: Shows or hides the component.&lt;br /&gt;
    VISIBLE: The component is visible, (default).&lt;br /&gt;
    INVISIBLE: The component is invisible.&lt;br /&gt;
    NONE: The component is both invisible and removed from the layout.&amp;lt;/pre&amp;gt;&lt;br /&gt;
In the above excerpt from &amp;lt;code&amp;gt;model.txt&amp;lt;/code&amp;gt; for &amp;lt;code&amp;gt;Component&amp;lt;/code&amp;gt;, the &amp;lt;code&amp;gt;visibility&amp;lt;/code&amp;gt; property is defined within the &amp;lt;code&amp;gt;Styles&amp;lt;/code&amp;gt; section. &amp;lt;code&amp;gt;visibility&amp;lt;/code&amp;gt; can be one of three values: &lt;br /&gt;
* &amp;lt;code&amp;gt;VISIBLE&amp;lt;/code&amp;gt; &lt;br /&gt;
* &amp;lt;code&amp;gt;INVISIBLE&amp;lt;/code&amp;gt; &lt;br /&gt;
* &amp;lt;code&amp;gt;NONE&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Each possible value is named and defined directly below the definition for &amp;lt;code&amp;gt;visibility&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Data:&lt;br /&gt;
  parent: The parent of this component, for top-level components this is NULL.&lt;br /&gt;
  window: The window that this component belongs to.&lt;br /&gt;
  children: The list of this component's children.&lt;br /&gt;
  width: The width of the component in pixels.&lt;br /&gt;
  height: The height of the component in pixels.&lt;br /&gt;
  position: The position of the component relative to its parent, if the&lt;br /&gt;
            component has no parent, then the position is equal to&lt;br /&gt;
            screen_position.&lt;br /&gt;
    x - The x-coordinate in pixels.&lt;br /&gt;
    y - The y-coordinate in pixels.&amp;lt;/pre&amp;gt;&lt;br /&gt;
Continuing to the &amp;lt;code&amp;gt;Data&amp;lt;/code&amp;gt; section, the &amp;lt;code&amp;gt;position&amp;lt;/code&amp;gt; property is a composite of two independent values: &amp;lt;code&amp;gt;x&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;y&amp;lt;/code&amp;gt;. These properties can be referenced in other documentation with dot notation as &amp;lt;code&amp;gt;position.x&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;position.y&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;example-saleconditionbox&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== Example: SaleConditionBox ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;State:&lt;br /&gt;
  conditions_list: A list of all conditions.&lt;br /&gt;
    code: The identifier for the condition.&lt;br /&gt;
    name: The name for the condition.&lt;br /&gt;
    terms: The list of words from the name for the condition.&lt;br /&gt;
           name.split(' ')&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;conditions_list&amp;lt;/code&amp;gt; is a list of items, where each item has the fields specified. Visually it can be shown as tabular data. Below is what some of this data might look like: &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! code !! name !! terms&lt;br /&gt;
|-&lt;br /&gt;
| @ || Regular Settlement || Regular, Settlement&lt;br /&gt;
|-&lt;br /&gt;
| C || Cash Settlement || Cash, Settlement&lt;br /&gt;
|-&lt;br /&gt;
| N || Next Day Settlement || Next, Day, Settlement&lt;br /&gt;
|-&lt;br /&gt;
| R || Seller Settlement || Seller, Settlement&lt;br /&gt;
|-&lt;br /&gt;
| F || Intermarket Sweep || Intermarket, Sweep&lt;br /&gt;
|-&lt;br /&gt;
| O || Opening Print || Opening, Print&lt;br /&gt;
|-&lt;br /&gt;
| 4 || Derivative Price || Derivative, Priced&lt;br /&gt;
|-&lt;br /&gt;
| 5 || Re-Opening Print || Re-Opening, Print&lt;br /&gt;
|-&lt;br /&gt;
| 6 || Closing Print || Closing, Print&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;terms&amp;lt;/code&amp;gt; is clearly derived from &amp;lt;code&amp;gt;name&amp;lt;/code&amp;gt;, the result of the inline expression. If the expression is non-trivial or not unconditionally true, then it does not belong in &amp;lt;code&amp;gt;model.txt&amp;lt;/code&amp;gt;. If you are unsure if an expression improves the clarity of the model, leave it out.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;example-inputbox&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== Example: InputBox ===&lt;br /&gt;
&lt;br /&gt;
Boolean (true or false) properties have implied values.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Data:&lt;br /&gt;
  read_only: Whether the InputBox is in read_only mode.&lt;br /&gt;
  rejected: Whether the last submission was rejected.&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;InputBox&amp;lt;/code&amp;gt; has two boolean properties: &amp;lt;code&amp;gt;read_only&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;rejected&amp;lt;/code&amp;gt;. Each may be &amp;lt;code&amp;gt;true&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;false&amp;lt;/code&amp;gt;, which is implied from their definitions.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;definitions&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== Definitions ==&lt;br /&gt;
&lt;br /&gt;
This section is optional. It provides definitions for terms used throughout the model to improve clarity.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;example-timeandsaleswindow&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== Example: TimeAndSalesWindow ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Definitions:&lt;br /&gt;
  TimeAndSale: A trade on a security.&lt;br /&gt;
    timestamp: The time of the trade.&lt;br /&gt;
    price: The price of the trade.&lt;br /&gt;
    size: The number of shares traded.&lt;br /&gt;
    condition: A code that indicates the conditions of the trade.&lt;br /&gt;
    market_center: The market that facilitated the trade.&lt;br /&gt;
    bbo_indicator: An indicator that relates the price to the bbo.&lt;br /&gt;
      BBO_UNKNOWN: The bbo is unknown.&lt;br /&gt;
      ABOVE_ASK: The price is above the ask.&lt;br /&gt;
      AT_ASK: The price is equal to the ask.&lt;br /&gt;
      INSIDE: The price is between the bid and the ask.&lt;br /&gt;
      AT_BID: The price is equal to the bid.&lt;br /&gt;
      BELOW_BID: The price is below the bid.&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;Definitions&amp;lt;/code&amp;gt; is used to define a &amp;lt;code&amp;gt;TimeAndSale&amp;lt;/code&amp;gt;. Each &amp;lt;code&amp;gt;TimeAndSale&amp;lt;/code&amp;gt; has a set of properties associated with it: &lt;br /&gt;
* &amp;lt;code&amp;gt;timestamp&amp;lt;/code&amp;gt; &lt;br /&gt;
* &amp;lt;code&amp;gt;price&amp;lt;/code&amp;gt; &lt;br /&gt;
* &amp;lt;code&amp;gt;size&amp;lt;/code&amp;gt; &lt;br /&gt;
* &amp;lt;code&amp;gt;condition&amp;lt;/code&amp;gt; &lt;br /&gt;
* &amp;lt;code&amp;gt;market_center&amp;lt;/code&amp;gt; &lt;br /&gt;
* &amp;lt;code&amp;gt;bbo_indicator&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;TimeAndSale&amp;lt;/code&amp;gt; can be referenced elsewhere in the model.&lt;br /&gt;
&lt;br /&gt;
It is at the designer’s discretion whether to include a &amp;lt;code&amp;gt;Definitions&amp;lt;/code&amp;gt; section or to provide the description inline where the term is used. The following heuristics are helpful in determining whether to place a definition in a &amp;lt;code&amp;gt;Definitions&amp;lt;/code&amp;gt; section: &lt;br /&gt;
* The term is referenced by multiple properties throughout the model &lt;br /&gt;
* The definition is long or contains multiple levels of nesting which would impede the readability if included directly in the normal flow of the document &lt;br /&gt;
&lt;br /&gt;
When unsure, err on the side of putting the description inline rather than including a Definitions section.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;styles&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== Styles ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Styles&amp;lt;/code&amp;gt; is for defining any style properties available on the component. Style properties affect the visual appearance of a component but do not directly relate to the data it displays. Style properties can be inputs that are provided externally to the component.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;example-box&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== Example: Box ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Styles:&lt;br /&gt;
  background_color: The background color. #FFFFFF by default.&lt;br /&gt;
  border_top_size: The height of the top border.&lt;br /&gt;
  border_right_size: The width of the right border.&lt;br /&gt;
  border_bottom_size: The height of the bottom border.&lt;br /&gt;
  border_left_size: The width of the left border.&lt;br /&gt;
  ...&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;Box&amp;lt;/code&amp;gt; defines a number of style properties for customizing its color, border, and padding. External components using &amp;lt;code&amp;gt;Box&amp;lt;/code&amp;gt; can make use of any of these properties as needed.&lt;br /&gt;
&lt;br /&gt;
No matter how deep in the component hierarchy a &amp;lt;code&amp;gt;Box&amp;lt;/code&amp;gt; is nested as a child, the component can access the properties for that &amp;lt;code&amp;gt;Box&amp;lt;/code&amp;gt; and make customizations. This avoids creating redundant properties to enable customization.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;example-timeandsale&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== Example: TimeAndSale ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Styles:&lt;br /&gt;
  font: The font used to render the text in the cells. &lt;br /&gt;
        Default 10px Roboto 500.&lt;br /&gt;
  bbo_unknown: The bbo is unknown.&lt;br /&gt;
    background_color: Default #FFFFFF.&lt;br /&gt;
    text_color: Default #000000.&lt;br /&gt;
  above_ask: The price is above the ask.&lt;br /&gt;
    background_color: Default #D2F6E0.&lt;br /&gt;
    text_color: Default #007735.&lt;br /&gt;
  at_ask: The price is equal to the ask.&lt;br /&gt;
    background_color: Default #D2F6E0.&lt;br /&gt;
    text_color: Default #007735.&lt;br /&gt;
  inside: The price is between the bid and the ask.&lt;br /&gt;
    background_color: Default #FFFFFF.&lt;br /&gt;
    text_color: Default #000000.&lt;br /&gt;
  at_bid: The price is equal to the bid.&lt;br /&gt;
    background_color: Default #FAD8D9.&lt;br /&gt;
    text_color: Default #B71C1C.&lt;br /&gt;
  below_bid: The price is below the bid.&lt;br /&gt;
    background_color: Default #FAD8D9.&lt;br /&gt;
    text_color: Default #B71C1C.&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;TimeAndSale&amp;lt;/code&amp;gt; defines a number of style properties specific to its function. &amp;lt;code&amp;gt;font&amp;lt;/code&amp;gt; is defined in &amp;lt;code&amp;gt;TextBox&amp;lt;/code&amp;gt; and ordinarily does not need to be redefined: here it is done for convenience so that all the children of &amp;lt;code&amp;gt;TimeAndSale&amp;lt;/code&amp;gt; are styled with the same font without having to make separate declarations for each child. The remaining properties relate to &amp;lt;code&amp;gt;TimeAndSale&amp;lt;/code&amp;gt;: they depend on a comparison between the price of the &amp;lt;code&amp;gt;TimeAndSale&amp;lt;/code&amp;gt; to the bid and ask prices.&lt;br /&gt;
&lt;br /&gt;
Note that each comparative style (&amp;lt;code&amp;gt;bbo_unknown&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;above_ask&amp;lt;/code&amp;gt;, etc.) is a composite style of &amp;lt;code&amp;gt;background_color&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;text_color&amp;lt;/code&amp;gt;: coordinating separate styles into a set of presets is a common use case for &amp;lt;code&amp;gt;Styles&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The basic styles are all available in &amp;lt;code&amp;gt;Box&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;TextBox&amp;lt;/code&amp;gt;. Components should only define styles that are sensible to their function. Styles are not restricted to the properties and selectors of CSS or other languages, they are defined within &amp;lt;code&amp;gt;model.txt&amp;lt;/code&amp;gt; to suit the specific needs of the component.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;selectors&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== Selectors ==&lt;br /&gt;
&lt;br /&gt;
Selectors may be deprecated. They were used to bundle &amp;lt;code&amp;gt;Styles&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;State&amp;lt;/code&amp;gt; in an opt-in manner. It is recommended to use &amp;lt;code&amp;gt;Styles&amp;lt;/code&amp;gt; in combination with &amp;lt;code&amp;gt;State&amp;lt;/code&amp;gt; for any properties that can be used to style the component.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;pseudo-elements&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== Pseudo-Elements ==&lt;br /&gt;
&lt;br /&gt;
Pseudo-elements are a way to give full styling properties to portions of a component that are not components themselves. They are used infrequently but can be useful for fundamental components that consist of semantic portions that are not components. Consider the following usage in TextBox:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Pseudo-elements:&lt;br /&gt;
  placeholder: Styles the placeholder sub-component.&amp;lt;/pre&amp;gt;&lt;br /&gt;
This enables the placeholder to be styled using the same properties as for TextBox, even though it is not itself a component. Text is the most obvious use case for pseudo-elements, as it can be broken up semantically into granular parts. See [https://web.dev/learn/css/pseudo-elements/ Pseudo-Elements on Web.dev] and [https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/Selectors/Pseudo-classes_and_pseudo-elements#what_is_a_pseudo-element Pseudo-Elements on MDN] for more detail.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;data&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== Data ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Data&amp;lt;/code&amp;gt; is for properties that do not deal directly with styling and are provided externally. Properties in &amp;lt;code&amp;gt;Data&amp;lt;/code&amp;gt; are read-write to external components and may be modifiable by the user (such as the value of an input field).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Data&amp;lt;/code&amp;gt; properties are not fixed, they can be updated from an external source at any time. It is common to have &amp;lt;code&amp;gt;Data&amp;lt;/code&amp;gt; properties that represent a stream, such as quotes from an exchange, which update as soon as they change without requiring a user-initiated update request. Anytime a property in &amp;lt;code&amp;gt;Data&amp;lt;/code&amp;gt; is changed, the change is immediately reflected in the component. It is sufficient to declare where the value resides in the component and it will always reflect the latest value.&lt;br /&gt;
&lt;br /&gt;
A default value is often declared. Where the data comes from is not specified (e.g. from a backend or a local file), that should be determined by the type of data and the application architecture.&lt;br /&gt;
&lt;br /&gt;
The following heuristic may be useful in determining whether property values belong in &amp;lt;code&amp;gt;Data&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;State&amp;lt;/code&amp;gt;. It belongs in &amp;lt;code&amp;gt;Data&amp;lt;/code&amp;gt; if: &lt;br /&gt;
* The value can be modified by the user through interaction with the component &lt;br /&gt;
* The value is read from an external source requiring real-time updates &lt;br /&gt;
* There are obvious use-cases where external components will need to read or write to the value&lt;br /&gt;
&lt;br /&gt;
Otherwise, put the value in &amp;lt;code&amp;gt;State&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;example-textbox&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== Example: TextBox ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Data:&lt;br /&gt;
  current: The text currently represented by the TextBox.&lt;br /&gt;
  cursor_position: The current cursor position. When 0, the cursor is at the&lt;br /&gt;
                   start of the TextBox.&lt;br /&gt;
  selection_start: The index position of the character in current at&lt;br /&gt;
                   the start of selection.&lt;br /&gt;
  selection_end: The index position of the character in current at the&lt;br /&gt;
                 end of selection. When selection_end &amp;amp;lt; selection_start,&lt;br /&gt;
                 the direction of selection is opposite of reading order.&lt;br /&gt;
  read_only: Whether the text is modifiable by the user.&lt;br /&gt;
  placeholder: The text to be displayed when current is empty.&lt;br /&gt;
  max_length: The maximum number of characters to accept.&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;TextBox&amp;lt;/code&amp;gt; has a number of bi-directional properties: &amp;lt;code&amp;gt;current&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;cursor_position&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;selection_start&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;selection_end&amp;lt;/code&amp;gt; are all typically driven by user actions, but they can also be set by external components or when the component is customized, such as setting an initial &amp;lt;code&amp;gt;current&amp;lt;/code&amp;gt; value to display. There are also properties that are not modifiable by the user: &amp;lt;code&amp;gt;read_only&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;placeholder&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;max_length&amp;lt;/code&amp;gt;. However, it is possible for external components to modify these, so a component could be made that let the user change these properties.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;standard-property-names&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== Standard Property Names ===&lt;br /&gt;
&lt;br /&gt;
Properties are directly defined in the &amp;lt;code&amp;gt;model.txt&amp;lt;/code&amp;gt; and may be anything the designer can define. That said, there are commonly recurring properties that have come to form an implicit convention and it is preferable to use consistent names and descriptions when the intended behavior is the same.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;current&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
==== Current ====&lt;br /&gt;
&lt;br /&gt;
In the &amp;lt;code&amp;gt;TextBox&amp;lt;/code&amp;gt; example, the text is named &amp;lt;code&amp;gt;current&amp;lt;/code&amp;gt; and not &amp;lt;code&amp;gt;text&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;value&amp;lt;/code&amp;gt;. This is intentional: &amp;lt;code&amp;gt;current&amp;lt;/code&amp;gt; is a standard property name.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;example-decimalbox&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
===== Example: DecimalBox =====&lt;br /&gt;
&lt;br /&gt;
In &amp;lt;code&amp;gt;DecimalBox&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;current&amp;lt;/code&amp;gt; refers to a number rather than a text string.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Data:&lt;br /&gt;
  current: The current number represented by the DecimalBox.&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;span id=&amp;quot;example-datebox&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
===== Example: DateBox =====&lt;br /&gt;
&lt;br /&gt;
In &amp;lt;code&amp;gt;DateBox&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;current&amp;lt;/code&amp;gt; refers to a date value, not a number or text string.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Data:&lt;br /&gt;
  current: The current date represented by the DateBox, in ISO format&lt;br /&gt;
           (YYYY-MM-DD).&amp;lt;/pre&amp;gt;&lt;br /&gt;
By convention, &amp;lt;code&amp;gt;current&amp;lt;/code&amp;gt; refers to the current value of the component. The type of the value is generally defined by what the component displays.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;example-scalarfilterpanel&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
===== Example: ScalarFilterPanel =====&lt;br /&gt;
&lt;br /&gt;
If there is no logical single current value for the component, it should not have &amp;lt;code&amp;gt;current&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Data:&lt;br /&gt;
  min: If set defines the minimum value to include.&lt;br /&gt;
  default_min: The default min value.&lt;br /&gt;
  max: If set defines the maximum value to include.&lt;br /&gt;
  default_max: The default max value.&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;ScalarFilterPanel&amp;lt;/code&amp;gt; has two &amp;lt;code&amp;gt;DecimalBox&amp;lt;/code&amp;gt;, one aliased as &amp;lt;code&amp;gt;MinValue&amp;lt;/code&amp;gt; and another aliased as &amp;lt;code&amp;gt;MaxValue&amp;lt;/code&amp;gt;, and has access to &amp;lt;code&amp;gt;MinValue.current&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;MaxValue.current&amp;lt;/code&amp;gt;. It does not have a &amp;lt;code&amp;gt;current&amp;lt;/code&amp;gt; as it does not represent a single value.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;example-tablebody&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
===== Example: TableBody =====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;current&amp;lt;/code&amp;gt; can be made more specific where appropriate.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Data:&lt;br /&gt;
  rows: A list of table_rows each having an equal number of columns, used to&lt;br /&gt;
        populate the body.&lt;br /&gt;
  row_selection_mode: The selection mode used by rows (NONE by default).&lt;br /&gt;
  row_selection: Stores the list of selected rows.&lt;br /&gt;
  column_selection_mode: The selection mode used by columns (NONE by default).&lt;br /&gt;
  column_selection: Stores the list of selected columns.&lt;br /&gt;
  cell_selection: Stores the list of selected cells, indexed by row and column.&lt;br /&gt;
  cell_selection_mode: The selection mode used by cells (NONE by default).&lt;br /&gt;
  current_cell: The currently selected cell (null by default). The current cell&lt;br /&gt;
           can be used to implicitly specify a current row and current column&lt;br /&gt;
           if such functionality is desirable, for example the current cell's&lt;br /&gt;
           row is implicitly the current row.&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;TableBody&amp;lt;/code&amp;gt; has a &amp;lt;code&amp;gt;current_cell&amp;lt;/code&amp;gt; property but no &amp;lt;code&amp;gt;current&amp;lt;/code&amp;gt; property. Because &amp;lt;code&amp;gt;TableBody&amp;lt;/code&amp;gt; can only have one cell as current, it makes sense that this is a property of &amp;lt;code&amp;gt;TableBody&amp;lt;/code&amp;gt; and not of any of its children. However, &amp;lt;code&amp;gt;TableBody&amp;lt;/code&amp;gt; does not represent a single cell, so &amp;lt;code&amp;gt;current&amp;lt;/code&amp;gt; without added specificity could cause confusion.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;example-listview&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
===== Example: ListView =====&lt;br /&gt;
&lt;br /&gt;
Do not use current for lists of data: &amp;lt;code&amp;gt;current&amp;lt;/code&amp;gt; refers to one value that varies in time.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Data:&lt;br /&gt;
  current: The view's current value, can be null.&lt;br /&gt;
  selected: The value of the selected list item.&lt;br /&gt;
  items: A list of items used to populate the list.&lt;br /&gt;
    component: The component to display in the list.&lt;br /&gt;
    value: A text value associated with an item, used to select an item by&lt;br /&gt;
           keyboard.&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;ListView&amp;lt;/code&amp;gt; uses &amp;lt;code&amp;gt;current&amp;lt;/code&amp;gt; for the single value that is current, and &amp;lt;code&amp;gt;items&amp;lt;/code&amp;gt; contains the list of values that make up the list. While &amp;lt;code&amp;gt;ListView&amp;lt;/code&amp;gt; represents a list of values, only a single value can be &amp;lt;code&amp;gt;current&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;body&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
==== Body ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;body&amp;lt;/code&amp;gt; represents a slot that fills the entirety of the component. Some components, like &amp;lt;code&amp;gt;Button&amp;lt;/code&amp;gt;, are generic enough that they can be used to display anything, and &amp;lt;code&amp;gt;body&amp;lt;/code&amp;gt; is the name these components are assigned to.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;example-box-1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
===== Example: Box =====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Data:&lt;br /&gt;
  body: The component displayed in the box.&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;span id=&amp;quot;example-button-1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
===== Example: Button =====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Data:&lt;br /&gt;
  body: The component to display inside of the button.&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;span id=&amp;quot;items&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
==== Items ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;items&amp;lt;/code&amp;gt; represents a generic list of values that are managed by a single component.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;example-listview-1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
===== Example: ListView =====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Data:&lt;br /&gt;
  current: The view's current value, can be null.&lt;br /&gt;
  selected: The value of the selected list item.&lt;br /&gt;
  items: A list of items used to populate the list.&lt;br /&gt;
    component: The component to display in the list.&lt;br /&gt;
    value: A text value associated with an item, used to select an item by&lt;br /&gt;
           keyboard.&amp;lt;/pre&amp;gt;&lt;br /&gt;
Note that, strictly following the &amp;lt;code&amp;gt;body&amp;lt;/code&amp;gt; naming convention, &amp;lt;code&amp;gt;items.component&amp;lt;/code&amp;gt; should be named &amp;lt;code&amp;gt;items.body&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;state&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== State ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;State&amp;lt;/code&amp;gt; is for declaring properties that are internal to the component. These are properties that are useful to have because they simplify descriptions of the component’s behavior and map to the user’s mental model of the component. A common use-case for &amp;lt;code&amp;gt;State&amp;lt;/code&amp;gt; is for declaring properties that can be used for styling the component.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;example-component-1&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== Example: Component ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;State:&lt;br /&gt;
  active: Whether the component belongs to the currently active window.&lt;br /&gt;
  enabled: The negation of disabled, enabled = !disabled.&lt;br /&gt;
  hover: Whether the mouse is located on top of the component.&lt;br /&gt;
  focus: Whether the component receives keyboard input.&lt;br /&gt;
  focus_in: Whether the component or any of its descendants has focus.&lt;br /&gt;
  focus_visible: Whether the box has focus and it is determined that focus&lt;br /&gt;
                 should be indicated on the box to assist the user:&lt;br /&gt;
                   - the user focused the box via non-pointing device&lt;br /&gt;
                   - the box received programmatic focus from a component that &lt;br /&gt;
                     had focus_visible&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;code&amp;gt;component&amp;lt;/code&amp;gt; declares a number of &amp;lt;code&amp;gt;State&amp;lt;/code&amp;gt; properties that are used for styling purposes by many components. It is common for a component to have a certain appearance when it is &amp;lt;code&amp;gt;hover&amp;lt;/code&amp;gt;. Because &amp;lt;code&amp;gt;hover&amp;lt;/code&amp;gt; is defined in &amp;lt;code&amp;gt;component&amp;lt;/code&amp;gt;, it is trivial to style a component like a button based on its hover state. Each component doesn’t need to reinvent or redeclare the logic for what &amp;lt;code&amp;gt;hover&amp;lt;/code&amp;gt; means.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;example-securitybox&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== Example: SecurityBox ===&lt;br /&gt;
&lt;br /&gt;
A common use-case for &amp;lt;code&amp;gt;State&amp;lt;/code&amp;gt; is for storing data that is intrinsic to the component that the user cannot manipulate.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;State:&lt;br /&gt;
  security_list: A list of all tradeable securities.&lt;br /&gt;
    symbol: The symbol of the security.&lt;br /&gt;
    name: The full name of the security.&lt;br /&gt;
    country: The ISO country code for the country in which the security's&lt;br /&gt;
             exchange is located in.&amp;lt;/pre&amp;gt;&lt;br /&gt;
In &amp;lt;code&amp;gt;SecurityBox&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;security_list&amp;lt;/code&amp;gt; is all tradeable securities. This list is dynamic, since securities are delisted and new securities listed all the time. It could be obtained from a remote resource that is periodically updated. Unlike with &amp;lt;code&amp;gt;Data&amp;lt;/code&amp;gt;, it is not automatically assumed that this data is continuously flowing as a stream. Because the &amp;lt;code&amp;gt;security_list&amp;lt;/code&amp;gt; is neither a real-time feed or modifiable by the user, &amp;lt;code&amp;gt;State&amp;lt;/code&amp;gt; is an appropriate location for it. This also ensures that &amp;lt;code&amp;gt;security_list&amp;lt;/code&amp;gt; cannot be tampered with by external components and makes using &amp;lt;code&amp;gt;SecurityBox&amp;lt;/code&amp;gt; more ergonomic: &amp;lt;code&amp;gt;SecurityBox&amp;lt;/code&amp;gt; always contains the list of all tradeable securities.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;signals&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== Signals ==&lt;br /&gt;
&lt;br /&gt;
Signals are how components notify other components about changes to their internal state. Any external component can listen for a signal from a specific component and respond accordingly. Use signals whenever there is a change in a component that it would be useful for external components to know about based on real use cases.&lt;br /&gt;
&lt;br /&gt;
Signals are not necessary for notifying external components about simple changes in &amp;lt;code&amp;gt;Data&amp;lt;/code&amp;gt;: the properties in &amp;lt;code&amp;gt;Data&amp;lt;/code&amp;gt; are already externally accessible: an external component can see if &amp;lt;code&amp;gt;DecimalBox.current&amp;lt;/code&amp;gt; changed without needing a signal. However, sometimes a component will need to perform some operations on the data when it changes, and it should send a signal when these operations are completed.&lt;br /&gt;
&lt;br /&gt;
Signals should reflect the behavior of the component they belong to. Components should not pass along signals from their children if it does not make sense to their function.&lt;br /&gt;
&lt;br /&gt;
Components can define signals with the same name as their children. For a component with a child &amp;lt;code&amp;gt;DecimalBox&amp;lt;/code&amp;gt;, it can define its own &amp;lt;code&amp;gt;Submit&amp;lt;/code&amp;gt; signal which is what is referenced by &amp;lt;code&amp;gt;A.Submit&amp;lt;/code&amp;gt;. The &amp;lt;code&amp;gt;DecimalBox&amp;lt;/code&amp;gt; is specified with dot notation as &amp;lt;code&amp;gt;A.DecimalBox.Submit&amp;lt;/code&amp;gt;. Ideally, only &amp;lt;code&amp;gt;A&amp;lt;/code&amp;gt; should be interested in &amp;lt;code&amp;gt;DecimalBox.Submit&amp;lt;/code&amp;gt;, while other components should subscribe to &amp;lt;code&amp;gt;A.Submit&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;standard-signal-names&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== Standard Signal Names ===&lt;br /&gt;
&lt;br /&gt;
As with properties, there are a few standard signals.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;change&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
==== Change ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;Change&amp;lt;/code&amp;gt; signal may be fired by a component that needs to notify other components of a change to the &amp;lt;code&amp;gt;current&amp;lt;/code&amp;gt; of its children. This may be useful when some logic should be performed such as validation before sending out the signal so that components listening for changes do not concern themselves with handling an invalid change. It is similar to the [https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event Input Event] event in HTML&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;submit&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
==== Submit ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Submit&amp;lt;/code&amp;gt; indicates that the user has submitted the value. A &amp;lt;code&amp;gt;Submit&amp;lt;/code&amp;gt; signal should only be generated in response to an intentional user action, such as a key press. &amp;lt;code&amp;gt;Submit&amp;lt;/code&amp;gt; is conventionally signaled on a &amp;lt;code&amp;gt;FocusOut&amp;lt;/code&amp;gt; event when &amp;lt;code&amp;gt;current&amp;lt;/code&amp;gt; has changed from its previous value: the user’s change in focus is interpreted as an implicit submission. &amp;lt;code&amp;gt;Submit&amp;lt;/code&amp;gt; typically follows an Enter key press. It is similar to the [https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event Change Event] in HTML.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;reject&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
==== Reject ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Reject&amp;lt;/code&amp;gt; is fired to indicate that a submitted value was rejected.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;payload&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== Payload ===&lt;br /&gt;
&lt;br /&gt;
When a signal is fired, it carries with it a payload that components can read. For the &amp;lt;code&amp;gt;Submit&amp;lt;/code&amp;gt; signal, its payload consists of &amp;lt;code&amp;gt;submission&amp;lt;/code&amp;gt; by default. The payload of any signal can be customized to better suit the use-cases.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;example-timefilterpanel&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
==== Example: TimeFilterPanel ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;Signals:&lt;br /&gt;
  Submit: The user has submitted their time range.&lt;br /&gt;
    start: The submitted start time of the range or NULL if offset is set.&lt;br /&gt;
    end: The submitted end time of the range or NULL if offset is set.&lt;br /&gt;
    offset: The submitted offset to filter by or NULL if start and end are set.&amp;lt;/pre&amp;gt;&lt;br /&gt;
The &amp;lt;code&amp;gt;Submit&amp;lt;/code&amp;gt; payload carries three values: &amp;lt;code&amp;gt;start&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;end&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;offset&amp;lt;/code&amp;gt;. This reflects &amp;lt;code&amp;gt;TimeFilterPanel&amp;lt;/code&amp;gt; which lacks a &amp;lt;code&amp;gt;current&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;submission&amp;lt;/code&amp;gt; but has &amp;lt;code&amp;gt;start&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;end&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;offset&amp;lt;/code&amp;gt; values. Within &amp;lt;code&amp;gt;user_flow.drawio&amp;lt;/code&amp;gt;, the values used for each payload slot are clarified.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;ordering&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== Ordering ==&lt;br /&gt;
&lt;br /&gt;
Keep the sections ordered as they appear in this overview and repeated below: &lt;br /&gt;
* Definitions &lt;br /&gt;
* Styles &lt;br /&gt;
* Data &lt;br /&gt;
* State &lt;br /&gt;
* Signals&lt;br /&gt;
&lt;br /&gt;
Omit any section that is unused.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;usage&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
When placing data into &amp;lt;code&amp;gt;components.xd&amp;lt;/code&amp;gt;, use the property names exactly as they appear in &amp;lt;code&amp;gt;model.txt&amp;lt;/code&amp;gt;. States used by selectors in &amp;lt;code&amp;gt;components.xd&amp;lt;/code&amp;gt; should also appear exactly as they appear in &amp;lt;code&amp;gt;model.txt&amp;lt;/code&amp;gt;. The property and signal names should also carry over to &amp;lt;code&amp;gt;layout.xd&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;use_cases.drawio&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;user_flow.drawio&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;model.txt&amp;lt;/code&amp;gt; is the most powerful tool in the designer’s toolkit; taking time upfront to provide good descriptions in the model can save a lot of designer and developer headaches later on.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;references&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
# [https://web.dev/learn/css/pseudo-elements/ Web.dev: Pseudo-Elements]&lt;br /&gt;
# [https://developer.mozilla.org/en-US/docs/Learn/CSS/Building_blocks/Selectors/Pseudo-classes_and_pseudo-elements#what_is_a_pseudo-element MDN: Pseudo-Elements]&lt;br /&gt;
# [https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/input_event MDN: The Input Event]&lt;br /&gt;
# [https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/change_event MDN: The Change Event]&lt;/div&gt;</summary>
		<author><name>Jon</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=Animations&amp;diff=173</id>
		<title>Animations</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=Animations&amp;diff=173"/>
		<updated>2026-07-07T18:13:32Z</updated>

		<summary type="html">&lt;p&gt;Jon: Created page with &amp;quot;Animations in Spire follow a philosophy of enhancing clarity and communication without embellishment or impedance to the user.  In CSS there are transitions, in Spire an anima...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Animations in Spire follow a philosophy of enhancing clarity and communication without embellishment or impedance to the user.&lt;br /&gt;
&lt;br /&gt;
In CSS there are transitions, in Spire an animation is just a value. This means that a property value such as &amp;lt;code&amp;gt;background_color&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;border_color&amp;lt;/code&amp;gt; can be directly set to an animation value to achieve a property value that changes over time.&lt;br /&gt;
&lt;br /&gt;
== Example: Rejected Style for InputBox ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:TextBox_Rejected.gif|640px|center|Animation of a text input field flashing red to indicate a rejection]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When the InputBox is in the &amp;lt;code&amp;gt;rejected&amp;lt;/code&amp;gt; state, an animation plays. The animation can be defined as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot;&amp;gt;background_color: chain(timeout(#FFF1F1, 250ms), linear(#FFF1F1, revert, 300ms))&lt;br /&gt;
border_color: chain(timeout(#B71C1C, 550ms), revert)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
In this case the value says:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;Chain together two styles, the first style is a value of &amp;lt;code&amp;gt;#FFF1F1&amp;lt;/code&amp;gt; that times out after 250ms, the second value is a linear interpolation from &amp;lt;code&amp;gt;#FFF1F1&amp;lt;/code&amp;gt; to whatever the style was before (that’s what &amp;lt;code&amp;gt;revert&amp;lt;/code&amp;gt; does), over 300ms.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
Border color is styled as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;Chain two styles, the first is the color &amp;lt;code&amp;gt;#B71C1C&amp;lt;/code&amp;gt; that expires after 550ms and then reverts to whatever it was previously.&lt;br /&gt;
&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
This is reflected in &amp;lt;code&amp;gt;components.xd&amp;lt;/code&amp;gt; for InputBox.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:InputBox_components.png|640px|center|Definition card for Input Box component]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
When the InputBox is &amp;lt;code&amp;gt;rejected&amp;lt;/code&amp;gt;, property declarations are made for the &amp;lt;code&amp;gt;background_color&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;color&amp;lt;/code&amp;gt; that are animation values. Whenever the InputBox is put into the &amp;lt;code&amp;gt;rejected&amp;lt;/code&amp;gt; state, the animations will play.&lt;br /&gt;
&lt;br /&gt;
Each property value is independent, and there is no necessary connection between the timing used for the animation values for each property.&lt;br /&gt;
&lt;br /&gt;
== Example: Uptick/Downtick Style for DecimalBox ==&lt;br /&gt;
&lt;br /&gt;
[[File:DecimalBox_Uptick_Downtick.gif|640px|center|Animation of a numeric input field flashing red and green alternately to indicate the direction change as its value changes]]&lt;br /&gt;
&lt;br /&gt;
When the DecimalBox uses the uptick/downtick styling, its background color flashes when its value changes, reflecting whether the value increased or decreased.&lt;br /&gt;
&lt;br /&gt;
When the value increases, it is uptick:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot;&amp;gt;background_color: linear(#EBFFF0, revert, 550ms)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
When the value decreases, it is downtick:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;css&amp;quot;&amp;gt;background_color: linear(#FFF1F1, revert, 550ms)&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Functions ==&lt;br /&gt;
&lt;br /&gt;
Unlike static values, animation values use functions that allow them to change over time. The list of functions that have been used are as follows:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Function !! Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;chain(X, Y, *ARGS)&amp;lt;/code&amp;gt; || An animation that applies &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt; until &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt; ends, then applies &amp;lt;code&amp;gt;Y&amp;lt;/code&amp;gt; until &amp;lt;code&amp;gt;Y&amp;lt;/code&amp;gt; ends, and so on for any additional arguments.&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;timeout(X, Y)&amp;lt;/code&amp;gt; || Applies &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt; for a period of &amp;lt;code&amp;gt;Y&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;linear(X, Y, Z)&amp;lt;/code&amp;gt; || Linearly interpolates from &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;Y&amp;lt;/code&amp;gt; over a period &amp;lt;code&amp;gt;Z&amp;lt;/code&amp;gt;. &amp;lt;code&amp;gt;linear = cubic_bezier(0.0, 0.0, 1.0, 1.0)&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;ease(X, Y, Z)&amp;lt;/code&amp;gt; || Interpolates from &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt; to &amp;lt;code&amp;gt;Y&amp;lt;/code&amp;gt; over a period &amp;lt;code&amp;gt;Z&amp;lt;/code&amp;gt; using the &amp;lt;code&amp;gt;ease&amp;lt;/code&amp;gt; timing function. &amp;lt;code&amp;gt;ease = cubic_bezier(0.25, 0.1, 0.25, 1.0)&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Additional functions may be added provided they have a clear use case and are documented.&lt;br /&gt;
&lt;br /&gt;
== Keywords ==&lt;br /&gt;
&lt;br /&gt;
Values within functions may be literal values (e.g. a color value or a time in milliseconds), or they may be a keyword with a defined meaning. &lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Keyword !! Description&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;code&amp;gt;revert&amp;lt;/code&amp;gt; || Applies whatever style would have otherwise been applied.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
# [https://developer.mozilla.org/en-US/docs/Web/CSS/easing-function Easing Functions] &lt;br /&gt;
# [https://easings.net/ Easing Functions Cheat Sheet]&lt;/div&gt;</summary>
		<author><name>Jon</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=File:TextBox_Rejected.gif&amp;diff=172</id>
		<title>File:TextBox Rejected.gif</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=File:TextBox_Rejected.gif&amp;diff=172"/>
		<updated>2026-07-07T18:12:20Z</updated>

		<summary type="html">&lt;p&gt;Jon: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jon</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=File:DecimalBox_Uptick_Downtick.gif&amp;diff=171</id>
		<title>File:DecimalBox Uptick Downtick.gif</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=File:DecimalBox_Uptick_Downtick.gif&amp;diff=171"/>
		<updated>2026-07-07T18:12:03Z</updated>

		<summary type="html">&lt;p&gt;Jon: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Jon</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=File:DecimalBox_Uptick_Downtick.webp&amp;diff=170</id>
		<title>File:DecimalBox Uptick Downtick.webp</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=File:DecimalBox_Uptick_Downtick.webp&amp;diff=170"/>
		<updated>2026-07-07T18:02:24Z</updated>

		<summary type="html">&lt;p&gt;Jon: Uptick and downtick animation for Decimal Box component&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Uptick and downtick animation for Decimal Box component&lt;/div&gt;</summary>
		<author><name>Jon</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=File:InputBox_components.png&amp;diff=169</id>
		<title>File:InputBox components.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=File:InputBox_components.png&amp;diff=169"/>
		<updated>2026-07-07T18:01:48Z</updated>

		<summary type="html">&lt;p&gt;Jon: Components breakdown for Input Box component&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Components breakdown for Input Box component&lt;/div&gt;</summary>
		<author><name>Jon</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=File:TextBox_Rejected.webp&amp;diff=168</id>
		<title>File:TextBox Rejected.webp</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=File:TextBox_Rejected.webp&amp;diff=168"/>
		<updated>2026-07-07T18:00:59Z</updated>

		<summary type="html">&lt;p&gt;Jon: Rejection animation for Text Box component&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Rejection animation for Text Box component&lt;/div&gt;</summary>
		<author><name>Jon</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=Preview&amp;diff=167</id>
		<title>Preview</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=Preview&amp;diff=167"/>
		<updated>2026-07-07T17:59:25Z</updated>

		<summary type="html">&lt;p&gt;Jon: Created page with &amp;quot;&amp;lt;code&amp;gt;preview.xd&amp;lt;/code&amp;gt; covers the visual overview of the component and its essential use cases. It provides the developer with a basic first impression of the component and h...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;code&amp;gt;preview.xd&amp;lt;/code&amp;gt; covers the visual overview of the component and its essential use cases. It provides the developer with a basic first impression of the component and helps them grasp the design intent. Any component with a visual representation requires &amp;lt;code&amp;gt;preview.xd&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
A good preview will: &lt;br /&gt;
* Document the component’s appearance and highlight its states &lt;br /&gt;
* Illustrate use cases visually that would be difficult to understand fully from other documentation &lt;br /&gt;
* Provide context, by showing places where the component is used by other components&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;preview.xd&amp;lt;/code&amp;gt; is non-normative. If there is a conflict between the appearance in &amp;lt;code&amp;gt;preview.xd&amp;lt;/code&amp;gt; and subsequent specifications (e.g. &amp;lt;code&amp;gt;components.xd&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;layout.xd&amp;lt;/code&amp;gt;) due to designer error, the other specifications take precedence. It is the designer’s responsibility to ensure that specifications are consistent and accurate.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;getting-started&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== Getting Started ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;preview.xd&amp;lt;/code&amp;gt; comes first in the specifications, at the end of all exploratory work and user research necessary to define the component. The preview informs the developer up front of ''what'' is being built. At a minimum the preview consists of a high-fidelity mock-up of the component that is a visual representation of the designer’s intent.&lt;br /&gt;
&lt;br /&gt;
Use an existing file as a baseline. Start with an initial, default visualization of the component. Use cases may be shown as static visualizations. Keep each use case to its own row and show the next step in a use case in the adjacent column.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;example-hexcolorbox&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
=== Example: HexColorBox ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:HexColorBox_preview.png|640px|center|Preview of a hexadecimal color value input field component]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;HexColorBox&amp;lt;/code&amp;gt; is a specialized input based on &amp;lt;code&amp;gt;TextBox&amp;lt;/code&amp;gt;. Because &amp;lt;code&amp;gt;TextBox&amp;lt;/code&amp;gt; functionality is documented in its respective preview, &amp;lt;code&amp;gt;HexColorBox&amp;lt;/code&amp;gt; is primarily concerned with showcasing its unique features.&lt;br /&gt;
&lt;br /&gt;
The preview communicates the following: &lt;br /&gt;
* &amp;lt;code&amp;gt;HexColorBox&amp;lt;/code&amp;gt; is essentially a &amp;lt;code&amp;gt;TextBox&amp;lt;/code&amp;gt;. &lt;br /&gt;
* Hex values can be entered with our without a &amp;lt;code&amp;gt;#&amp;lt;/code&amp;gt; mark in front. &lt;br /&gt;
* The submitted value always contains the &amp;lt;code&amp;gt;#&amp;lt;/code&amp;gt; mark in front. &lt;br /&gt;
* It is used within &amp;lt;code&amp;gt;ColorPicker&amp;lt;/code&amp;gt; as an alternative input for color selection.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;anatomy&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== Anatomy ==&lt;br /&gt;
&lt;br /&gt;
All &amp;lt;code&amp;gt;preview.xd&amp;lt;/code&amp;gt; files contain a title block with the name of the component. Beneath it is the visual representation of the component in a default state. Other notable states are expected to be shown here as well, and may include: &lt;br /&gt;
* &amp;lt;code&amp;gt;open&amp;lt;/code&amp;gt; &lt;br /&gt;
* &amp;lt;code&amp;gt;closed&amp;lt;/code&amp;gt; &lt;br /&gt;
* &amp;lt;code&amp;gt;highlighted&amp;lt;/code&amp;gt; &lt;br /&gt;
* &amp;lt;code&amp;gt;focus&amp;lt;/code&amp;gt; &lt;br /&gt;
* &amp;lt;code&amp;gt;hover&amp;lt;/code&amp;gt; &lt;br /&gt;
* &amp;lt;code&amp;gt;active&amp;lt;/code&amp;gt; &lt;br /&gt;
* &amp;lt;code&amp;gt;read_only&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Provide text labels as identifiers for non-default states.&lt;br /&gt;
&lt;br /&gt;
It is important to document the states that are specific to the component to serve as a reference not only for the developer building the component but also for the designer when assessing a completed component demo.&lt;br /&gt;
&lt;br /&gt;
If the preview is including many states of its children, that is a clue that those children should probably be separate components with their own preview to cover these details.&lt;br /&gt;
&lt;br /&gt;
Provide text labels as identifiers for use cases. Separate use cases into rows, providing a visual journey from left to right.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;example-tableview&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
==== Example: TableView ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:TableView_preview_1x.png|640px|center|Preview of a table component]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The preview showcases two places where &amp;lt;code&amp;gt;TableView&amp;lt;/code&amp;gt; is used. There are some styling differences between the two, indicating that some customization is available. A variety of components are shown as table cells, with different styling, indicating that table cells are customizable without being an exhaustive enumeration.&lt;br /&gt;
&lt;br /&gt;
Beneath the usages are rows for a few use cases and scenarios: &lt;br /&gt;
* Reordering a column &lt;br /&gt;
* Resizing a column &lt;br /&gt;
* Column overflow/underflow &lt;br /&gt;
* First row current&lt;br /&gt;
&lt;br /&gt;
The use cases are divided into a few simple steps that are read left to right.&lt;br /&gt;
&lt;br /&gt;
'''Note:''' Detailed state variations for the column headers and detailed state variations for cells are excluded - these are handled by the child components.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;example-time-and-sales-window&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
==== Example: Time and Sales Window ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:TimeAndSalesWindow_preview_1x.png|640px|center|Preview of the Time and Sales Window component]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;TimeAndSalesWindow&amp;lt;/code&amp;gt; showcases the possible variations for the window: &lt;br /&gt;
* New window &lt;br /&gt;
* Searching a security &lt;br /&gt;
* Loading a security &lt;br /&gt;
* Displaying an inactive security &lt;br /&gt;
* Displaying an active security &lt;br /&gt;
As well it shows customizations that can be made by the user for displaying columns.&lt;br /&gt;
&lt;br /&gt;
Beneath the variations are rows for use cases and scenarios: pull delayed, no more entries, linking a window, displaying the full titlebar label, and displaying with a larger font. For pull delayed and link window, the steps are shown left to right.&lt;br /&gt;
&lt;br /&gt;
The preview provides an overview of components acting together in sequence which is not shown in the isolated breakdowns in &amp;lt;code&amp;gt;components.xd&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;layout.xd&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;example-fontbox&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
==== Example: FontBox ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:FontBox_preview.png|640px|center|Preview for a font selector input field component]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;FontBox&amp;lt;/code&amp;gt; uses an adaptive layout that changes based on the available space. This is made apparent in the preview by showing the two different layouts while the particulars are delegated to &amp;lt;code&amp;gt;components.xd&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;layout.xd&amp;lt;/code&amp;gt;. As a composite component, &amp;lt;code&amp;gt;FontBox&amp;lt;/code&amp;gt; does not include all of the various states for its children.&lt;br /&gt;
&lt;br /&gt;
Basic selecting and submitted states are shown to clarify its usage without specifying any novel behavior not covered by its children.&lt;br /&gt;
&lt;br /&gt;
For context, &amp;lt;code&amp;gt;FontBox&amp;lt;/code&amp;gt; is shown being used in &amp;lt;code&amp;gt;TimeAndSalesPropertiesWindow&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;what-to-leave-out&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== What to Leave Out ==&lt;br /&gt;
&lt;br /&gt;
Don’t include any text specifications in &amp;lt;code&amp;gt;preview.xd&amp;lt;/code&amp;gt; (e.g. &amp;lt;code&amp;gt;padding_left: 15px&amp;lt;/code&amp;gt;); these belong in &amp;lt;code&amp;gt;components.xd&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For components that have adaptive layouts, do not include pixel breakpoints for different layouts. Layouts are specified in &amp;lt;code&amp;gt;layouts.xd&amp;lt;/code&amp;gt; and the preview should be solely a visual reference in this regard.&lt;br /&gt;
&lt;br /&gt;
Do not list children, these are enumerated in &amp;lt;code&amp;gt;components.xd&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span id=&amp;quot;usage&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&lt;br /&gt;
== Usage ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;preview.xd&amp;lt;/code&amp;gt; is an important first step in specifying a component. A good preview synchronizes communication and understanding between designers and developers and provides a reference against which to compare the functioning final component.&lt;/div&gt;</summary>
		<author><name>Jon</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=File:FontBox_preview.png&amp;diff=166</id>
		<title>File:FontBox preview.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=File:FontBox_preview.png&amp;diff=166"/>
		<updated>2026-07-07T17:48:59Z</updated>

		<summary type="html">&lt;p&gt;Jon: Preview of Font Box component&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Preview of Font Box component&lt;/div&gt;</summary>
		<author><name>Jon</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=File:TimeAndSalesWindow_preview_1x.png&amp;diff=165</id>
		<title>File:TimeAndSalesWindow preview 1x.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=File:TimeAndSalesWindow_preview_1x.png&amp;diff=165"/>
		<updated>2026-07-07T17:48:02Z</updated>

		<summary type="html">&lt;p&gt;Jon: Preview of Time and Sales Window component&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Preview of Time and Sales Window component&lt;/div&gt;</summary>
		<author><name>Jon</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=File:TableView_preview_1x.png&amp;diff=164</id>
		<title>File:TableView preview 1x.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=File:TableView_preview_1x.png&amp;diff=164"/>
		<updated>2026-07-07T17:47:27Z</updated>

		<summary type="html">&lt;p&gt;Jon: Preview of TableView component&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Preview of TableView component&lt;/div&gt;</summary>
		<author><name>Jon</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.spiretrading.com/index.php?title=File:HexColorBox_preview.png&amp;diff=163</id>
		<title>File:HexColorBox preview.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.spiretrading.com/index.php?title=File:HexColorBox_preview.png&amp;diff=163"/>
		<updated>2026-07-07T17:42:42Z</updated>

		<summary type="html">&lt;p&gt;Jon: Preview of the Hex Color Box component, an input field for a hexadecimal color value&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
Preview of the Hex Color Box component, an input field for a hexadecimal color value&lt;/div&gt;</summary>
		<author><name>Jon</name></author>
		
	</entry>
</feed>