Intrinsic Sizing Behavior in UI
Learn how intrinsic sizing works in digital interface design to create components that intelligently adapt to their real content.
What is Intrinsic Sizing?
Imagine you want to put shirts in a suitcase.
- Extrinsic Sizing: The suitcase has a fixed size of 50x40 cm. No matter if you put in 1 shirt or 20, the suitcase measures the same.
- Intrinsic Sizing: The suitcase is made of elastic fabric and adjusts exactly to the volume of the shirts you put in. If you put in one shirt, it’s small; if you put in 20, it stretches.
In UI, this means a button doesn’t measure “200px,” but rather Text Width + Lateral Paddings. If the text changes from “OK” to “Unsubscribe,” the button widens automatically.
Types of Intrinsic Dimensions (Modern CSS)
To understand how intrinsic design is applied on the real web, there are four key values that designers must understand:
1. min-content
It is the smallest possible dimension an element can have without its content overflowing. For text, it is the width of the longest word.
- Use: Useful for creating table columns that only occupy the absolute minimum necessary.
2. max-content
It is the ideal width the content would occupy if it had all the space in the world so it wouldn’t have to wrap line.
- Use: Perfect for buttons, labels (tags), and navigation menus that we don’t want to “stack” vertically unless strictly necessary.
3. fit-content
It is a smart approach: it uses available space up to max-content, but never exceeds it. If the container narrows, the element shrinks with it, but if the container is huge, the element stops growing when it reaches its ideal width.
- Use: The gold standard for most UI components (cards, banners, inputs).
4. auto
On the web, the default value is usually fill-available, which means the element tries to fill its parent’s entire width. Although not strictly intrinsic, it is the starting point for many layouts.
Why the Designer Should Adopt This Mindset
Historically, designers have “drawn” boxes of fixed sizes in tools like Photoshop or Illustrator. However, modern product design requires a data flow mindset:
- Avoids Fragmentation: If you design components with
Hug Contents(in Figma) instead of specific pixel widths, the design system will be much more resilient to branding changes or translations (localization). - Better Handoff: Developers use Flexbox and CSS Grid, systems that were born for intrinsic design. Speaking their same language reduces frictions and visual inconsistencies.
- True Responsive Design: Intrinsic design adapts fluidly to any screen without the need for dozens of manual breakpoints.
The Impact on Design Systems
A design system based on fixed measurements (Extrinsic) is fragile. In the face of a font or language change (e.g., German vs. English), all layouts break. On the contrary, a system based on Intrinsic Sizing is dynamic: the design “breathers” and automatically adjusts to the reality of the data contained in each component.
Mentor’s Tips
- Stop stretching boxes by hand: Always use
Hug ContentsorFill Containerin Figma (Auto Layout). If you have to enter a measurement in pixels, ask yourself why. - Test with long texts: Use the longest username from your database to see if the header component behaves as you expect.
- Min and Max are your friends: Define maximum widths (
max-width) so your containers don’t become ridiculously wide on 4K screens, always keeping the design within reasonable aesthetic limits.
Useful Resources and Tools
- MDN Web Docs: Intrinsic and Extrinsic Sizing
- CSS Tricks: Fit-content, min-content, and max-content
- Figma Blog: Auto Layout and Resizing logic (Chapter on “Hug” vs. “Fill”).
- Books: Every Layout by Heydon Pickering and Andy Bell.
layout-grid-vs-intrinsic auto-layout-constraints