Line

You are reading docs for v0.8. See latest (v0.9)

ui/client/features/shell/hooks/useNarrowLayout

Cockpit client (features), v0.8. Source: ui/client/features/shell/hooks/useNarrowLayout.tsx.

Functions#

useNarrowLayout()#

useNarrowLayout(pathname): object

Defined in: ui/client/features/shell/hooks/useNarrowLayout.tsx:14

Whether the viewport is narrow (< 900px) and which single pane is showing there. Navigating to another screen returns to the stage, so a link chosen in the Browser pane actually shows its result. Server render and first paint use the wide layout; the media query takes over right after mount.

Parameters#

pathname

string

Returns#

object

narrow

narrow: boolean

pane

pane: NarrowPane

setPane

setPane: (next) => void

Parameters
next

NarrowPane

Returns

void