Sizing
Utilities for controlling element dimensions.Import
API
Fromsizing/sizing.js:78-80:
Transform Function
Fromsizing.js:5-7:
Width
Set element width:sizing.js:9-12:
Max Width
Set maximum width with breakpoint support:sizing.js:14-39:
Min Width
Set minimum width:sizing.js:42-45:
Height
Set element height:sizing.js:47-50:
Max Height
Set maximum height:sizing.js:52-55:
Min Height
Set minimum height:sizing.js:57-60:
Box Sizing
Control the box model:sizing.js:74-76:
Common Patterns
Full Width Container
Responsive Width
Square Box
Full Height Page
Scrollable Container
Aspect Ratio Box (16:9)
Card with Fixed Dimensions
Sidebar Layout
Centered Modal
Grid Item Sizing
Fractional Widths
Viewport Units
Constrained Content
Responsive Sizing
TypeScript
Available Properties
| Prop | CSS Property | Transform | Example Values |
|---|---|---|---|
width | width | sizingTransform | 100, '50%', 0.5, 1/2, 'auto' |
maxWidth | max-width | Breakpoint aware | 500, 'sm', 'md', 1, '100%' |
minWidth | min-width | sizingTransform | 300, 0.5, '50%' |
height | height | sizingTransform | 200, '100vh', 0.5, 'auto' |
maxHeight | max-height | sizingTransform | 400, '80vh', 0.8 |
minHeight | min-height | sizingTransform | 200, '100vh', 0.5 |
boxSizing | box-sizing | - | 'border-box', 'content-box' |
Sizing Transform Examples
Related
- Display - Display utilities
- Spacing - Margin and padding
- Box Component - Using sizing with Box