Skip to content
API reference

components/window

Import
import * as api from "@fungi.computer/caps/components/window";
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”
Signature
type WindowFrameProps = HTMLAttributes<HTMLElement> & object;

Window presentation only. The host owns geometry, focus order and lifecycle.

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”
Signature
type WindowBackAction = object;

A host-owned request to go back inside the window’s content.

Signature
label: string;

Accessible name, e.g. “Back in Games”.

Signature
onBack: () => void;

Request going back; the host owns the history and the outcome.

void

Signature
optional hint?: string;

Tooltip text, e.g. the keyboard route to the same action.


WindowHeaderPropstype alias

Section titled “WindowHeaderProps”
Signature
type WindowHeaderProps = Omit<
HTMLAttributes<HTMLElement>,
"title" | "children"
> &
object;

Supply handleProps only when the title is an interactive layout handle.

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”
Signature
type WindowActionsProps = object;

Available callbacks determine available controls; no inert placeholder actions.

Signature
title: string;
Signature
optional floating?: boolean;
Signature
optional maximized?: boolean;
Signature
optional onPromote?: () => void;

Request making this window the main tiled window.

void

Signature
optional onToggleFloating?: () => void;

Request switching between floating and tiled placement.

void

Signature
optional onToggleMaximize?: () => void;

Request toggling maximized presentation.

void

Signature
optional onMinimize?: () => void;

Request minimizing; the caller owns window visibility.

void

Signature
optional onClose?: () => void;

Request closing; the caller owns disposal and removal.

void

Signature
optional onSelect?: () => void;

Select a compact game panel for reading on a narrow screen.

void

WindowFrameconstant

Section titled “WindowFrame”
Signature
const WindowFrame: ForwardRefExoticComponent<
HTMLAttributes<HTMLElement> & object & RefAttributes<HTMLElement>
>;

A clipped, rounded shell for either a tiled or floating application.


WindowBodyconstant

Section titled “WindowBody”
Signature
const WindowBody: ForwardRefExoticComponent<
HTMLAttributes<HTMLDivElement> & RefAttributes<HTMLDivElement>
>;

The scrolling region stays inside the shell, beneath a stationary title bar.


GameWindowContentconstant

Section titled “GameWindowContent”
Signature
const GameWindowContent: ForwardRefExoticComponent<
HTMLAttributes<HTMLDivElement> & RefAttributes<HTMLDivElement>
>;

Reading rhythm for compact game-window blocks and action keys.

WindowSnapPreview()function

Section titled “WindowSnapPreview()”
Signature
function WindowSnapPreview(__namedParameters): Element;

Decorative snap destination. Geometry and visibility belong to the layout owner.

Parameter Type
__namedParameters HTMLAttributes<HTMLDivElement>

Element


WindowHeader()function

Section titled “WindowHeader()”
Signature
function WindowHeader(__namedParameters): Element;

The handle, Back and actions are siblings, so presses never start a drag.

Parameter Type
__namedParameters WindowHeaderProps

Element


WindowActions()function

Section titled “WindowActions()”
Signature
function WindowActions(__namedParameters): Element;

Consistent icons, ordering and accessible names for host-owned commands.

Parameter Type
__namedParameters WindowActionsProps

Element

Re-exports WindowCommand


Re-exports WindowCrumb


Re-exports WindowStatus