Overview
Width utilities cover fixed size steps, fractions, and keyword widths in one suffix system.Examples
Using the size scale
Use the t-shirt width scale when you want a predictable fixed content width for cards, panels, and shells.Using a percentage
Use fractional width utilities when the layout itself is column-based and width should be relative to the parent.Filling the available width
Usewidth-full when an element should stretch across the full available width of its parent.
Matching the viewport
Usewidth-screen when an element should span the full viewport width instead of just the width of its parent container.
Resetting the width
Usewidth-auto when an element should size itself to its content or when you need to remove a previously assigned width.
Best Practices
- Use
width-fullfor forms, rows, and blocks that should stretch with their parent. - Use
width-<fraction>when the layout itself is column-based. - Use
width-<size>for fixed shells and readable content rails. - Use
width-screensparingly because it ignores the document container width.
Related Utilities
Max Width
Constrain maximum element width
Height
Control element height

