generateLayers

Commons
stable

Compute the cumulative layout offset layers for the Origam layout system. Each registered layout item (AppBar, NavigationDrawer, Footer…) contributes its size to the running totals for its side (top/bottom/left/right), producing a cascade of offset objects used by the layout composable.

API

Signature

Signature TypeScript complète, extraite du fichier util.

typescript

API

Paramètres

Paramètres d'entrée acceptés par cet util.

layout
requis
Array<string>
Ordered list of layout item IDs. Items are stacked in this order.
positions
requis
Map<string, Ref<TDirectionBoth>>
Map from layout item ID to its anchored side (top | bottom | left | right).
layoutSizes
requis
Map<string, Ref<number | string>>
Map from layout item ID to its rendered size on its anchor axis (pixels or CSS length).
activeItems
requis
Map<string, Ref<boolean>>
Map from layout item ID to its visibility state. Inactive items contribute 0 to the offset.

API

Valeur de retour

La valeur retournée par cet util.

Ordered array of layer snapshots. Each entry holds the ID and the cumulative ILayer offsets at that point in the stack.

Usage

Exemples

Extraits de code prêts à coller.

Compute layout offsets for AppBar + Footer

typescript