Skip to content
filedom
Esc
↑↓navigate↵open⌘Jpreview
On this page

StageProvider

Provides the park position, background, and icon size for stages.

import { StageProvider } from 'filedom';

<StageProvider metrics={metrics} background="#1c1917">
  {children}
</StageProvider>

Wait for calibrated metrics before mounting a Stage; a Stage under a provider with no park throws. Nested providers inherit every value they do not override.

Props

PropType
metrics?SystemMetrics | null

Supplies the icon size and the default park, one icon in from the bottom-right corner.

TypeSystemMetrics | null
park?StagePoint

Overrides the park position.

TypeStagePoint
background?string

Cover colour (#rrggbb). Omit it when a flat-colour Wallpaper renders before the stages.

Typestring
childrenReact.ReactNode

Wallpaper, stages, and overlays.

TypeReact.ReactNode

The park is where warm files wait under a cover window filled with the background colour. Without background, the provider uses the colour of a flat-colour Wallpaper rendered inside it. An image wallpaper has no single colour, so pass background explicitly.

canonicalPark(metrics) returns the default park, { x: width - iconSize, y: height - iconSize }. Pass your own park when the play area covers that corner.

Was this page helpful?