---
name: "useScreenAlwaysOn"
mode: "api"
versionRequirements:
  - { name: "@ray-js/panel-sdk", version: "1.0.0" }
title: "useScreenAlwaysOn"
---

## useScreenAlwaysOn

> [VERSION] @ray-js/panel-sdk >= 1.0.0

> 💡 This Hook enables keep screen on when the component mounts and disables it on unmount.
> Depends on the setKeepScreenOn API from @ray-js/ray; logs a warning if the runtime does not support this API.

### Description

Keep the device screen on while the component is mounted and restore it on unmount

### Parameters

None


### Return Value

None


### Examples

#### Example

```tsx
import { useScreenAlwaysOn } from '@ray-js/panel-sdk';

function VideoPlayer() {
  // Keep the screen awake on the video playback page
  useScreenAlwaysOn();
  return <Video src="..." />;
}
```
