Line

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

ui/client/features/shell/hooks/useShellFocus

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

Type Aliases#

ShellFocusApi#

ShellFocusApi = object

Defined in: ui/client/features/shell/hooks/useShellFocus.tsx:8

What a screen may ask of the shell about focus mode: is the Cockpit chrome hidden, and the two actions that hide and restore it. Provided by the shell around every screen.

Properties#

enter

enter: (label?) => void

Defined in: ui/client/features/shell/hooks/useShellFocus.tsx:12

Hides the Cockpit chrome. label names what is being shown, for the shell's own status/records.

Parameters
label?

string

Returns

void

exit

exit: () => void

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

Restores the previous layout. Safe to call when not focused.

Returns

void

focused

focused: boolean

Defined in: ui/client/features/shell/hooks/useShellFocus.tsx:10

True while the rail, panes, top bar and drawer are hidden and the stage owns the viewport.

Variables#

ShellFocusContext#

const ShellFocusContext: Context<ShellFocusApi>

Defined in: ui/client/features/shell/hooks/useShellFocus.tsx:19

Functions#

useShellFocus()#

useShellFocus(): ShellFocusApi

Defined in: ui/client/features/shell/hooks/useShellFocus.tsx:25

Focus mode: a screen (today the Pages Editor's live preview) asks the shell to stand down — rail, Browser/Tools panes, top bar, drawer and status bar go away so the thing under development fills the viewport, and Esc brings the Cockpit back. The shell keeps owning the layout; the screen never forks it. A no-op outside the shell.

Returns#

ShellFocusApi