mirror of
https://github.com/zhigang1992/nativewind.git
synced 2026-06-14 09:49:07 +08:00
586 B
586 B
Units
Viewport Units
NativeWind supports the vw and vh viewport units.
import { Text, View } from 'react-native';
import { styled } from 'nativewind';
const StyledView = styled(View)
const StyledText = styled(Text)
const App = () => {
return (
<StyledView className={`
items-center
justify-center
bg-slate-300
m-auto
h-[25vh]
w-[50vh]
`}>
<StyledText
selectable={false}
className="text-slate-800"
>
Rotate me! 🎉
</StyledText>
</StyledView>
);
}