Quick Start
Screen Size Categories
- Small: < 375px (iPhone SE, small Android phones)
- Medium: 375px - 414px (most iPhones, standard Android)
- Large: > 414px (iPhone Pro Max, large Android phones)
Available Hooks
useResponsive()
Main hook that provides all responsive utilities:
Responsive Values
Padding
xs: 8-12px (small-medium-large)sm: 12-16pxmd: 16-24pxlg: 20-28pxxl: 24-32px2xl: 28-40px
Font Sizes
xs: 10-12pxsm: 12-14pxmd: 14-16pxlg: 16-18pxxl: 20-24px2xl: 24-28px3xl: 28-32px4xl: 32-36px
Spacing
xs: 4-6pxsm: 8-10pxmd: 12-16pxlg: 16-20pxxl: 20-24px2xl: 24-32px3xl: 32-40px
Examples
Example 1: Responsive Screen
Example 2: Conditional Rendering
Example 3: Custom Scaling
Migration Guide
Before (Fixed Sizes)
After (Responsive)
Best Practices
- Use responsive values for padding/margins: Always use
padding.md,spacing.lg, etc. instead of fixed values - Use responsive font sizes: Use
fontSize.xlinstead of fixedfontSize: 20 - Test on different screen sizes: Test on small (< 375px), medium (375-414px), and large (> 414px) screens
- Use conditional rendering for complex layouts: Use
isSmall,isMedium,isLargefor layout changes - Scale custom values: Use
scaleFont()andscaleSize()for one-off custom values