components/window
Import
Section titled “Import”import * as api from "@fungi.computer/caps/components/window";Exports
Section titled “Exports”| Kind | Export | Description |
|---|---|---|
| type alias | WindowFrameProps | Window presentation only. The host owns geometry, focus order and lifecycle. |
| type alias | WindowBackAction | A host-owned request to go back inside the window’s content. |
| type alias | WindowHeaderProps | Supply handleProps only when the title is an interactive layout handle. |
| type alias | WindowActionsProps | Available callbacks determine available controls; no inert placeholder actions. |
| constant | WindowFrame | A clipped, rounded shell for either a tiled or floating application. |
| constant | WindowBody | The scrolling region stays inside the shell, beneath a stationary title bar. |
| constant | GameWindowContent | Reading rhythm for compact game-window blocks and action keys. |
| function | WindowSnapPreview() | Decorative snap destination. Geometry and visibility belong to the layout owner. |
| function | WindowHeader() | The handle, Back and actions are siblings, so presses never start a drag. |
| function | WindowActions() | Consistent icons, ordering and accessible names for host-owned commands. |
WindowFramePropstype alias
Section titled “WindowFrameProps”type WindowFrameProps = HTMLAttributes<HTMLElement> & object;Window presentation only. The host owns geometry, focus order and lifecycle.
Type Declaration
Section titled “Type Declaration”| Name | Type | Description |
|---|---|---|
active? |
boolean |
- |
floating? |
boolean |
- |
fitContent? |
boolean |
Shrink a floating panel to its contents, up to the host’s max-height. |
WindowBackActiontype alias
Section titled “WindowBackAction”type WindowBackAction = object;A host-owned request to go back inside the window’s content.
Properties
Section titled “Properties”label: string;Accessible name, e.g. “Back in Games”.
onBack
Section titled “onBack”onBack: () => void;Request going back; the host owns the history and the outcome.
Returns
Section titled “Returns”void
optional hint?: string;Tooltip text, e.g. the keyboard route to the same action.
WindowHeaderPropstype alias
Section titled “WindowHeaderProps”type WindowHeaderProps = Omit< HTMLAttributes<HTMLElement>, "title" | "children"> & object;Supply handleProps only when the title is an interactive layout handle.
Type Declaration
Section titled “Type Declaration”| Name | Type | Description |
|---|---|---|
title |
string |
- |
subtitle? |
string |
Where the content is now, shown after the title and truncated first. |
icon? |
ReactNode |
- |
actions? |
ReactNode |
- |
back? |
WindowBackAction |
Present only while there is somewhere to go back to. |
crumbs? |
readonly WindowCrumb[] |
The content’s path, shown in place of the title and subtitle. The last crumb is the current place; earlier ones are links, and a crumb with siblings is a switcher. |
onCrumb()? |
(crumbId, siblingId?) => void |
Selected crumb, or the sibling chosen from a switcher crumb. |
status? |
readonly WindowStatus[] |
Quiet facts about the view, such as “Valid” or “Saved”, with beads. |
primary? |
readonly WindowCommand[] |
The view’s own commands, as buttons before the window controls. |
menu? |
readonly WindowCommand[] |
Less common commands, behind a ⋯ menu. |
onAction()? |
(id) => void |
A primary or menu command the person used, by its id. |
popover? |
HTMLElement | null |
Where header menus open; the host’s popover layer. |
density? |
"regular" | "compact" |
compact is a slim bar for tiled layouts; touch targets keep 44px. |
handleProps? |
Omit<ButtonHTMLAttributes<HTMLButtonElement>, "children" | "type"> |
- |
WindowActionsPropstype alias
Section titled “WindowActionsProps”type WindowActionsProps = object;Available callbacks determine available controls; no inert placeholder actions.
Properties
Section titled “Properties”title: string;floating?
Section titled “floating?”optional floating?: boolean;maximized?
Section titled “maximized?”optional maximized?: boolean;onPromote?
Section titled “onPromote?”optional onPromote?: () => void;Request making this window the main tiled window.
Returns
Section titled “Returns”void
onToggleFloating?
Section titled “onToggleFloating?”optional onToggleFloating?: () => void;Request switching between floating and tiled placement.
Returns
Section titled “Returns”void
onToggleMaximize?
Section titled “onToggleMaximize?”optional onToggleMaximize?: () => void;Request toggling maximized presentation.
Returns
Section titled “Returns”void
onMinimize?
Section titled “onMinimize?”optional onMinimize?: () => void;Request minimizing; the caller owns window visibility.
Returns
Section titled “Returns”void
onClose?
Section titled “onClose?”optional onClose?: () => void;Request closing; the caller owns disposal and removal.
Returns
Section titled “Returns”void
onSelect?
Section titled “onSelect?”optional onSelect?: () => void;Select a compact game panel for reading on a narrow screen.
Returns
Section titled “Returns”void
WindowFrameconstant
Section titled “WindowFrame”const WindowFrame: ForwardRefExoticComponent< HTMLAttributes<HTMLElement> & object & RefAttributes<HTMLElement>>;A clipped, rounded shell for either a tiled or floating application.
WindowBodyconstant
Section titled “WindowBody”const WindowBody: ForwardRefExoticComponent< HTMLAttributes<HTMLDivElement> & RefAttributes<HTMLDivElement>>;The scrolling region stays inside the shell, beneath a stationary title bar.
GameWindowContentconstant
Section titled “GameWindowContent”const GameWindowContent: ForwardRefExoticComponent< HTMLAttributes<HTMLDivElement> & RefAttributes<HTMLDivElement>>;Reading rhythm for compact game-window blocks and action keys.
WindowSnapPreview()function
Section titled “WindowSnapPreview()”function WindowSnapPreview(__namedParameters): Element;Decorative snap destination. Geometry and visibility belong to the layout owner.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
__namedParameters |
HTMLAttributes<HTMLDivElement> |
Returns
Section titled “Returns”Element
WindowHeader()function
Section titled “WindowHeader()”function WindowHeader(__namedParameters): Element;The handle, Back and actions are siblings, so presses never start a drag.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
__namedParameters |
WindowHeaderProps |
Returns
Section titled “Returns”Element
WindowActions()function
Section titled “WindowActions()”function WindowActions(__namedParameters): Element;Consistent icons, ordering and accessible names for host-owned commands.
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
__namedParameters |
WindowActionsProps |
Returns
Section titled “Returns”Element
References
Section titled “References”WindowCommand
Section titled “WindowCommand”Re-exports WindowCommand
WindowCrumb
Section titled “WindowCrumb”Re-exports WindowCrumb
WindowStatus
Section titled “WindowStatus”Re-exports WindowStatus