# normalizeEdges

```ts
import { normalizeEdges } from "@pibbl/core";
```

`normalizeEdges(value, property, context?)` converts an [`EdgeValues`](/reference/types/layout/#edgevalues) shorthand
into [`Edges`](/reference/types/layout/#edges). A number applies to all four edges; omitted values become zero.
Every edge must be finite and nonnegative, otherwise a `LayoutDiagnostic`
identifies the source property and context.

```ts
const padding = normalizeEdges({ top: 8, left: 12 }, "padding");
```

The accepted types are documented under Layout and styles.

## API details from source

<span id="api-normalizeEdges"></span>

Expands shorthand insets into four validated numeric edges.

```ts
normalizeEdges: (value: EdgeValues | undefined, property: string, context?: Readonly<LayoutDiagnosticContext>) => Edges
```

Related API: [normalizeEdges](/reference/functions/normalize-edges/), [EdgeValues](/reference/types/layout/#edgevalues), [LayoutDiagnosticContext](/reference/types/layout/#layoutdiagnosticcontext), [Edges](/reference/types/layout/#edges).

### Parameters

- **`value`** — Edge shorthand to expand; undefined uses the empty edge defaults. See
[EdgeValues](/reference/types/layout/#edgevalues) .

- **`property`** — Property name used in diagnostics.

- **`context`** — Component and property context for diagnostic messages. See
[LayoutDiagnosticContext](/reference/types/layout/#layoutdiagnosticcontext) .

### Returns

Explicit top, right, bottom, and left edge values. See [Edges](/reference/types/layout/#edges).

### See also

[EdgeValues](/reference/types/layout/#edgevalues)

[LayoutDiagnosticContext](/reference/types/layout/#layoutdiagnosticcontext)

[Edges](/reference/types/layout/#edges)

[View source — packages/core/src/lib/style/normalize.ts:22](/source/packages/core/src/lib/style/normalize-ts/#L22)

## Implementation guidance for agents

Read the [Authoring, signals, and lifecycle companion](/agents/topics/lifecycle/) for ownership, adaptation, failure modes, and verification. [Agent start](/agents/) provides the version-selection workflow.

## Complete minimal examples

- [Box resolution](/minimal-examples/layout/box-helpers/): Resolve padding, percentages, and a constrained box with typed diagnostics. [Plain source](/minimal/layout/box-helpers.ts)
## Documentation version

Documentation built with @pibbl/core 0.0.2, revision 272a94a. ALPHA — NOT FOR PRODUCTION USE.
