Layout, content, and
typography
Build QML layouts that hold at every window size and up to 200 %
font scale, keep text readable, and write clear interface copy.
This page explains how to build QML layouts that adapt to narrow or short windows and 200 % text scaling, how to size and wrap typography without clipping, and how to write clear interface labels and empty states.
A layout works only when it holds at every window size and font scale a user chooses. The runtime audit (
ljos audit) lays out your scene at the default window size, at narrow and short fractions (limits::audit::NARROW_FRACTION and limits::audit::SHORT_FRACTION), and across font scales (limits::audit::FONT_SCALES, up to 200 %), checking whether any control overflows, overlaps, or gets covered.Use
Ljos.Layout (Row, Column, Grid): A box respects each child's implicitWidth, implicitHeight, and minimum sizes as text grows, and gives spare room to a child with Layout.fillWidth or Layout.fillHeight. A file still in Qt's QML uses QtQuick.Layouts (RowLayout, ColumnLayout, GridLayout), which the audit checks the same way. Fixed x/y coordinates and manual anchors break when strings are translated or scaled.Size surfaces from content: Let popups, cards, and dialogs take their size from
implicitWidth and implicitHeight up to a maximum, scrolling when content exceeds the available space.Follow the theme's spacing scale (
layout-spacing-scale): Keep every spacing, margins, and padding value a multiple of the theme's Spacing.unit. The steps follow that unit, which is limits::SPACING_UNIT_PX (4 px) by default (4, 8, 12, 16, 24, 32).Match nested corner radii (
layout-nested-radius): When a Rectangle fills another with a margin (anchors.margins: 2), make the inner radius equal to the outer radius minus the gap, never larger.Use a small number of text sizes and establish hierarchy with font weight and colour before adding more sizes. Material 3's scale is a solid baseline:
Never draw text smaller than
limits::TEXT_MIN_PX (10 px). Keep paragraph line height around 1.5× the font size and line length between 45 and 75 characters (never above limits::LINE_LENGTH_MAX_CHARS, 80 characters).text-clipped (Error, runtime): Text is cut off by its container, a sibling, or the window edge at some window size or font scale up to 200 %. Let containers grow with implicitHeight and set wrapMode: Text.Wrap or elide: Text.ElideRight.text-unbounded-dynamic (Warning, static) and text-elided-hidden (Warning, runtime): Any dynamic binding (text: model.title or t`…`) inside a width-bounded box must set elide or wrapMode. When text elides (elide: Text.ElideRight), expose the full string in a ToolTip while truncated is true.text-raw-markup (Warning, runtime): Plain text showing raw Markdown (**bold**, backticks) or HTML tags (<b>) looks broken. Set textFormat: Text.MarkdownText or strip the markup.text-too-small (Warning, static and runtime): Text below 10 px (limits::TEXT_MIN_PX) is unreadable. To make a caption secondary, keep font.pixelSize: 12 and mute its colour with palette.placeholderText while still passing color-text-contrast.text-font-literal (Hint, static): Leave font.family unset on Label and Text items so they inherit the application and platform font.text-line-length (Hint, runtime): Bound multi-line reading text (limits::LINE_LENGTH_MIN_LINES or more lines) to width: Math.min(parent.width, 36 * font.pixelSize) so lines stay under 80 characters.Words are the first part of an interface a user reads.
content-raw-identifier (Warning, runtime): Never display raw UUIDs, commit hashes (limits::HASH_MIN_CHARS or more hex characters), absolute file paths, URLs with query strings, or QQuickItem(0x…) object dumps as primary label text. Show a human-readable title and put the identifier in a ToolTip if needed.content-empty-state (Warning, runtime): Any ListView or GridView larger than limits::EMPTY_VIEW_MIN_PX with zero rows must show either a running BusyIndicator while loading or a placeholder Label explaining why the view is empty and what to do next.content-duplicate-control (Warning, static): Do not place two interactive controls in the same view that write to the same property.content-inconsistent-words (Hint, runtime): Use one term for an action across the window (Retry everywhere, not Retry in one button and Try again in a menu; checked against ljos_design::words::SYNONYMS).content-repeated-text (Hint, runtime): Do not repeat the heading text in the subtitle right below it (such as Downloads followed by Your downloads); use the second line for counts or status.content-identical-rows (Hint, runtime): Do not give limits::IDENTICAL_ROWS_MIN or more rows in a list the exact same label.content-disabled-no-reason (Hint, runtime): When disabling a control (enabled: form.valid), explain why in a label beside it (Add a title to publish) or in Accessible.description / ToolTip.text.content-vague-action (Hint, static): Label buttons with a verb and object (Save draft, Delete 3 files), never OK, Yes, No, Continue, Submit, Done, Go, Click here, or Proceed.content-menu-ellipsis (Hint, static): End a MenuItem or Action label with … (Rename…) when its handler opens a Dialog, FileDialog, or Popup for further input.Check these five points by hand when reviewing an interface:
1.
Write informative toasts: State what happened, how many items were affected, and provide an
Undo action (Moved 3 conversations to the archive). Keep the toast visible while hovered or focused.2.
Title settings pages consistently: Use either all nouns (
Appearance, Notifications, Accounts) or all verbs across settings pages, matching the navigation item that opened each page.3.
Show row state on the row: Indicate whether an item is pinned, muted, or archived directly on the row rather than hiding its state inside a context menu.
4.
Describe only what the build includes: Never mention browser sync or online accounts in an offline or desktop-only build.
5.
Avoid ambiguous one-word statuses: Write
Sync paused by you or No backup yet rather than Sync — Paused or Backups — None.




