Files
2022-07-13 00:17:25 +10:00

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>
  );
}