02 — Visual Doctrine
Density Levels
Three density levels are defined in IDL: compact, default, and comfortable. Density affects spatial multipliers applied to all spatial token resolutions and defines the minimum touch target size for interactive components. Density is a system-level mode, not a per-component option — all components in a given rendering context share the same density level.
Density Multipliers
| Density | Spatial Multiplier | Min Touch Target | Use Case |
|---|---|---|---|
| compact | 0.75× | 36px | Dense information environments — data tables, code editors, admin tools. |
| default | 1.0× | 44px | General-purpose product interfaces. |
| comfortable | 1.25× | 48px | Touch-first interfaces, accessibility-optimised surfaces. |
Declaring Density Support
Components MUST explicitly declare which density levels they support. A component that does not declare support for a density level produces a compiler warning when rendered in an IDL source targeting that density. Components with unsupported density levels are not rejected — the warning alerts the consuming system to review the component's spatial behavior at that density.
Density and Token Resolution
During the Transform phase, the compiler resolves spatial token references in component declarations using the declared density multiplier for the target build. Separate compilation targets may be defined for each density level. This produces density-specific artifact sets that platform implementations switch between at runtime based on user or system preference.