Skip to main content

useDeviceOrientation

Used to retrieve the orientation of the mobile device

Submit feedback
github
import { useDeviceOrientation } from '@uhg-abyss/mobile';

Usage

useDeviceOrientation measures the width and height of the screen and returns 'landscape' or 'portrait'.

const orientation = useDeviceOrientation();
const iconSize = orientation === 'landscape' ? 20 : 24;
return <IconCustom icon="home" variant={'darkactive'} size={iconSize} />;
Table of Contents