Usage
Return Value
Returns a boolean value:true if screen rotation is locked, false if unlocked. Returns undefined if not running in Fully Kiosk Browser.Learn more about Mintlify
Enter your email to receive updates about new features and product releases.
Check if screen rotation is locked
import { useScreenRotationLock } from 'node-fullykiosk';
function App() {
const isLocked = useScreenRotationLock();
return (
<div>
<p>Screen rotation is {isLocked ? 'locked' : 'unlocked'}</p>
</div>
);
}
true if screen rotation is locked, false if unlocked. Returns undefined if not running in Fully Kiosk Browser.import { useScreenRotationLock } from 'node-fullykiosk';
function RotationStatus() {
const isLocked = useScreenRotationLock();
if (isLocked === undefined) {
return <p>Not running in Fully Kiosk Browser</p>;
}
return (
<div>
<p>
Screen rotation is currently {isLocked ? 'locked' : 'unlocked'}
</p>
{isLocked && (
<div className="alert">
⚠️ Screen rotation is locked. The display will not auto-rotate.
</div>
)}
</div>
);
}
import { useScreenRotationLock } from 'node-fullykiosk';
function OrientationWarning() {
const isLocked = useScreenRotationLock();
return (
<div>
{isLocked ? (
<p>This device is in fixed orientation mode.</p>
) : (
<p>This device supports auto-rotation.</p>
)}
</div>
);
}