Same API surface as scaled with prefixes ftsdp / fthdp / ftwdp / ftssp / … — see COMPOSE-API-CONVENTIONS.md §3.
Fit is the dual of fill: a “contain”-style factor. It uses the minimum of shorter/300 and longer/533, limiting scale by the tighter side of the screen so the layout does not mentally or physically overflow.
rw = shorter / 300,rh = longer / 533out = base × min(rw, rh)- With
a: multiply by the pre-computed aspect-ratio factor (DimenCache.currentAspectRatioMul); custom sensitivity uses1 + k × logNormalizedAr.
Implementation: calculateFitDpCompose in DimenFitDp.kt.
import com.appdimens.dynamic.compose.fit.ftsdp
Modifier.widthIn(max = 400.ftsdp)Prefixes: ftsdp, fthdp, ftwdp (+ Sp, px, variants).
Code: com.appdimens.dynamic.code.fit.
Enforces a conservative design box: forms, long reading, modals, and content that should not hug edges on wide landscape.
- Very wide aspect ratios when fill or wdp make elements too large.
- When the priority is no clipping and comfortable viewing.
- Pros: safe on ultrawide; stable hierarchy.
- Cons: can leave a lot of empty space on sides or top/bottom — acceptable if the design plans for it.
Use fit for readable body content and fill for hero or backgrounds in the same project, and document that split in your design system.