Dimension
This page groups the main patch size families.
It is a working guide for the UI layer, separate from the deeper theory in @domphy/theme. The goal here is practical classification: which patches share the same visual height model, and where the boundaries stop being obvious.
All dimension values are spacing units (U).
- base unit:
U = fontSize / 4 - text lines:
n = number of intrinsic text linesinside the element - wrapping level:
w = structural wrapping levelof the element boundary - density factor:
d = themeDensity(listener) - theme base density:
d = 1.5 paddingBlock = d * w * UpaddingInline = ceil(3 / w) * d * w * Uforw >= 1paddingInline = 2dUfor bounded inlinew = 0; otherwise0radius = paddingBlock = d * w * Uheight = (n * 6 + 2 * d * w) * U
The table below shows the resulting height for each patch family at the default density factor d = 1.5. Every numeric cell is a final height in U or px. Rows with n/a are not height-defined by this formula. Multi-part or behavior-first patches such as Card, Command, Input OTP, Splitter, Toggle, and toggleGroup() are documented on their own pages.
Density levels: [0.75, 1, 1.5, 2, 2.5]
| Patch family | Height |
|---|---|
| (Separators) Horizontal Rule | 1px |
| Progress, Popover Arrow | 2U |
| Input Checkbox, Input Radio, Input Range, Input Switch | 4U |
| Code, Keyboard, Mark, Abbreviation, Badge, Breadcrumb Ellipsis, Button Switch, Divider, Emphasis, Heading, Icon, Label, Link, Small, Spinner, Strong, Subscript, Superscript, Tag, Skeleton, Toggle | 6U |
| Breadcrumb, Ordered List, Paragraph, Unordered List, Description List | 6nU |
| Avatar, Button, Combobox, Input Color, Input Date Time, Input File, Input Number, Input Search, Input Text, Menu Item, Pagination, Select, Select Box, Select Item, Select List, Tab, Tooltip | 9U |
| Table | 9nU |
| Alert, Blockquote, Details, Figure, Image, Popover, Preformated, Tabs, Textarea, Toast | (6n + 6)U |
| (Layout Regions) Dialog, Drawer, Form Group, Menu, Tab Panel | n/a |
(Behavior) field(), Form, TransitionGroup | n/a |
The formula applies to elements at or above the 6U baseline, the height of one body text line. The table uses the current theme base density at d = 1.5. Elements intentionally sized below this baseline follow a proportional sub-scale of 2U / 4U / 6U, so they stay fixed across density levels unless their own patch defines another rule.
This page can evolve as the UI principles get refined. For the underlying tone and size theory, see Theme Theory and Theme Tone.