Skip to content

Hook useScreenBounds()

useScreenBounds(__namedParameters: { avoidTaskbar: boolean; }): { alignLeft: boolean; alignTop: boolean; initiated: boolean; ref: Ref<HTMLElement>; }

Source: screen.ts

Returns the ideal orientation of an element so that it does not go outside of the screen

Parameters

__namedParameters

avoidTaskbar

boolean = true

Whether to avoid the task bar

Returns

alignLeft

alignLeft: boolean

Whether the element should align to the left (true) or right (false)

alignTop

alignTop: boolean

Whether the element should align to the top (true) or bottom (false)

initiated

initiated: boolean

ref

ref: Ref<HTMLElement>

The React ref of the element

Built by Prozilla