Overview
Uniwind supports Tailwind’s responsive breakpoint system out of the box, allowing you to create adaptive layouts that respond to different screen sizes. Use breakpoint prefixes likesm:, md:, lg:, and xl: to apply styles conditionally based on screen width.
Uniwind uses the same breakpoint syntax as Tailwind CSS. If you’re familiar with Tailwind on the web, you already know how to use breakpoints in React Native!
Default Breakpoints
Uniwind includes five default breakpoints based on common device sizes:Basic Usage
Apply different styles at different breakpoints using the breakpoint prefix:- On screens
< 640px: Usesp-4andtext-base - On screens
≥ 640px: Usesp-6andtext-lg - On screens
≥ 1024px: Usesp-8andtext-xl
Mobile-First Design
Uniwind uses a mobile-first breakpoint system, meaning you style for mobile first, then add styles for larger screens:❌ Don’t style desktop-first
✅ Do style mobile-first
Common Patterns
Responsive Layouts
Create layouts that adapt to screen size:Responsive Spacing
Adjust padding and margins based on screen size:Responsive Visibility
Show or hide elements at different breakpoints:Custom Breakpoints
You can customize breakpoints to match your specific design needs using the@theme directive in your global.css:
global.css
Adding Custom Breakpoints
You can also add entirely new breakpoints:global.css
Best Practices
Related
Tailwind Basics
Learn the fundamentals of using Tailwind with Uniwind
Platform Selectors
Combine breakpoints with platform-specific styles
Global CSS
Customize breakpoints in your global.css file
Supported Class Names
See all supported Tailwind utilities
For more details on Tailwind’s responsive design system, check the official Tailwind documentation.