# resolveNodeSize

Canonical: https://docs.shumoku.dev/en/library/api/resolveNodeSize
Language: en

@shumoku/core · 0.4.0 · function

# resolveNodeSize

[Source](https://github.com/konoe-akitoshi/shumoku/blob/main/libs/@shumoku/core/src/layout/engine/index.ts#L85)

Resolve a node's display size — returns the node's own \`size\` if set, otherwise asks the engine for its body size. Pass \`engine\` to share its TextMeasurer cache with other queries. Without one, a process-wide default engine is created lazily; this is fine for one-off helpers but not ideal for hot loops where explicit control matters.

```
resolveNodeSize(node: { label?: string | string[]; size?: { height: number; width: number }; spec?: NodeSpec }, engine?: LayoutEngine): { height: number; width: number }
```

## Parameters

| Parameter | Type | Description | Default |
| --- | --- | --- | --- |
| `node` | `{ label?: string | string[]; size?: { height: number; width: number }; spec?: NodeSpec }` | No additional description. | `—` |
| `engine` | `LayoutEngine` | No additional description. | `—` |

## Returns

```
{ height: number; width: number }
```

[`libs/@shumoku/core/src/layout/engine/index.ts:85`](https://github.com/konoe-akitoshi/shumoku/blob/main/libs/@shumoku/core/src/layout/engine/index.ts#L85)
